1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-23 02:48:22 +02:00

move apps to own dir

This commit is contained in:
Pierre-antoine Comby
2019-08-11 14:47:44 +02:00
parent 7b23537ce1
commit fd9b9c34c7
29 changed files with 4 additions and 0 deletions

28
apps/note/views.py Normal file
View File

@ -0,0 +1,28 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.translation import gettext_lazy as _
from django.views.generic.edit import CreateView
from .models import Transaction
class TransactionCreate(LoginRequiredMixin, CreateView):
"""
Show transfer page
TODO: If user have sufficient rights, they can transfer from an other note
"""
model = Transaction
fields = ('destination', 'amount', 'reason')
def get_context_data(self, **kwargs):
"""
Add some context variables in template such as page title
"""
context = super().get_context_data(**kwargs)
context['title'] = _('Transfer money from your account '
'to one or others')
return context