mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-29 04:40:55 +02:00
Guests can't be invited more than 5 times a year and a member can't invite more than 3 people per activity.
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
from django import forms
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from note_kfet.inputs import AutocompleteModelSelect
|
||||
from note_kfet.inputs import Autocomplete
|
||||
|
||||
from .models import TransactionTemplate, NoteClub
|
||||
|
||||
@ -31,7 +31,7 @@ class TransactionTemplateForm(forms.ModelForm):
|
||||
# forward=(forward.Const('TYPE', 'note_type') où TYPE est dans {user, club, special}
|
||||
widgets = {
|
||||
'destination':
|
||||
AutocompleteModelSelect(
|
||||
Autocomplete(
|
||||
NoteClub,
|
||||
attrs={
|
||||
'api_url': '/api/note/note/',
|
||||
|
@ -10,6 +10,8 @@ from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
from member.models import Club
|
||||
|
||||
"""
|
||||
Defines each note types
|
||||
"""
|
||||
@ -174,6 +176,35 @@ class NoteSpecial(Note):
|
||||
return self.special_type
|
||||
|
||||
|
||||
class NoteCommon(Note):
|
||||
"""
|
||||
A :model:`note.Note` for special accounts, where real money enter or leave the system
|
||||
- bank check
|
||||
- credit card
|
||||
- bank transfer
|
||||
- cash
|
||||
- refund
|
||||
This Type of Note is not associated to a :model:`auth.User` or :model:`member.Club` .
|
||||
"""
|
||||
note_name = models.CharField(
|
||||
max_length=255,
|
||||
unique=True,
|
||||
)
|
||||
|
||||
club = models.ForeignKey(
|
||||
Club,
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_("club"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("common note")
|
||||
verbose_name_plural = _("common notes")
|
||||
|
||||
def __str__(self):
|
||||
return self.note_name
|
||||
|
||||
|
||||
class Alias(models.Model):
|
||||
"""
|
||||
points toward a :model:`note.NoteUser` or :model;`note.NoteClub` instance.
|
||||
|
Reference in New Issue
Block a user