mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Some refactoring between accounting and counter
This commit is contained in:
parent
e75da927c3
commit
8da149c979
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,6 +2,6 @@ db.sqlite3
|
|||||||
*.pyc
|
*.pyc
|
||||||
*__pycache__*
|
*__pycache__*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
env_sith
|
env/
|
||||||
doc/html
|
doc/html
|
||||||
data/
|
data/
|
||||||
|
@ -6,7 +6,7 @@ To start working on the project, just run the following commands:
|
|||||||
|
|
||||||
git clone https://ae-dev.utbm.fr/ae/Sith.git
|
git clone https://ae-dev.utbm.fr/ae/Sith.git
|
||||||
cd Sith
|
cd Sith
|
||||||
virtualenv --clear --python=python3 env_sith
|
virtualenv --clear --python=python3 env
|
||||||
source env_sith/bin/activate
|
source env_sith/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
./manage.py setup
|
./manage.py setup
|
||||||
|
@ -3,9 +3,6 @@ from django.contrib import admin
|
|||||||
from accounting.models import *
|
from accounting.models import *
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Customer)
|
|
||||||
admin.site.register(ProductType)
|
|
||||||
admin.site.register(Product)
|
|
||||||
admin.site.register(BankAccount)
|
admin.site.register(BankAccount)
|
||||||
admin.site.register(ClubAccount)
|
admin.site.register(ClubAccount)
|
||||||
admin.site.register(GeneralJournal)
|
admin.site.register(GeneralJournal)
|
||||||
|
@ -2,106 +2,65 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
from django.conf import settings
|
|
||||||
import accounting.models
|
import accounting.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('core', '0001_initial'),
|
|
||||||
('club', '0001_initial'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='AccountingType',
|
name='AccountingType',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('code', models.CharField(max_length=16, verbose_name='code')),
|
('code', models.CharField(max_length=16, verbose_name='code')),
|
||||||
('label', models.CharField(max_length=60, verbose_name='label')),
|
('label', models.CharField(max_length=60, verbose_name='label')),
|
||||||
('movement_type', models.CharField(max_length=12, verbose_name='movement type', choices=[('credit', 'Credit'), ('debit', 'Debit'), ('neutral', 'Neutral')])),
|
('movement_type', models.CharField(choices=[('credit', 'Credit'), ('debit', 'Debit'), ('neutral', 'Neutral')], max_length=12, verbose_name='movement type')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='BankAccount',
|
name='BankAccount',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
('rib', models.CharField(max_length=255, verbose_name='rib', blank=True)),
|
('rib', models.CharField(blank=True, max_length=255, verbose_name='rib')),
|
||||||
('number', models.CharField(max_length=255, verbose_name='account number', blank=True)),
|
('number', models.CharField(blank=True, max_length=255, verbose_name='account number')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='ClubAccount',
|
name='ClubAccount',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
('bank_account', models.ForeignKey(related_name='club_accounts', to='accounting.BankAccount')),
|
('bank_account', models.ForeignKey(to='accounting.BankAccount', related_name='club_accounts')),
|
||||||
('club', models.OneToOneField(related_name='club_accounts', to='club.Club')),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
|
||||||
name='Customer',
|
|
||||||
fields=[
|
|
||||||
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, primary_key=True, serialize=False)),
|
|
||||||
('account_id', models.CharField(max_length=10, verbose_name='account id', unique=True)),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name_plural': 'customers',
|
|
||||||
'verbose_name': 'customer',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='GeneralJournal',
|
name='GeneralJournal',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('start_date', models.DateField(verbose_name='start date')),
|
('start_date', models.DateField(verbose_name='start date')),
|
||||||
('end_date', models.DateField(null=True, default=None, verbose_name='end date', blank=True)),
|
('end_date', models.DateField(default=None, blank=True, verbose_name='end date', null=True)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
('closed', models.BooleanField(default=False, verbose_name='is closed')),
|
('closed', models.BooleanField(verbose_name='is closed', default=False)),
|
||||||
('club_account', models.ForeignKey(related_name='journals', to='accounting.ClubAccount')),
|
('club_account', models.ForeignKey(to='accounting.ClubAccount', related_name='journals')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Operation',
|
name='Operation',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
|
('amount', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='amount')),
|
||||||
('date', models.DateField(verbose_name='date')),
|
('date', models.DateField(verbose_name='date')),
|
||||||
('remark', models.TextField(max_length=255, verbose_name='remark')),
|
('remark', models.TextField(max_length=255, verbose_name='remark')),
|
||||||
('mode', models.CharField(max_length=255, verbose_name='payment method', choices=[('cheque', 'Chèque'), ('cash', 'Espèce'), ('transfert', 'Virement'), ('card', 'Carte banquaire')])),
|
('mode', models.CharField(choices=[('cheque', 'Chèque'), ('cash', 'Espèce'), ('transfert', 'Virement'), ('card', 'Carte banquaire')], max_length=255, verbose_name='payment method')),
|
||||||
('cheque_number', models.IntegerField(verbose_name='cheque number')),
|
('cheque_number', models.IntegerField(verbose_name='cheque number')),
|
||||||
('invoice', models.FileField(null=True, upload_to='invoices', blank=True)),
|
('invoice', models.FileField(blank=True, upload_to='invoices', null=True)),
|
||||||
('done', models.BooleanField(default=False, verbose_name='is done')),
|
('done', models.BooleanField(verbose_name='is done', default=False)),
|
||||||
('journal', models.ForeignKey(related_name='invoices', to='accounting.GeneralJournal')),
|
('journal', models.ForeignKey(to='accounting.GeneralJournal', related_name='operations')),
|
||||||
('type', models.ForeignKey(related_name='operations', to='accounting.AccountingType')),
|
('type', models.ForeignKey(to='accounting.AccountingType', related_name='operations')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
|
||||||
name='Product',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
|
||||||
('description', models.TextField(verbose_name='description', blank=True)),
|
|
||||||
('code', models.CharField(max_length=10, verbose_name='code')),
|
|
||||||
('purchase_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='purchase price')),
|
|
||||||
('selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='selling price')),
|
|
||||||
('special_selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='special selling price')),
|
|
||||||
('icon', models.ImageField(null=True, upload_to='products', blank=True)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='ProductType',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
|
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
|
||||||
('description', models.TextField(null=True, verbose_name='description', blank=True)),
|
|
||||||
('icon', models.ImageField(null=True, upload_to='products', blank=True)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='product',
|
|
||||||
name='product_type',
|
|
||||||
field=models.ForeignKey(null=True, to='accounting.ProductType', related_name='products', blank=True),
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('accounting', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='operation',
|
|
||||||
name='journal',
|
|
||||||
field=models.ForeignKey(to='accounting.GeneralJournal', related_name='operations'),
|
|
||||||
),
|
|
||||||
]
|
|
@ -8,25 +8,18 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('club', '0001_initial'),
|
('club', '0001_initial'),
|
||||||
('accounting', '0002_auto_20160502_0952'),
|
('accounting', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='bankaccount',
|
|
||||||
name='club',
|
|
||||||
field=models.OneToOneField(to='club.Club', related_name='bank_accounts', default=1),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='product',
|
|
||||||
name='club',
|
|
||||||
field=models.OneToOneField(to='club.Club', related_name='products', default=1),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='clubaccount',
|
model_name='clubaccount',
|
||||||
name='club',
|
name='club',
|
||||||
field=models.OneToOneField(related_name='club_account', to='club.Club'),
|
field=models.OneToOneField(to='club.Club', related_name='club_account'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='bankaccount',
|
||||||
|
name='club',
|
||||||
|
field=models.ForeignKey(to='club.Club', related_name='bank_accounts'),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('accounting', '0003_auto_20160509_0712'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='product',
|
|
||||||
name='club',
|
|
||||||
field=models.ForeignKey(related_name='products', to='club.Club'),
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('accounting', '0004_auto_20160509_0715'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='bankaccount',
|
|
||||||
name='club',
|
|
||||||
field=models.ForeignKey(related_name='bank_accounts', to='club.Club'),
|
|
||||||
),
|
|
||||||
]
|
|
@ -24,65 +24,6 @@ class CurrencyField(models.DecimalField):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
class Customer(models.Model):
|
|
||||||
"""
|
|
||||||
This class extends a user to make a customer. It adds some basic customers informations, such as the accound ID, and
|
|
||||||
is used by other accounting classes as reference to the customer, rather than using User
|
|
||||||
"""
|
|
||||||
user = models.OneToOneField(User, primary_key=True)
|
|
||||||
account_id = models.CharField(_('account id'), max_length=10, unique=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
verbose_name = _('customer')
|
|
||||||
verbose_name_plural = _('customers')
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.user.username
|
|
||||||
|
|
||||||
class ProductType(models.Model):
|
|
||||||
"""
|
|
||||||
This describes a product type
|
|
||||||
Useful only for categorizing, changes are made at the product level for now
|
|
||||||
"""
|
|
||||||
name = models.CharField(_('name'), max_length=30)
|
|
||||||
description = models.TextField(_('description'), null=True, blank=True)
|
|
||||||
icon = models.ImageField(upload_to='products', null=True, blank=True)
|
|
||||||
|
|
||||||
def is_owned_by(self, user):
|
|
||||||
"""
|
|
||||||
Method to see if that object can be edited by the given user
|
|
||||||
"""
|
|
||||||
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
||||||
class Product(models.Model):
|
|
||||||
"""
|
|
||||||
This describes a product, with all its related informations
|
|
||||||
"""
|
|
||||||
name = models.CharField(_('name'), max_length=30)
|
|
||||||
description = models.TextField(_('description'), blank=True)
|
|
||||||
product_type = models.ForeignKey(ProductType, related_name='products', null=True, blank=True)
|
|
||||||
code = models.CharField(_('code'), max_length=10)
|
|
||||||
purchase_price = CurrencyField(_('purchase price'))
|
|
||||||
selling_price = CurrencyField(_('selling price'))
|
|
||||||
special_selling_price = CurrencyField(_('special selling price'))
|
|
||||||
icon = models.ImageField(upload_to='products', null=True, blank=True)
|
|
||||||
club = models.ForeignKey(Club, related_name="products")
|
|
||||||
|
|
||||||
def is_owned_by(self, user): # TODO do this for all models
|
|
||||||
"""
|
|
||||||
Method to see if that object can be edited by the given user
|
|
||||||
"""
|
|
||||||
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
||||||
class BankAccount(models.Model):
|
class BankAccount(models.Model):
|
||||||
name = models.CharField(_('name'), max_length=30)
|
name = models.CharField(_('name'), max_length=30)
|
||||||
@ -196,6 +137,7 @@ class Operation(models.Model):
|
|||||||
An operation is a line in the journal, a debit or a credit
|
An operation is a line in the journal, a debit or a credit
|
||||||
"""
|
"""
|
||||||
journal = models.ForeignKey(GeneralJournal, related_name="operations", null=False)
|
journal = models.ForeignKey(GeneralJournal, related_name="operations", null=False)
|
||||||
|
amount = CurrencyField(_('amount'))
|
||||||
date = models.DateField(_('date'))
|
date = models.DateField(_('date'))
|
||||||
remark = models.TextField(_('remark'), max_length=255)
|
remark = models.TextField(_('remark'), max_length=255)
|
||||||
mode = models.CharField(_('payment method'), max_length=255, choices=settings.SITH_ACCOUNTING_PAYMENT_METHOD)
|
mode = models.CharField(_('payment method'), max_length=255, choices=settings.SITH_ACCOUNTING_PAYMENT_METHOD)
|
||||||
|
@ -17,24 +17,24 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Club',
|
name='Club',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
('unix_name', models.CharField(unique=True, max_length=30, verbose_name='unix name', error_messages={'unique': 'A club with that unix name already exists.'}, validators=[django.core.validators.RegexValidator('^[a-z0-9][a-z0-9._-]*[a-z0-9]$', 'Enter a valid unix name. This value may contain only letters, numbers ./-/_ characters.')])),
|
('unix_name', models.CharField(validators=[django.core.validators.RegexValidator('^[a-z0-9][a-z0-9._-]*[a-z0-9]$', 'Enter a valid unix name. This value may contain only letters, numbers ./-/_ characters.')], unique=True, max_length=30, verbose_name='unix name', error_messages={'unique': 'A club with that unix name already exists.'})),
|
||||||
('address', models.CharField(max_length=254, verbose_name='address')),
|
('address', models.CharField(max_length=254, verbose_name='address')),
|
||||||
('edit_groups', models.ManyToManyField(to='core.Group', blank=True, related_name='editable_club')),
|
('edit_groups', models.ManyToManyField(related_name='editable_club', to='core.Group', blank=True)),
|
||||||
('owner_group', models.ForeignKey(default=1, related_name='owned_club', to='core.Group')),
|
('owner_group', models.ForeignKey(to='core.Group', related_name='owned_club', default=1)),
|
||||||
('parent', models.ForeignKey(blank=True, related_name='children', to='club.Club', null=True)),
|
('parent', models.ForeignKey(to='club.Club', related_name='children', null=True, blank=True)),
|
||||||
('view_groups', models.ManyToManyField(to='core.Group', blank=True, related_name='viewable_club')),
|
('view_groups', models.ManyToManyField(related_name='viewable_club', to='core.Group', blank=True)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Membership',
|
name='Membership',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('start_date', models.DateField(auto_now=True, verbose_name='start date')),
|
('start_date', models.DateField(auto_now=True, verbose_name='start date')),
|
||||||
('end_date', models.DateField(blank=True, null=True, verbose_name='end date')),
|
('end_date', models.DateField(blank=True, verbose_name='end date', null=True)),
|
||||||
('role', models.IntegerField(choices=[(0, 'Curieux'), (1, 'Membre actif'), (2, 'Membre du bureau'), (3, 'Responsable info'), (4, 'Secrétaire'), (5, 'Responsable com'), (7, 'Trésorier'), (9, 'Vice-Président'), (10, 'Président')], verbose_name='role', default=0)),
|
('role', models.IntegerField(choices=[(0, 'Curieux'), (1, 'Membre actif'), (2, 'Membre du bureau'), (3, 'Responsable info'), (4, 'Secrétaire'), (5, 'Responsable com'), (7, 'Trésorier'), (9, 'Vice-Président'), (10, 'Président')], verbose_name='role', default=0)),
|
||||||
('description', models.CharField(max_length=30, blank=True, verbose_name='description')),
|
('description', models.CharField(blank=True, max_length=30, verbose_name='description')),
|
||||||
('club', models.ForeignKey(to='club.Club', related_name='members')),
|
('club', models.ForeignKey(to='club.Club', related_name='members')),
|
||||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='membership')),
|
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='membership')),
|
||||||
],
|
],
|
||||||
|
@ -5,9 +5,10 @@ from django.conf import settings
|
|||||||
|
|
||||||
|
|
||||||
from core.models import Group, User, Page, PageRev
|
from core.models import Group, User, Page, PageRev
|
||||||
from accounting.models import Customer, GeneralJournal, ProductType, Product, BankAccount, ClubAccount, Operation, AccountingType
|
from accounting.models import GeneralJournal, BankAccount, ClubAccount, Operation, AccountingType
|
||||||
from club.models import Club, Membership
|
from club.models import Club, Membership
|
||||||
from subscription.models import Subscription, Subscriber
|
from subscription.models import Subscription, Subscriber
|
||||||
|
from counter.models import Customer, ProductType, Product
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = "Populate a new instance of the Sith AE"
|
help = "Populate a new instance of the Sith AE"
|
||||||
|
@ -4,11 +4,6 @@ from django.core.management import call_command
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
from core.models import Group, User, Page, PageRev
|
|
||||||
from accounting.models import Customer, GeneralJournal, ProductType, Product
|
|
||||||
from club.models import Club
|
|
||||||
from subscription.models import Subscription, Subscriber
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = "Set up a new instance of the Sith AE"
|
help = "Set up a new instance of the Sith AE"
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
from django.conf import settings
|
||||||
import django.core.validators
|
import django.core.validators
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import core.models
|
import core.models
|
||||||
import django.contrib.auth.models
|
import django.contrib.auth.models
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -19,23 +19,23 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='User',
|
name='User',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
|
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
('password', models.CharField(verbose_name='password', max_length=128)),
|
||||||
('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)),
|
('last_login', models.DateTimeField(blank=True, verbose_name='last login', null=True)),
|
||||||
('is_superuser', models.BooleanField(verbose_name='superuser status', default=False, help_text='Designates that this user has all permissions without explicitly assigning them.')),
|
('is_superuser', models.BooleanField(verbose_name='superuser status', default=False, help_text='Designates that this user has all permissions without explicitly assigning them.')),
|
||||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, verbose_name='username', help_text='Required. 254 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], max_length=254)),
|
('username', models.CharField(verbose_name='username', max_length=254, error_messages={'unique': 'A user with that username already exists.'}, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], help_text='Required. 254 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True)),
|
||||||
('first_name', models.CharField(max_length=30, verbose_name='first name')),
|
('first_name', models.CharField(verbose_name='first name', max_length=30)),
|
||||||
('last_name', models.CharField(max_length=30, verbose_name='last name')),
|
('last_name', models.CharField(verbose_name='last name', max_length=30)),
|
||||||
('email', models.EmailField(max_length=254, verbose_name='email address', unique=True)),
|
('email', models.EmailField(verbose_name='email address', max_length=254, unique=True)),
|
||||||
('date_of_birth', models.DateField(verbose_name='date of birth')),
|
('date_of_birth', models.DateField(verbose_name='date of birth')),
|
||||||
('nick_name', models.CharField(max_length=30, blank=True)),
|
('nick_name', models.CharField(blank=True, max_length=30)),
|
||||||
('is_staff', models.BooleanField(verbose_name='staff status', default=False, help_text='Designates whether the user can log into this admin site.')),
|
('is_staff', models.BooleanField(verbose_name='staff status', default=False, help_text='Designates whether the user can log into this admin site.')),
|
||||||
('is_active', models.BooleanField(verbose_name='active', default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.')),
|
('is_active', models.BooleanField(verbose_name='active', default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.')),
|
||||||
('date_joined', models.DateField(verbose_name='date joined', auto_now_add=True)),
|
('date_joined', models.DateField(verbose_name='date joined', auto_now_add=True)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name_plural': 'users',
|
|
||||||
'verbose_name': 'user',
|
'verbose_name': 'user',
|
||||||
|
'verbose_name_plural': 'users',
|
||||||
'permissions': (('change_prop_user', "Can change the user's properties (groups, ...)"), ('view_user', "Can view user's profile")),
|
'permissions': (('change_prop_user', "Can change the user's properties (groups, ...)"), ('view_user', "Can view user's profile")),
|
||||||
},
|
},
|
||||||
managers=[
|
managers=[
|
||||||
@ -45,21 +45,22 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Group',
|
name='Group',
|
||||||
fields=[
|
fields=[
|
||||||
('group_ptr', models.OneToOneField(to='auth.Group', auto_created=True, parent_link=True, primary_key=True, serialize=False)),
|
('group_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, to='auth.Group', serialize=False)),
|
||||||
('is_meta', models.BooleanField(verbose_name='meta group status', default=False, help_text='Whether a group is a meta group or not')),
|
('is_meta', models.BooleanField(verbose_name='meta group status', default=False, help_text='Whether a group is a meta group or not')),
|
||||||
|
('description', models.CharField(verbose_name='description', max_length=60)),
|
||||||
],
|
],
|
||||||
bases=('auth.group',),
|
bases=('auth.group',),
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Page',
|
name='Page',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
|
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='page name')),
|
('name', models.CharField(verbose_name='page name', max_length=30)),
|
||||||
('_full_name', models.CharField(verbose_name='page name', max_length=255, blank=True)),
|
('_full_name', models.CharField(blank=True, verbose_name='page name', max_length=255)),
|
||||||
('edit_groups', models.ManyToManyField(to='core.Group', blank=True, related_name='editable_page')),
|
('edit_groups', models.ManyToManyField(blank=True, to='core.Group', related_name='editable_page')),
|
||||||
('owner_group', models.ForeignKey(to='core.Group', default=1, related_name='owned_page')),
|
('owner_group', models.ForeignKey(default=1, related_name='owned_page', to='core.Group')),
|
||||||
('parent', models.ForeignKey(to='core.Page', on_delete=django.db.models.deletion.SET_NULL, related_name='children', null=True, blank=True)),
|
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Page', related_name='children')),
|
||||||
('view_groups', models.ManyToManyField(to='core.Group', blank=True, related_name='viewable_page')),
|
('view_groups', models.ManyToManyField(blank=True, to='core.Group', related_name='viewable_page')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'permissions': (('change_prop_page', "Can change the page's properties (groups, ...)"), ('view_page', 'Can view the page')),
|
'permissions': (('change_prop_page', "Can change the page's properties (groups, ...)"), ('view_page', 'Can view the page')),
|
||||||
@ -68,12 +69,12 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='PageRev',
|
name='PageRev',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
|
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||||
('title', models.CharField(verbose_name='page title', max_length=255, blank=True)),
|
('title', models.CharField(blank=True, verbose_name='page title', max_length=255)),
|
||||||
('content', models.TextField(verbose_name='page content', blank=True)),
|
('content', models.TextField(blank=True, verbose_name='page content')),
|
||||||
('date', models.DateTimeField(verbose_name='date', auto_now=True)),
|
('date', models.DateTimeField(verbose_name='date', auto_now=True)),
|
||||||
('author', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='page_rev')),
|
('author', models.ForeignKey(related_name='page_rev', to=settings.AUTH_USER_MODEL)),
|
||||||
('page', models.ForeignKey(to='core.Page', related_name='revisions')),
|
('page', models.ForeignKey(related_name='revisions', to='core.Page')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ['date'],
|
'ordering': ['date'],
|
||||||
@ -82,27 +83,27 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='edit_groups',
|
name='edit_groups',
|
||||||
field=models.ManyToManyField(to='core.Group', blank=True, related_name='editable_user'),
|
field=models.ManyToManyField(blank=True, to='core.Group', related_name='editable_user'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='groups',
|
name='groups',
|
||||||
field=models.ManyToManyField(to='auth.Group', verbose_name='groups', help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_query_name='user', blank=True, related_name='user_set'),
|
field=models.ManyToManyField(blank=True, verbose_name='groups', related_name='user_set', related_query_name='user', to='auth.Group', help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='owner_group',
|
name='owner_group',
|
||||||
field=models.ForeignKey(to='core.Group', default=1, related_name='owned_user'),
|
field=models.ForeignKey(default=1, related_name='owned_user', to='core.Group'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='user_permissions',
|
name='user_permissions',
|
||||||
field=models.ManyToManyField(to='auth.Permission', verbose_name='user permissions', help_text='Specific permissions for this user.', related_query_name='user', blank=True, related_name='user_set'),
|
field=models.ManyToManyField(blank=True, verbose_name='user permissions', related_name='user_set', related_query_name='user', to='auth.Permission', help_text='Specific permissions for this user.'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='view_groups',
|
name='view_groups',
|
||||||
field=models.ManyToManyField(to='core.Group', blank=True, related_name='viewable_user'),
|
field=models.ManyToManyField(blank=True, to='core.Group', related_name='viewable_user'),
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='MetaGroup',
|
name='MetaGroup',
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('core', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='group',
|
|
||||||
name='description',
|
|
||||||
field=models.CharField(max_length=60, verbose_name='description', default='guy'),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
]
|
|
@ -3,7 +3,6 @@ from django.views.generic import ListView
|
|||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
|
||||||
from core.models import RealGroup
|
from core.models import RealGroup
|
||||||
from core.views.forms import GroupEditForm
|
|
||||||
from core.views import CanEditMixin
|
from core.views import CanEditMixin
|
||||||
|
|
||||||
class GroupListView(CanEditMixin, ListView):
|
class GroupListView(CanEditMixin, ListView):
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from counter.models import Counter
|
from counter.models import *
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
admin.site.register(Customer)
|
||||||
|
admin.site.register(ProductType)
|
||||||
|
admin.site.register(Product)
|
||||||
admin.site.register(Counter)
|
admin.site.register(Counter)
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
import accounting.models
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -9,20 +11,66 @@ class Migration(migrations.Migration):
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
('club', '0001_initial'),
|
('club', '0001_initial'),
|
||||||
('core', '0001_initial'),
|
('core', '0001_initial'),
|
||||||
('accounting', '0001_initial'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Counter',
|
name='Counter',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
('type', models.CharField(max_length=255, verbose_name='subscription type', choices=[('BAR', 'Bar'), ('OFFICE', 'Office')])),
|
('type', models.CharField(choices=[('BAR', 'Bar'), ('OFFICE', 'Office')], max_length=255, verbose_name='subscription type')),
|
||||||
('club', models.ForeignKey(to='club.Club', related_name='counters')),
|
('club', models.ForeignKey(to='club.Club', related_name='counters')),
|
||||||
('edit_groups', models.ManyToManyField(blank=True, related_name='editable_counters', to='core.Group')),
|
('edit_groups', models.ManyToManyField(related_name='editable_counters', to='core.Group', blank=True)),
|
||||||
('products', models.ManyToManyField(blank=True, related_name='counters', to='accounting.Product')),
|
|
||||||
('view_groups', models.ManyToManyField(blank=True, related_name='viewable_counters', to='core.Group')),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Customer',
|
||||||
|
fields=[
|
||||||
|
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, primary_key=True, serialize=False)),
|
||||||
|
('account_id', models.CharField(unique=True, max_length=10, verbose_name='account id')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name_plural': 'customers',
|
||||||
|
'verbose_name': 'customer',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Product',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
|
('description', models.TextField(blank=True, verbose_name='description')),
|
||||||
|
('code', models.CharField(max_length=10, verbose_name='code')),
|
||||||
|
('purchase_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='purchase price')),
|
||||||
|
('selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='selling price')),
|
||||||
|
('special_selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='special selling price')),
|
||||||
|
('icon', models.ImageField(blank=True, upload_to='products', null=True)),
|
||||||
|
('club', models.ForeignKey(to='club.Club', related_name='products')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='ProductType',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
|
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||||
|
('description', models.TextField(blank=True, verbose_name='description', null=True)),
|
||||||
|
('icon', models.ImageField(blank=True, upload_to='products', null=True)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='product',
|
||||||
|
name='product_type',
|
||||||
|
field=models.ForeignKey(to='counter.ProductType', related_name='products', null=True, blank=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='counter',
|
||||||
|
name='products',
|
||||||
|
field=models.ManyToManyField(related_name='counters', to='counter.Product', blank=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='counter',
|
||||||
|
name='view_groups',
|
||||||
|
field=models.ManyToManyField(related_name='viewable_counters', to='core.Group', blank=True),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
@ -7,10 +7,70 @@ from django.core.urlresolvers import reverse
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from club.models import Club
|
from club.models import Club
|
||||||
from accounting.models import Product
|
from accounting.models import CurrencyField
|
||||||
from core.models import Group
|
from core.models import Group, User
|
||||||
from subscription.models import Subscriber
|
from subscription.models import Subscriber
|
||||||
|
|
||||||
|
class Customer(models.Model):
|
||||||
|
"""
|
||||||
|
This class extends a user to make a customer. It adds some basic customers informations, such as the accound ID, and
|
||||||
|
is used by other accounting classes as reference to the customer, rather than using User
|
||||||
|
"""
|
||||||
|
user = models.OneToOneField(User, primary_key=True)
|
||||||
|
account_id = models.CharField(_('account id'), max_length=10, unique=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('customer')
|
||||||
|
verbose_name_plural = _('customers')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.user.username
|
||||||
|
|
||||||
|
class ProductType(models.Model):
|
||||||
|
"""
|
||||||
|
This describes a product type
|
||||||
|
Useful only for categorizing, changes are made at the product level for now
|
||||||
|
"""
|
||||||
|
name = models.CharField(_('name'), max_length=30)
|
||||||
|
description = models.TextField(_('description'), null=True, blank=True)
|
||||||
|
icon = models.ImageField(upload_to='products', null=True, blank=True)
|
||||||
|
|
||||||
|
def is_owned_by(self, user):
|
||||||
|
"""
|
||||||
|
Method to see if that object can be edited by the given user
|
||||||
|
"""
|
||||||
|
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
class Product(models.Model):
|
||||||
|
"""
|
||||||
|
This describes a product, with all its related informations
|
||||||
|
"""
|
||||||
|
name = models.CharField(_('name'), max_length=30)
|
||||||
|
description = models.TextField(_('description'), blank=True)
|
||||||
|
product_type = models.ForeignKey(ProductType, related_name='products', null=True, blank=True)
|
||||||
|
code = models.CharField(_('code'), max_length=10)
|
||||||
|
purchase_price = CurrencyField(_('purchase price'))
|
||||||
|
selling_price = CurrencyField(_('selling price'))
|
||||||
|
special_selling_price = CurrencyField(_('special selling price'))
|
||||||
|
icon = models.ImageField(upload_to='products', null=True, blank=True)
|
||||||
|
club = models.ForeignKey(Club, related_name="products")
|
||||||
|
|
||||||
|
def is_owned_by(self, user): # TODO do this for all models
|
||||||
|
"""
|
||||||
|
Method to see if that object can be edited by the given user
|
||||||
|
"""
|
||||||
|
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
class Counter(models.Model):
|
class Counter(models.Model):
|
||||||
name = models.CharField(_('name'), max_length=30)
|
name = models.CharField(_('name'), max_length=30)
|
||||||
club = models.ForeignKey(Club, related_name="counters")
|
club = models.ForeignKey(Club, related_name="counters")
|
||||||
@ -48,3 +108,9 @@ class Counter(models.Model):
|
|||||||
Counter.barmen_session[counter_id]['users'] = set()
|
Counter.barmen_session[counter_id]['users'] = set()
|
||||||
return bl
|
return bl
|
||||||
|
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# une classe Vente
|
||||||
|
# foreign key vers comptoir, vendeur, client, produit, mais stocker le prix du produit, pour gerer les maj de prix
|
||||||
|
# une classe Rechargement
|
||||||
|
# foreign key vers comptoir, vendeur, client, plus montant
|
||||||
|
@ -12,8 +12,7 @@ from django import forms
|
|||||||
|
|
||||||
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin
|
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin
|
||||||
from subscription.models import Subscriber
|
from subscription.models import Subscriber
|
||||||
from accounting.models import Customer, Product
|
from counter.models import Counter, Customer, Product
|
||||||
from counter.models import Counter
|
|
||||||
|
|
||||||
class GetUserForm(forms.Form):
|
class GetUserForm(forms.Form):
|
||||||
"""
|
"""
|
||||||
|
@ -15,11 +15,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Subscription',
|
name='Subscription',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('subscription_type', models.CharField(max_length=255, verbose_name='subscription type', choices=[('cursus-branche', 'Cursus Branche'), ('cursus-tronc-commun', 'Cursus Tronc Commun'), ('deux-semestres', 'Deux semestres'), ('un-semestre', 'Un semestre')])),
|
('subscription_type', models.CharField(choices=[('cursus-branche', 'Cursus Branche'), ('cursus-tronc-commun', 'Cursus Tronc Commun'), ('deux-semestres', 'Deux semestres'), ('un-semestre', 'Un semestre')], max_length=255, verbose_name='subscription type')),
|
||||||
('subscription_start', models.DateField(verbose_name='subscription start')),
|
('subscription_start', models.DateField(verbose_name='subscription start')),
|
||||||
('subscription_end', models.DateField(verbose_name='subscription end')),
|
('subscription_end', models.DateField(verbose_name='subscription end')),
|
||||||
('payment_method', models.CharField(max_length=255, verbose_name='payment method', choices=[('cheque', 'Chèque'), ('cash', 'Espèce'), ('other', 'Autre')])),
|
('payment_method', models.CharField(choices=[('cheque', 'Chèque'), ('cash', 'Espèce'), ('other', 'Autre')], max_length=255, verbose_name='payment method')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ['subscription_start'],
|
'ordering': ['subscription_start'],
|
||||||
|
Loading…
Reference in New Issue
Block a user