Polymorphic search
This commit is contained in:
parent
5110d6a16b
commit
1bfcedd4fe
3 changed files with 100 additions and 53 deletions
|
|
@ -36,6 +36,10 @@ class Note(PolymorphicModel):
|
|||
max_length=255,
|
||||
blank=True,
|
||||
)
|
||||
created_at = models.DateTimeField(
|
||||
verbose_name=_('created at'),
|
||||
auto_now_add=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("note")
|
||||
|
|
@ -50,6 +54,7 @@ class NoteUser(Note):
|
|||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.PROTECT,
|
||||
related_name='note',
|
||||
verbose_name=_('user'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
@ -68,12 +73,16 @@ class NoteClub(Note):
|
|||
'member.Club',
|
||||
on_delete=models.PROTECT,
|
||||
related_name='note',
|
||||
verbose_name=_('club'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("club note")
|
||||
verbose_name_plural = _("clubs notes")
|
||||
|
||||
def __str__(self):
|
||||
return _("Note for %(club)s club") % {'club': str(self.club)}
|
||||
|
||||
|
||||
class NoteSpecial(Note):
|
||||
"""
|
||||
|
|
@ -94,6 +103,9 @@ class NoteSpecial(Note):
|
|||
verbose_name = _("special note")
|
||||
verbose_name_plural = _("special notes")
|
||||
|
||||
def __str__(self):
|
||||
return self.special_type
|
||||
|
||||
|
||||
class Alias(models.Model):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue