2021-10-26 09:37:32 +00:00
# Generated by Django 2.2.17 on 2021-10-23 18:12
from django . conf import settings
import django . core . validators
from django . db import migrations , models
import django . db . models . deletion
import media . fields
import media . validators
class Migration ( migrations . Migration ) :
dependencies = [
( ' contenttypes ' , ' 0002_remove_content_type_name ' ) ,
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
( ' media ' , ' 0042_auto_20211023_1929 ' ) ,
]
operations = [
migrations . CreateModel (
name = ' Borrowable ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2021-11-02 11:32:31 +00:00
( ' isbn ' , media . fields . ISBNField ( blank = True , help_text = ' You may be able to scan it from a bar code. ' , max_length = 28 , null = True , unique = True , validators = [ media . validators . isbn_validator ] , verbose_name = ' ISBN ' ) ) ,
2021-10-26 09:37:32 +00:00
( ' title ' , models . CharField ( max_length = 255 , verbose_name = ' title ' ) ) ,
( ' present ' , models . BooleanField ( default = False , help_text = ' Tell that the medium is present in the Mediatek. ' , verbose_name = ' present ' ) ) ,
( ' polymorphic_ctype ' , models . ForeignKey ( editable = False , null = True , on_delete = django . db . models . deletion . CASCADE , related_name = ' polymorphic_media.borrowable_set+ ' , to = ' contenttypes.ContentType ' ) ) ,
] ,
options = {
' verbose_name ' : ' borrowable ' ,
' verbose_name_plural ' : ' borrowables ' ,
} ,
) ,
migrations . AlterModelOptions (
name = ' oldgame ' ,
options = { ' ordering ' : [ ' title ' ] , ' verbose_name ' : ' game ' , ' verbose_name_plural ' : ' games ' } ,
) ,
migrations . AlterField (
model_name = ' emprunt ' ,
name = ' media ' ,
field = models . ForeignKey ( on_delete = django . db . models . deletion . PROTECT , to = ' media.Borrowable ' ) ,
) ,
migrations . CreateModel (
name = ' Medium ' ,
fields = [
( ' borrowable_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Borrowable ' ) ) ,
( ' external_url ' , models . URLField ( blank = True , verbose_name = ' external URL ' ) ) ,
( ' side_identifier ' , models . CharField ( max_length = 255 , verbose_name = ' side identifier ' ) ) ,
( ' authors ' , models . ManyToManyField ( to = ' media.Author ' , verbose_name = ' authors ' ) ) ,
] ,
options = {
' verbose_name ' : ' medium ' ,
' verbose_name_plural ' : ' media ' ,
} ,
bases = ( ' media.borrowable ' , ) ,
) ,
migrations . CreateModel (
name = ' Review ' ,
fields = [
( ' borrowable_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Borrowable ' ) ) ,
( ' number ' , models . PositiveIntegerField ( verbose_name = ' number ' ) ) ,
( ' year ' , models . PositiveIntegerField ( blank = True , default = None , null = True , verbose_name = ' year ' ) ) ,
( ' month ' , models . PositiveIntegerField ( blank = True , default = None , null = True , verbose_name = ' month ' ) ) ,
( ' day ' , models . PositiveIntegerField ( blank = True , default = None , null = True , verbose_name = ' day ' ) ) ,
( ' double ' , models . BooleanField ( default = False , verbose_name = ' double ' ) ) ,
] ,
options = {
' verbose_name ' : ' review ' ,
' verbose_name_plural ' : ' reviews ' ,
' ordering ' : [ ' title ' , ' number ' ] ,
} ,
bases = ( ' media.borrowable ' , ) ,
) ,
migrations . CreateModel (
name = ' Book ' ,
fields = [
( ' medium_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Medium ' ) ) ,
( ' subtitle ' , models . CharField ( blank = True , max_length = 255 , verbose_name = ' subtitle ' ) ) ,
( ' number_of_pages ' , models . PositiveIntegerField ( blank = True , null = True , verbose_name = ' number of pages ' ) ) ,
( ' publish_date ' , models . DateField ( blank = True , null = True , verbose_name = ' publish date ' ) ) ,
] ,
options = {
' verbose_name ' : ' book ' ,
' verbose_name_plural ' : ' books ' ,
} ,
bases = ( ' media.medium ' , ) ,
) ,
migrations . CreateModel (
name = ' CD ' ,
fields = [
( ' medium_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Medium ' ) ) ,
] ,
options = {
' verbose_name ' : ' CD ' ,
' verbose_name_plural ' : ' CDs ' ,
' ordering ' : [ ' title ' ] ,
} ,
bases = ( ' media.medium ' , ) ,
) ,
migrations . CreateModel (
name = ' Vinyl ' ,
fields = [
( ' medium_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Medium ' ) ) ,
( ' rpm ' , models . PositiveIntegerField ( choices = [ ( 33 , ' 33 RPM ' ) , ( 45 , ' 45 RPM ' ) ] , verbose_name = ' rounds per minute ' ) ) ,
] ,
options = {
' verbose_name ' : ' vinyl ' ,
' verbose_name_plural ' : ' vinyls ' ,
' ordering ' : [ ' title ' ] ,
} ,
bases = ( ' media.medium ' , ) ,
) ,
migrations . CreateModel (
name = ' Game ' ,
fields = [
( ' borrowable_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Borrowable ' ) ) ,
( ' duration ' , models . CharField ( choices = [ ( ' -1h ' , ' -1h ' ) , ( ' 1-2h ' , ' 1-2h ' ) , ( ' 2-3h ' , ' 2-3h ' ) , ( ' 3-4h ' , ' 3-4h ' ) , ( ' 4h+ ' , ' 4h+ ' ) ] , max_length = 255 , verbose_name = ' duration ' ) ) ,
( ' players_min ' , models . IntegerField ( validators = [ django . core . validators . MinValueValidator ( 1 ) ] , verbose_name = ' minimum number of players ' ) ) ,
( ' players_max ' , models . IntegerField ( validators = [ django . core . validators . MinValueValidator ( 1 ) ] , verbose_name = ' maximum number of players ' ) ) ,
( ' comment ' , models . CharField ( blank = True , max_length = 255 , verbose_name = ' comment ' ) ) ,
( ' owner ' , models . ForeignKey ( on_delete = django . db . models . deletion . PROTECT , to = settings . AUTH_USER_MODEL , verbose_name = ' owner ' ) ) ,
] ,
options = {
' verbose_name ' : ' game ' ,
' verbose_name_plural ' : ' games ' ,
' ordering ' : [ ' title ' ] ,
} ,
bases = ( ' media.borrowable ' , ) ,
) ,
migrations . CreateModel (
name = ' Comic ' ,
fields = [
( ' book_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Book ' ) ) ,
] ,
options = {
' verbose_name ' : ' comic ' ,
' verbose_name_plural ' : ' comics ' ,
' ordering ' : [ ' title ' , ' subtitle ' ] ,
} ,
bases = ( ' media.book ' , ) ,
) ,
migrations . CreateModel (
name = ' Manga ' ,
fields = [
( ' book_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Book ' ) ) ,
] ,
options = {
' verbose_name ' : ' manga ' ,
' verbose_name_plural ' : ' mangas ' ,
' ordering ' : [ ' title ' , ' subtitle ' ] ,
} ,
bases = ( ' media.book ' , ) ,
) ,
migrations . CreateModel (
name = ' Novel ' ,
fields = [
( ' book_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' media.Book ' ) ) ,
] ,
options = {
' verbose_name ' : ' novel ' ,
' verbose_name_plural ' : ' novels ' ,
' ordering ' : [ ' title ' , ' subtitle ' ] ,
} ,
bases = ( ' media.book ' , ) ,
) ,
]