205 lines
11 KiB
Python
205 lines
11 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
from django.conf import settings
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
('auth', '0008_alter_user_username_max_length'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Profile',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
|
|
('login_clipper', models.CharField(verbose_name='login clipper', max_length=8, blank=True)),
|
|
('phone', models.CharField(verbose_name='téléphone', max_length=20, blank=True)),
|
|
('occupation', models.CharField(choices=[('exterieur', 'Extérieur'), ('1A', '1A'), ('2A', '2A'), ('3A', '3A'), ('4A', '4A'), ('archicube', 'Archicube'), ('doctorant', 'Doctorant'), ('CST', 'CST')], verbose_name='occupation', max_length=9, default='1A')),
|
|
('departement', models.CharField(verbose_name='département', max_length=50, blank=True)),
|
|
('comments', models.TextField(verbose_name="commentaires visibles par l'utilisateur", blank=True)),
|
|
('user', models.OneToOneField(
|
|
on_delete=models.CASCADE,
|
|
to=settings.AUTH_USER_MODEL,
|
|
related_name='profile',
|
|
verbose_name='utilisateur',
|
|
)),
|
|
],
|
|
options={
|
|
'verbose_name': 'profil',
|
|
'verbose_name_plural': 'profils',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Association',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=30, unique=True, verbose_name="nom de l'association")),
|
|
('members_group', models.ForeignKey(blank=True, null=True, on_delete=models.deletion.PROTECT, related_name='member_group_of', to='auth.Group', verbose_name='groupe des membres')),
|
|
('staff_group', models.ForeignKey(blank=True, null=True, on_delete=models.deletion.PROTECT, related_name='staff_group_of', to='auth.Group', verbose_name='groupe des membres du bureau')),
|
|
],
|
|
options={
|
|
'verbose_name': 'association',
|
|
'verbose_name_plural': 'associations',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Club',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)),
|
|
('name', models.CharField(unique=True, max_length=200, verbose_name='nom')),
|
|
('description', models.TextField(verbose_name='description', blank=True)),
|
|
('price', models.DecimalField(verbose_name='cotisation (€)', decimal_places=2, default=0, blank=True, max_digits=5)),
|
|
('cotisation_frequency', models.CharField(choices=[('ANN', 'Annuel'), ('SEM', 'Semestriel'), ('COU', 'Au cours')], max_length=3, verbose_name='fréquence de la cotisation', default='ANN', blank=True)),
|
|
('association', models.ForeignKey(on_delete=models.deletion.PROTECT, related_name='clubs', to='gestion.Association', verbose_name='association')),
|
|
],
|
|
options={
|
|
'verbose_name': 'club',
|
|
'verbose_name_plural': 'clubs',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ClubUser',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)),
|
|
('is_respo', models.BooleanField(verbose_name='est responsable du club')),
|
|
('has_paid', models.BooleanField(verbose_name='a payé sa cotisation')),
|
|
('club', models.ForeignKey(
|
|
to='gestion.Club',
|
|
on_delete=models.CASCADE)),
|
|
('user', models.ForeignKey(
|
|
on_delete=models.CASCADE,
|
|
to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': 'inscription au club',
|
|
'verbose_name_plural': 'inscriptions aux clubs',
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='club',
|
|
name='members',
|
|
field=models.ManyToManyField(
|
|
to=settings.AUTH_USER_MODEL,
|
|
related_name='in_clubs',
|
|
through='gestion.ClubUser',
|
|
blank=True,
|
|
verbose_name='membres du club'
|
|
),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Event',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=200, verbose_name='titre')),
|
|
('start_date', models.DateTimeField(blank=True, null=True, verbose_name="début de l'événement")),
|
|
('end_date', models.DateTimeField(blank=True, null=True, verbose_name="fin de l'événement")),
|
|
('description', models.TextField(blank=True, verbose_name='description')),
|
|
('image', models.ImageField(blank=True, null=True, upload_to='public/imgs/events/', verbose_name='image')),
|
|
('registration_open', models.NullBooleanField(default=True, help_text="Indéfini signifie « l'inscription n'est pas requise\xa0»", verbose_name='les inscriptions sont ouvertes')),
|
|
('old', models.BooleanField(default=False, verbose_name='archiver (événement fini)')),
|
|
('associations', models.ManyToManyField(related_name='events', to='gestion.Association', verbose_name='associations')),
|
|
],
|
|
options={
|
|
'verbose_name': 'événement',
|
|
'verbose_name_plural': 'événements',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EventCommentField',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=200, verbose_name='nom du champ')),
|
|
('fieldtype', models.CharField(choices=[('text', 'Texte long'), ('char', 'Texte court')], default='text', max_length=10, verbose_name='type de champ')),
|
|
('default', models.TextField(blank=True, verbose_name='valeur par défaut')),
|
|
('ordering', models.IntegerField(default=False, help_text='plus petit en premier, ordre alphabétique sur le nom si ambiguïté', verbose_name='ordre des champs')),
|
|
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='commentfields', to='gestion.Event', verbose_name='événement')),
|
|
],
|
|
options={
|
|
'verbose_name': 'champ',
|
|
'verbose_name_plural': 'champs',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EventCommentValue',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('content', models.TextField(blank=True, verbose_name='contenu')),
|
|
('commentfield', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='values', to='gestion.EventCommentField')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='EventOption',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=200, verbose_name='option')),
|
|
('multi_choices', models.BooleanField(default=False, verbose_name='choix multiples')),
|
|
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='options', to='gestion.Event', verbose_name='événement')),
|
|
],
|
|
options={
|
|
'verbose_name': 'option des événements',
|
|
'verbose_name_plural': 'options des événements',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EventOptionChoice',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('value', models.CharField(max_length=200, verbose_name='Valeur')),
|
|
('event_option', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='choices', to='gestion.EventOption', verbose_name='événement')),
|
|
],
|
|
options={
|
|
'verbose_name': 'choix',
|
|
'verbose_name_plural': 'choix',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EventRegistration',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('paid', models.BooleanField(default=False, verbose_name='a payé')),
|
|
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gestion.Event', verbose_name='événement')),
|
|
('filledcomments', models.ManyToManyField(through='gestion.EventCommentValue', to='gestion.EventCommentField', verbose_name='commentaires')),
|
|
('options', models.ManyToManyField(to='gestion.EventOptionChoice', verbose_name='choix')),
|
|
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='utilisateur')),
|
|
],
|
|
options={
|
|
'verbose_name': 'inscription',
|
|
'verbose_name_plural': 'inscriptions',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Location',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=200, verbose_name='nom du lieu')),
|
|
],
|
|
options={
|
|
'verbose_name': 'lieu',
|
|
'verbose_name_plural': 'lieux',
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='eventcommentvalue',
|
|
name='registration',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='gestion.EventRegistration'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='event',
|
|
name='location',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Location', verbose_name='lieux', blank=True, null=True),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='eventregistration',
|
|
unique_together=set([('user', 'event')]),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='eventcommentvalue',
|
|
unique_together=set([('commentfield', 'registration')]),
|
|
),
|
|
]
|