Beispiel #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('book_count', models.PositiveIntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, unique=True)),
                ('page_count', models.PositiveIntegerField()),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('author', models.ManyToManyField(default=book.models.default_author, related_name='books', to='book.Author')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=255, unique=True, verbose_name='カテゴリ名')),
                ('book_count', models.PositiveIntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(db_index=True, max_length=255, unique=True)),
                ('book_count', models.PositiveIntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='category',
            field=models.ForeignKey(default=book.models.default_category, on_delete=django.db.models.deletion.PROTECT, related_name='books', to='book.Category'),
        ),
        migrations.AddField(
            model_name='book',
            name='tag',
            field=models.ManyToManyField(default=book.models.default_tag, related_name='books', to='book.Tag'),
        ),
    ]
Beispiel #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('pyuser', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('douban_id',
                 models.IntegerField(default=1,
                                     unique=True,
                                     verbose_name='book id in douban')),
                ('status',
                 models.IntegerField(choices=[
                     (0, 'book in the market'),
                     (1, 'someone wish this book, but not bought now'),
                     (2, 'book in the py library'),
                     (3, 'book bas been borrowed by someone')
                 ],
                                     default=0)),
                ('owner',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=models.SET(
                                       book.models.get_sentinel_user),
                                   related_name='PyBook',
                                   to='pyuser.PyUser')),
                ('wishers',
                 models.ManyToManyField(blank=True,
                                        related_name='bookWishers',
                                        to='pyuser.PyUser')),
            ],
            options={
                'ordering': ('created', ),
            },
        ),
    ]
Beispiel #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('fullname',
                 models.CharField(max_length=200,
                                  unique=True,
                                  validators=[book.models.validate_not_empty
                                              ])),
                ('born_date', models.DateTimeField(blank=True, null=True)),
                ('rip_date', models.DateTimeField(blank=True, null=True)),
                ('secret', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=120,
                                  unique=True,
                                  validators=[book.models.validate_not_empty
                                              ])),
                ('description', models.TextField()),
                ('secret', models.CharField(blank=True, max_length=50)),
                ('authors',
                 models.ManyToManyField(related_name='author_books',
                                        to='book.Author')),
            ],
        ),
    ]
Beispiel #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(blank=True, max_length=30)),
                ('age', models.PositiveIntegerField(blank=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('birth_date', models.DateTimeField()),
                ('image', models.ImageField(blank=True, upload_to='')),
                ('is_staff', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', book.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, unique=True)),
                ('bio', models.TextField(blank=True)),
                ('date_of_birth', models.DateField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=256, unique=True)),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='author',
            name='books',
            field=models.ManyToManyField(related_name='authors', to='book.Book'),
        ),
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
        ('store', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=300, null=True)),
                ('price', models.FloatField(null=True)),
                ('code', models.IntegerField(null=True, unique=True)),
                ('image',
                 models.ImageField(null=True,
                                   upload_to=book.models.rename_image)),
                ('description', models.TextField(max_length=400, null=True)),
                ('slug_book', models.SlugField(blank=True, null=True)),
                ('category',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='store.category')),
                ('subcategory',
                 smart_selects.db_fields.ChainedForeignKey(
                     blank=True,
                     chained_field='category',
                     chained_model_field='category',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='store.subcategory')),
            ],
        ),
        migrations.CreateModel(
            name='DiscountForBook',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('discountrate', models.FloatField(blank=True, null=True)),
                ('discountforbook',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='book.book')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('totalprice', models.FloatField(blank=True, null=True)),
                ('discount', models.FloatField(blank=True, null=True)),
                ('books', models.ManyToManyField(blank=True, to='book.Book')),
                ('discountbookfororder',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='book.discountforbook')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='user.myuser')),
            ],
        ),
    ]
Beispiel #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('age', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('isbn', models.CharField(max_length=140, unique=True)),
                ('pub_date', models.DateField()),
                ('no_of_actual_copy', models.IntegerField()),
                ('no_of_copy_left', models.IntegerField()),
                ('image',
                 models.ImageField(upload_to=book.models.upload_image_path)),
                ('authors', models.ManyToManyField(to='book.Author')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Publisher',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rating', models.IntegerField()),
                ('review', models.TextField(blank=True)),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='category',
            field=models.ManyToManyField(related_name='books',
                                         to='book.Category'),
        ),
        migrations.AddField(
            model_name='book',
            name='publisher',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='book.Publisher'),
        ),
    ]
Beispiel #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="SearchFdsnStationModel",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("network_code", models.CharField(blank=True, max_length=256)),
                ("station_code", models.CharField(blank=True, max_length=256)),
                ("site_name", models.CharField(blank=True, max_length=256)),
                (
                    "network_class",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("permanent", "Permanent"),
                            ("temporary", "Temporary"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "network_access",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("unrestricted", "Unrestricted"),
                            ("restricted", "Restricted"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "station_status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("open", "Open"),
                            ("closed", "Closed"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "station_access",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("unrestricted", "Unrestricted"),
                            ("restricted", "Restricted"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "sensor_unit",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("m", "M"),
                            ("ms", "M/S"),
                            ("mss", "M/S^2"),
                            ("pa", "PA"),
                            ("c", "C"),
                            ("deg", "DEG"),
                            ("undefined", "Undefined"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "sensor_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("all", "All"),
                            ("vbb", "VBB"),
                            ("bb", "BB"),
                            ("sp", "SP"),
                            ("sm", "SM"),
                            ("obs", "OBS"),
                            ("undefined", "Undefined"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "latitude_min",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                (
                    "latitude_max",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                (
                    "longitude_min",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                (
                    "longitude_max",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                ("start_year_from", models.IntegerField(blank=True)),
                ("start_year_to", models.IntegerField(blank=True)),
                ("end_year_from", models.IntegerField(blank=True)),
                ("end_year_to", models.IntegerField(blank=True)),
                (
                    "geological_unit",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("alluvial_deposits", "Alluvial deposits"),
                            ("ancient_alluvialterraces", "Ancient alluvial terraces"),
                            ("argillite", "Argillite"),
                            ("breccias", "Breccias"),
                            ("clay", "Clay"),
                            ("conglomerate", "Conglomerate"),
                            ("debris", "Debris"),
                            ("diabase", "Diabase"),
                            ("dolomite", "Dolomite"),
                            ("fillade", "Fillade"),
                            ("fluvial_deposits", "Fluvial deposits"),
                            ("gneiss", "Gneiss"),
                            ("granite", "Granite"),
                            ("jasper", "Jasper"),
                            ("lacustrine_deposits", "Lacustrine deposits"),
                            ("limestone", "Limestone"),
                            ("marls", "Marls"),
                            ("metamorphic_rock", "Metamorphic rock"),
                            ("micaschist", "Micaschist"),
                            ("morainic_deposits", "Morainic deposits"),
                            ("ophiolite", "Ophiolite"),
                            ("rhyolitic_ignimbrite", "Rhyolitic ignimbrite"),
                            ("sand_deposits", "Sand deposits"),
                            ("sandstone", "Sandstone"),
                            ("schist", "Schist"),
                            ("torbidite", "Torbidite"),
                            ("volcanic_deposits", "Volcanic deposits"),
                            ("volcanic_rocks", "Volcanic rocks"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "morphology_class",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("t1", "T1"),
                            ("t2", "T2"),
                            ("t3", "T3"),
                            ("t4", "T4"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "ground_type_ec8",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("a", "A"),
                            ("b", "B"),
                            ("c", "C"),
                            ("d", "D"),
                            ("e", "E"),
                            ("s1", "S1"),
                            ("s2", "S2"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                ("basin_flag", models.BooleanField(default=False)),
                (
                    "vs30_from",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=12),
                ),
                (
                    "vs30_to",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=12),
                ),
                (
                    "f0_from",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=12),
                ),
                (
                    "f0_to",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=12),
                ),
            ],
            options={"managed": False,},
        ),
        migrations.CreateModel(
            name="ExtEntityBase",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "ext_network_code",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                (
                    "ext_network_start_year",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                (
                    "ext_station_code",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                (
                    "ext_station_start_year",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                ("entity_removed", models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name="FdsnNetwork",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("code", models.CharField(max_length=256)),
                (
                    "description",
                    models.CharField(blank=True, default="", max_length=256),
                ),
                (
                    "start_date",
                    models.DateTimeField(blank=True, default="", max_length=256),
                ),
                (
                    "restricted_status",
                    models.CharField(blank=True, default="", max_length=256),
                ),
            ],
            options={"ordering": ["code"],},
        ),
        migrations.CreateModel(
            name="FdsnNode",
            fields=[
                (
                    "code",
                    models.CharField(
                        max_length=256, primary_key=True, serialize=False, unique=True
                    ),
                ),
                (
                    "description",
                    models.CharField(blank=True, default="", max_length=256),
                ),
                (
                    "url_dataselect",
                    models.CharField(blank=True, default="", max_length=1024),
                ),
                (
                    "url_station",
                    models.CharField(blank=True, default="", max_length=1024),
                ),
                (
                    "url_routing",
                    models.CharField(blank=True, default="", max_length=1024),
                ),
                (
                    "url_wfcatalog",
                    models.CharField(blank=True, default="", max_length=1024),
                ),
            ],
        ),
        migrations.CreateModel(
            name="FdsnStation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("code", models.CharField(max_length=256)),
                ("site_name", models.CharField(blank=True, max_length=256)),
                (
                    "latitude",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                (
                    "longitude",
                    models.DecimalField(blank=True, decimal_places=6, max_digits=9),
                ),
                (
                    "elevation",
                    models.DecimalField(blank=True, decimal_places=2, max_digits=6),
                ),
                ("restricted_status", models.CharField(blank=True, max_length=256)),
                ("start_date", models.DateTimeField(blank=True, max_length=256)),
                (
                    "end_date",
                    models.DateTimeField(blank=True, max_length=256, null=True),
                ),
                (
                    "creation_date",
                    models.DateTimeField(blank=True, max_length=256, null=True),
                ),
                (
                    "fdsn_network",
                    models.ForeignKey(
                        default=None,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="fdsn_stations",
                        to="book.FdsnNetwork",
                    ),
                ),
            ],
            options={
                "ordering": [
                    "fdsn_network__fdsn_node__code",
                    "fdsn_network__code",
                    "code",
                ],
            },
        ),
        migrations.CreateModel(
            name="Link",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("url", models.CharField(blank=True, max_length=1024, null=True)),
                ("category", models.CharField(blank=True, max_length=1024, null=True)),
                (
                    "description",
                    models.CharField(blank=True, max_length=1024, null=True),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("about", models.CharField(blank=True, max_length=1024)),
                ("location", models.CharField(blank=True, max_length=1024)),
                ("agency", models.CharField(blank=True, max_length=1024)),
                ("department", models.CharField(blank=True, max_length=1024)),
                ("telephone", models.CharField(blank=True, max_length=1024)),
                ("skype", models.CharField(blank=True, max_length=1024)),
                (
                    "fdsn_networks",
                    models.ManyToManyField(
                        blank=True, related_name="editors", to="book.FdsnNetwork"
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="profile",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ExtAccessData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                ("updated_at", models.DateTimeField(null=True)),
                (
                    "description",
                    models.CharField(blank=True, default="Change", max_length=256),
                ),
            ],
            options={"ordering": ["-updated_at"],},
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtBasicData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                ("start", models.DateField(blank=True, null=True)),
                ("end", models.DateField(blank=True, null=True)),
                (
                    "imported_from_fdsn",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                (
                    "last_synced",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtBoreholeData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                ("depth", models.IntegerField(default=0)),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtBoreholeLayerData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                (
                    "description",
                    models.CharField(blank=True, default="", max_length=256),
                ),
                ("depth_top", models.IntegerField(default=0)),
                ("depth_bottom", models.IntegerField(default=0)),
                (
                    "borehole_data",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="borehole_layers",
                        to="book.ExtBoreholeData",
                    ),
                ),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtHousingData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                (
                    "housing_class",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("borehole", "Borehole"),
                            ("bridge", "Bridge"),
                            ("building", "Building"),
                            ("cave", "Cave"),
                            ("dam", "Dam"),
                            ("free_field", "Free field"),
                            ("other_structure", "Other structure"),
                            ("tunnel", "Tunnel"),
                            ("underground_shelter", "Underground shelter"),
                            ("urban_free_field", "Urban free field"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                ("in_building", models.BooleanField(default=True)),
                ("numer_of_storeys", models.IntegerField(default=0)),
                ("distance_to_building", models.IntegerField(default=0)),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtMorphologyData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, default="", max_length=16384),
                ),
                (
                    "geological_unit",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("alluvial_deposits", "Alluvial deposits"),
                            ("ancient_alluvialterraces", "Ancient alluvial terraces"),
                            ("argillite", "Argillite"),
                            ("breccias", "Breccias"),
                            ("clay", "Clay"),
                            ("conglomerate", "Conglomerate"),
                            ("debris", "Debris"),
                            ("diabase", "Diabase"),
                            ("dolomite", "Dolomite"),
                            ("fillade", "Fillade"),
                            ("fluvial_deposits", "Fluvial deposits"),
                            ("gneiss", "Gneiss"),
                            ("granite", "Granite"),
                            ("jasper", "Jasper"),
                            ("lacustrine_deposits", "Lacustrine deposits"),
                            ("limestone", "Limestone"),
                            ("marls", "Marls"),
                            ("metamorphic_rock", "Metamorphic rock"),
                            ("micaschist", "Micaschist"),
                            ("morainic_deposits", "Morainic deposits"),
                            ("ophiolite", "Ophiolite"),
                            ("rhyolitic_ignimbrite", "Rhyolitic ignimbrite"),
                            ("sand_deposits", "Sand deposits"),
                            ("sandstone", "Sandstone"),
                            ("schist", "Schist"),
                            ("torbidite", "Torbidite"),
                            ("volcanic_deposits", "Volcanic deposits"),
                            ("volcanic_rocks", "Volcanic rocks"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "morphology_class",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("t1", "T1"),
                            ("t2", "T2"),
                            ("t3", "T3"),
                            ("t4", "T4"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                (
                    "ground_type_ec8",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("unknown", "Unknown"),
                            ("a", "A"),
                            ("b", "B"),
                            ("c", "C"),
                            ("d", "D"),
                            ("e", "E"),
                            ("s1", "S1"),
                            ("s2", "S2"),
                        ],
                        default="",
                        max_length=256,
                    ),
                ),
                ("groundwater_depth", models.IntegerField(default=0)),
                ("vs_30", models.IntegerField(default=0)),
                ("f0", models.IntegerField(default=0)),
                ("amp_f0", models.IntegerField(default=0)),
                ("basin_flag", models.BooleanField(default=False)),
                ("bedrock_depth", models.IntegerField(default=0)),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="ExtOwnerData",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                (
                    "name_first",
                    models.CharField(blank=True, default="n/a", max_length=256),
                ),
                (
                    "name_last",
                    models.CharField(blank=True, default="n/a", max_length=256),
                ),
                (
                    "department",
                    models.CharField(blank=True, default="n/a", max_length=256),
                ),
                ("agency", models.CharField(blank=True, default="n/a", max_length=256)),
                ("city", models.CharField(blank=True, default="n/a", max_length=256)),
                ("street", models.CharField(blank=True, default="n/a", max_length=256)),
                (
                    "country",
                    models.CharField(blank=True, default="n/a", max_length=256),
                ),
                ("phone", models.CharField(blank=True, default="n/a", max_length=256)),
                ("email", models.CharField(blank=True, default="n/a", max_length=256)),
            ],
            bases=("book.extentitybase",),
        ),
        migrations.CreateModel(
            name="Photo",
            fields=[
                (
                    "extentitybase_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="book.ExtEntityBase",
                    ),
                ),
                ("description", models.CharField(blank=True, max_length=1024)),
                (
                    "image",
                    models.ImageField(upload_to=book.models.Photo.path_file_name),
                ),
                ("uploaded_at", models.DateTimeField(auto_now_add=True)),
                (
                    "fdsn_station",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="photos",
                        to="book.FdsnStation",
                    ),
                ),
            ],
            options={"ordering": ["uploaded_at"],},
            bases=("book.extentitybase",),
        ),
        migrations.AddField(
            model_name="fdsnnetwork",
            name="fdsn_node",
            field=models.ForeignKey(
                default=None,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="fdsn_networks",
                to="book.FdsnNode",
            ),
        ),
        migrations.AddField(
            model_name="fdsnstation",
            name="ext_basic_data",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="station",
                to="book.ExtBasicData",
            ),
        ),
        migrations.AddField(
            model_name="fdsnstation",
            name="ext_borehole_data",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="station",
                to="book.ExtBoreholeData",
            ),
        ),
        migrations.AddField(
            model_name="fdsnstation",
            name="ext_housing_data",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="station",
                to="book.ExtHousingData",
            ),
        ),
        migrations.AddField(
            model_name="fdsnstation",
            name="ext_morphology_data",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="station",
                to="book.ExtMorphologyData",
            ),
        ),
        migrations.AddField(
            model_name="fdsnstation",
            name="ext_owner_data",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="station",
                to="book.ExtOwnerData",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="fdsnnetwork", unique_together={("fdsn_node", "code", "start_date")},
        ),
        migrations.AddField(
            model_name="extaccessdata",
            name="fdsn_station",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="access_data",
                to="book.FdsnStation",
            ),
        ),
        migrations.AddField(
            model_name="extaccessdata",
            name="updated_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterUniqueTogether(
            name="fdsnstation",
            unique_together={("fdsn_network", "code", "start_date")},
        ),
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Alarm',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('link_id', models.CharField(max_length=10)),
                ('category', models.CharField(default='user', max_length=32)),
                ('content', models.CharField(max_length=32)),
                ('is_new', models.BooleanField(default=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField(blank=True)),
                ('content', models.TextField()),
                ('date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('is_long', models.BooleanField(default=False)),
                ('is_short', models.BooleanField(default=False)),
                ('is_phrase', models.BooleanField(default=False)),
                ('is_spoiler', models.BooleanField(default=False)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('isbn', models.BigIntegerField(primary_key=True, serialize=False)),
                ('title', models.TextField()),
                ('contents', models.TextField(null=True)),
                ('author_contents', models.TextField(null=True)),
                ('url', models.TextField()),
                ('thumbnail', models.TextField()),
                ('authors', models.TextField()),
                ('publisher', models.TextField()),
                ('published_date', models.TextField(null=True)),
                ('like_users', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='book.Comment')),
            ],
            options={
                'ordering': ('date',),
            },
        ),
        migrations.CreateModel(
            name='Curation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField()),
                ('content', models.TextField()),
                ('date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='curations', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nickname', models.CharField(blank=True, max_length=32)),
                ('profile_text', models.TextField(blank=True)),
                ('profile_photo', imagekit.models.fields.ProcessedImageField(default='https://react.semantic-ui.com/images/avatar/large/matthew.png', upload_to=book.models.profile_pic_path)),
                ('alarms', models.ManyToManyField(related_name='alarms', to='book.Alarm')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Library',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField()),
                ('date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('followee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='followee', to=settings.AUTH_USER_MODEL)),
                ('follower', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='follower', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CurationLike',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('curation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Curation')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='curation',
            name='like_users',
            field=models.ManyToManyField(through='book.CurationLike', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='BookInLibrary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Book')),
                ('library', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Library')),
            ],
        ),
        migrations.CreateModel(
            name='BookInCuration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Book')),
                ('curation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='book_in_curation', to='book.Curation')),
            ],
        ),
        migrations.CreateModel(
            name='ArticleLike',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='book.Article')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='article',
            name='book',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to='book.Book'),
        ),
        migrations.AddField(
            model_name='article',
            name='like_users',
            field=models.ManyToManyField(through='book.ArticleLike', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='CurationComment',
            fields=[
                ('comment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='book.Comment')),
                ('curation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='book.Curation')),
            ],
            bases=('book.comment',),
        ),
        migrations.CreateModel(
            name='ArticleComment',
            fields=[
                ('comment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='book.Comment')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='book.Article')),
            ],
            bases=('book.comment',),
        ),
    ]
Beispiel #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Hotel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('city', models.CharField(default=None, max_length=64)),
                ('name', models.CharField(default=None, max_length=64)),
                ('address', models.CharField(default=None, max_length=64)),
                ('overview', models.CharField(default=None, max_length=64)),
                ('highlight', models.CharField(default=None, max_length=64)),
                ('room_types', models.CharField(default=None, max_length=64)),
                ('rating', models.CharField(default=None, max_length=64)),
                ('price', models.FloatField(default=book.models.random_price)),
                ('latitude', models.FloatField(default=0)),
                ('longitude', models.FloatField(default=0)),
                ('imgurls', models.CharField(default=None, max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('phone_contact', models.IntegerField(default=None)),
                ('address', models.CharField(default=None, max_length=64)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]