2020-12-30 00:31:58 +01:00
# Generated by Django 3.1.2 on 2020-12-29 23:21
2020-10-11 22:16:00 +02:00
import autoslug . fields
2020-12-24 14:19:35 +01:00
from django . conf import settings
2020-10-11 22:16:00 +02:00
from django . db import migrations , models
import django . db . models . deletion
2020-12-30 00:31:58 +01:00
import website . validators
2020-10-11 22:16:00 +02:00
class Migration ( migrations . Migration ) :
initial = True
dependencies = [
2020-12-24 14:19:35 +01:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2020-10-11 22:16:00 +02:00
]
operations = [
migrations . CreateModel (
name = ' Category ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-12-30 00:31:58 +01:00
( ' name ' , models . CharField ( max_length = 256 , unique = True , verbose_name = ' nom ' ) ) ,
2020-11-22 19:01:21 +01:00
( ' slug ' , autoslug . fields . AutoSlugField ( editable = False , populate_from = ' name ' , unique = True ) ) ,
2020-10-11 22:16:00 +02:00
] ,
options = {
' verbose_name ' : ' catégorie ' ,
2020-12-24 14:19:35 +01:00
' ordering ' : [ ' name ' ] ,
2020-10-11 22:16:00 +02:00
} ,
) ,
migrations . CreateModel (
name = ' Game ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-12-30 00:31:58 +01:00
( ' title ' , models . CharField ( max_length = 256 , unique = True , verbose_name = ' titre du jeu ' ) ) ,
2020-10-11 22:16:00 +02:00
( ' slug ' , autoslug . fields . AutoSlugField ( editable = False , populate_from = ' title ' , unique = True ) ) ,
2020-12-24 14:19:35 +01:00
( ' nb_player_min ' , models . PositiveSmallIntegerField ( verbose_name = ' nombre de joueur·se·s minimum ' ) ) ,
( ' nb_player_max ' , models . PositiveSmallIntegerField ( verbose_name = ' nombre de joueur·se·s maximum ' ) ) ,
( ' player_range ' , models . CharField ( blank = True , help_text = ' Affichage personnalisé pour le nombre de joueur·se·s ' , max_length = 256 , verbose_name = ' nombre de joueur·se·s ' ) ) ,
( ' duration ' , models . CharField ( blank = True , max_length = 256 , verbose_name = ' durée de partie ' ) ) ,
2020-10-11 22:16:00 +02:00
( ' game_designer ' , models . CharField ( blank = True , max_length = 256 , verbose_name = ' game designer ' ) ) ,
2020-12-24 14:19:35 +01:00
( ' illustrator ' , models . CharField ( blank = True , max_length = 256 , verbose_name = ' illustrateur·trice ' ) ) ,
( ' editor ' , models . CharField ( blank = True , max_length = 256 , verbose_name = ' éditeur ' ) ) ,
2020-10-11 22:16:00 +02:00
( ' description ' , models . TextField ( blank = True , verbose_name = ' description ' ) ) ,
2020-12-30 00:31:58 +01:00
( ' image ' , models . ImageField ( blank = True , help_text = " L ' image doit peser 512 Kio au maximum " , upload_to = ' game_img/ ' , validators = [ website . validators . MaxFileSizeValidator ( 512 ) ] , verbose_name = ' image ' ) ) ,
2020-12-24 14:19:35 +01:00
( ' missing_elements ' , models . TextField ( blank = True , verbose_name = ' pièces manquantes ' ) ) ,
2020-10-11 22:16:00 +02:00
( ' category ' , models . ForeignKey ( on_delete = django . db . models . deletion . RESTRICT , to = ' inventory.category ' , verbose_name = ' catégorie ' ) ) ,
] ,
options = {
' verbose_name ' : ' jeu ' ,
' verbose_name_plural ' : ' jeux ' ,
2020-12-24 14:19:35 +01:00
' ordering ' : [ ' title ' ] ,
} ,
) ,
migrations . CreateModel (
name = ' Tag ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-12-30 00:31:58 +01:00
( ' name ' , models . CharField ( max_length = 256 , unique = True , verbose_name = ' nom ' ) ) ,
2020-12-24 14:19:35 +01:00
( ' slug ' , autoslug . fields . AutoSlugField ( editable = False , populate_from = ' name ' , unique = True ) ) ,
] ,
options = {
' ordering ' : [ ' name ' ] ,
} ,
) ,
migrations . CreateModel (
name = ' GameComment ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' text ' , models . TextField ( verbose_name = ' texte ' ) ) ,
( ' created_on ' , models . DateTimeField ( auto_now_add = True , verbose_name = ' date de publication ' ) ) ,
( ' modified_on ' , models . DateTimeField ( auto_now = True , verbose_name = ' date de modification ' ) ) ,
( ' author ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , to = settings . AUTH_USER_MODEL , verbose_name = ' auteur·ice ' ) ) ,
2020-12-27 18:01:37 +01:00
( ' commented_object ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' comments ' , to = ' inventory.game ' , verbose_name = ' jeu ' ) ) ,
2020-12-24 14:19:35 +01:00
] ,
options = {
' verbose_name ' : ' commentaire sur un jeu ' ,
' verbose_name_plural ' : ' commentaires sur des jeux ' ,
' ordering ' : [ ' created_on ' ] ,
2020-10-11 22:16:00 +02:00
} ,
) ,
2020-12-24 14:19:35 +01:00
migrations . AddField (
model_name = ' game ' ,
name = ' tags ' ,
field = models . ManyToManyField ( blank = True , to = ' inventory.Tag ' , verbose_name = ' tags ' ) ,
) ,
2020-10-11 22:16:00 +02:00
]