2016-01-29 14:20:00 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django . db import migrations , models
from django . conf import settings
2016-03-29 10:45:10 +00:00
import django . core . validators
2016-01-29 14:20:00 +00:00
class Migration ( migrations . Migration ) :
dependencies = [
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2016-03-29 10:45:10 +00:00
( ' core ' , ' 0001_initial ' ) ,
2016-01-29 14:20:00 +00:00
]
operations = [
migrations . CreateModel (
name = ' Club ' ,
fields = [
2016-03-29 10:45:10 +00:00
( ' id ' , models . AutoField ( primary_key = True , serialize = False , verbose_name = ' ID ' , auto_created = True ) ) ,
2016-01-29 14:20:00 +00:00
( ' name ' , models . CharField ( max_length = 30 , verbose_name = ' name ' ) ) ,
2016-03-29 10:45:10 +00:00
( ' 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. ' ) ] ) ) ,
2016-01-29 14:20:00 +00:00
( ' address ' , models . CharField ( max_length = 254 , verbose_name = ' address ' ) ) ,
2016-03-29 10:45:10 +00:00
( ' edit_groups ' , models . ManyToManyField ( to = ' core.Group ' , blank = True , related_name = ' editable_club ' ) ) ,
( ' owner_group ' , models . ForeignKey ( default = 1 , related_name = ' owned_club ' , to = ' core.Group ' ) ) ,
( ' parent ' , models . ForeignKey ( blank = True , related_name = ' children ' , to = ' club.Club ' , null = True ) ) ,
( ' view_groups ' , models . ManyToManyField ( to = ' core.Group ' , blank = True , related_name = ' viewable_club ' ) ) ,
2016-01-29 14:20:00 +00:00
] ,
) ,
migrations . CreateModel (
name = ' Membership ' ,
fields = [
2016-03-29 10:45:10 +00:00
( ' id ' , models . AutoField ( primary_key = True , serialize = False , verbose_name = ' ID ' , auto_created = True ) ) ,
2016-01-29 14:20:00 +00:00
( ' start_date ' , models . DateField ( auto_now = True , verbose_name = ' start date ' ) ) ,
2016-03-29 10:45:10 +00:00
( ' end_date ' , models . DateField ( blank = True , null = True , verbose_name = ' end date ' ) ) ,
( ' 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 ' ) ) ,
( ' club ' , models . ForeignKey ( to = ' club.Club ' , related_name = ' members ' ) ) ,
( ' user ' , models . ForeignKey ( to = settings . AUTH_USER_MODEL , related_name = ' membership ' ) ) ,
2016-01-29 14:20:00 +00:00
] ,
) ,
]