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-05-30 10:23:59 +00:00
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
2016-01-29 14:20:00 +00:00
( ' name ' , models . CharField ( max_length = 30 , verbose_name = ' name ' ) ) ,
2016-05-30 10:23:59 +00:00
( ' 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. ' } ) ) ,
2016-01-29 14:20:00 +00:00
( ' address ' , models . CharField ( max_length = 254 , verbose_name = ' address ' ) ) ,
2016-05-30 10:23:59 +00:00
( ' edit_groups ' , models . ManyToManyField ( related_name = ' editable_club ' , to = ' core.Group ' , blank = True ) ) ,
( ' owner_group ' , models . ForeignKey ( to = ' core.Group ' , related_name = ' owned_club ' , default = 1 ) ) ,
( ' parent ' , models . ForeignKey ( to = ' club.Club ' , related_name = ' children ' , null = True , blank = True ) ) ,
( ' view_groups ' , models . ManyToManyField ( related_name = ' viewable_club ' , to = ' core.Group ' , blank = True ) ) ,
2016-01-29 14:20:00 +00:00
] ,
) ,
migrations . CreateModel (
name = ' Membership ' ,
fields = [
2016-05-30 10:23:59 +00:00
( ' id ' , models . AutoField ( verbose_name = ' ID ' , primary_key = True , serialize = False , auto_created = True ) ) ,
2016-01-29 14:20:00 +00:00
( ' start_date ' , models . DateField ( auto_now = True , verbose_name = ' start date ' ) ) ,
2016-05-30 10:23:59 +00:00
( ' end_date ' , models . DateField ( blank = True , verbose_name = ' end date ' , null = True ) ) ,
2016-03-29 10:45:10 +00:00
( ' 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 ) ) ,
2016-05-30 10:23:59 +00:00
( ' description ' , models . CharField ( blank = True , max_length = 30 , verbose_name = ' description ' ) ) ,
2016-03-29 10:45:10 +00:00
( ' 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
] ,
) ,
]