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

Remove note activities

This commit is contained in:
Yohann D'ANELLO
2020-03-31 14:57:44 +02:00
parent 12945945bc
commit dd3b7bd7e5
15 changed files with 16 additions and 470 deletions

View File

@ -1,13 +1,13 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser, NoteActivity
from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser
from .transactions import MembershipTransaction, Transaction, \
TemplateCategory, TransactionTemplate, RecurrentTransaction, SpecialTransaction
__all__ = [
# Notes
'Alias', 'Note', 'NoteClub', 'NoteSpecial', 'NoteUser', 'NoteActivity',
'Alias', 'Note', 'NoteClub', 'NoteSpecial', 'NoteUser',
# Transactions
'MembershipTransaction', 'Transaction', 'TemplateCategory', 'TransactionTemplate',
'RecurrentTransaction', 'SpecialTransaction',

View File

@ -4,13 +4,11 @@
import unicodedata
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
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
@ -176,40 +174,6 @@ class NoteSpecial(Note):
return self.special_type
class NoteActivity(Note):
"""
A :model:`note.Note` for accounts that are not attached to a user neither to a club,
that only need to store and transfer money (notes for activities, departments, ...)
"""
note_name = models.CharField(
verbose_name=_('name'),
max_length=255,
unique=True,
)
club = models.ForeignKey(
Club,
on_delete=models.PROTECT,
related_name="linked_notes",
verbose_name=_("club"),
)
controller = models.ForeignKey(
User,
on_delete=models.PROTECT,
related_name="+",
verbose_name=_("controller"),
)
class Meta:
verbose_name = _("activity note")
verbose_name_plural = _("activity notes")
def __str__(self):
return self.note_name
class Alias(models.Model):
"""
points toward a :model:`note.NoteUser` or :model;`note.NoteClub` instance.