2020-09-28 20:30:41 +02:00
# Generated by Django 3.1.1 on 2020-09-17 18:05
2020-09-27 20:33:56 +02:00
from django . conf import settings
import django . core . validators
from django . db import migrations , models
import django . db . models . deletion
import easy_thumbnails . fields
2020-09-28 20:30:41 +02:00
import lostplaces . models
2020-09-27 20:33:56 +02:00
import taggit . managers
class Migration ( migrations . Migration ) :
initial = True
dependencies = [
2020-09-28 20:05:30 +02:00
( ' taggit ' , ' 0003_taggeditem_add_unique_index ' ) ,
2020-09-28 20:30:41 +02:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2020-09-27 20:33:56 +02:00
]
operations = [
migrations . CreateModel (
2020-09-28 20:30:41 +02:00
name = ' Explorer ' ,
2020-09-27 20:33:56 +02:00
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-09-28 20:30:41 +02:00
( ' user ' , models . OneToOneField ( on_delete = django . db . models . deletion . CASCADE , related_name = ' explorer ' , to = settings . AUTH_USER_MODEL ) ) ,
2020-09-27 20:33:56 +02:00
] ,
) ,
migrations . CreateModel (
2020-09-28 20:30:41 +02:00
name = ' ExternalLink ' ,
2020-09-27 20:33:56 +02:00
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-09-28 20:30:41 +02:00
( ' url ' , models . URLField ( ) ) ,
( ' label ' , models . CharField ( max_length = 100 ) ) ,
( ' submitted_when ' , models . DateTimeField ( auto_now_add = True , null = True ) ) ,
( ' submitted_by ' , models . ForeignKey ( blank = True , null = True , on_delete = django . db . models . deletion . SET_NULL , related_name = ' external_links ' , to = ' lostplaces.explorer ' ) ) ,
2020-09-27 20:33:56 +02:00
] ,
) ,
migrations . CreateModel (
name = ' Place ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' name ' , models . CharField ( max_length = 50 ) ) ,
( ' latitude ' , models . FloatField ( validators = [ django . core . validators . MinValueValidator ( - 90 ) , django . core . validators . MaxValueValidator ( 90 ) ] ) ) ,
( ' longitude ' , models . FloatField ( validators = [ django . core . validators . MinValueValidator ( - 180 ) , django . core . validators . MaxValueValidator ( 180 ) ] ) ) ,
( ' submitted_when ' , models . DateTimeField ( auto_now_add = True , null = True ) ) ,
( ' location ' , models . CharField ( max_length = 50 ) ) ,
( ' description ' , models . TextField ( ) ) ,
2020-09-28 20:30:41 +02:00
( ' submitted_by ' , models . ForeignKey ( blank = True , null = True , on_delete = django . db . models . deletion . SET_NULL , related_name = ' place ' , to = ' lostplaces.explorer ' ) ) ,
2020-09-27 20:33:56 +02:00
( ' tags ' , taggit . managers . TaggableManager ( blank = True , help_text = ' A comma-separated list of tags. ' , through = ' taggit.TaggedItem ' , to = ' taggit.Tag ' , verbose_name = ' Tags ' ) ) ,
] ,
options = {
' abstract ' : False ,
} ,
) ,
migrations . CreateModel (
name = ' Voucher ' ,
fields = [
2020-09-28 20:30:41 +02:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2020-09-27 20:33:56 +02:00
( ' code ' , models . CharField ( max_length = 30 , unique = True ) ) ,
2020-09-28 20:30:41 +02:00
( ' created_when ' , models . DateTimeField ( auto_now_add = True ) ) ,
( ' expires_when ' , models . DateTimeField ( ) ) ,
2020-09-27 20:33:56 +02:00
] ,
) ,
migrations . CreateModel (
name = ' PlaceImage ' ,
fields = [
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' submitted_when ' , models . DateTimeField ( auto_now_add = True , null = True ) ) ,
( ' description ' , models . TextField ( blank = True ) ) ,
2020-09-28 20:30:41 +02:00
( ' filename ' , easy_thumbnails . fields . ThumbnailerImageField ( upload_to = lostplaces . models . generate_image_upload_path ) ) ,
2020-09-27 20:33:56 +02:00
( ' place ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' placeimages ' , to = ' lostplaces.place ' ) ) ,
2020-09-28 20:30:41 +02:00
( ' submitted_by ' , models . ForeignKey ( blank = True , null = True , on_delete = django . db . models . deletion . SET_NULL , related_name = ' placeimage ' , to = ' lostplaces.explorer ' ) ) ,
2020-09-27 20:33:56 +02:00
] ,
options = {
' abstract ' : False ,
} ,
) ,
migrations . CreateModel (
name = ' PhotoAlbum ' ,
fields = [
2020-09-28 20:30:41 +02:00
( ' externallink_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' lostplaces.externallink ' ) ) ,
( ' place ' , models . ForeignKey ( null = True , on_delete = django . db . models . deletion . CASCADE , related_name = ' photo_albums ' , to = ' lostplaces.place ' ) ) ,
2020-09-27 20:33:56 +02:00
] ,
2020-09-28 20:30:41 +02:00
bases = ( ' lostplaces.externallink ' , ) ,
2020-09-27 20:33:56 +02:00
) ,
]