Improve admin page
This commit is contained in:
@ -0,0 +1,308 @@
|
||||
# Generated by Django 5.0.6 on 2024-07-01 15:17
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.db.models.functions.text
|
||||
import simple_history.models
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies: list[tuple[str, str]] = [
|
||||
("twitch_app", "0002_game_image_url"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations: list[Operation] = [
|
||||
migrations.CreateModel(
|
||||
name="HistoricalDropBenefit",
|
||||
fields=[
|
||||
("id", models.TextField(db_index=True)),
|
||||
("created_at", models.DateTimeField(blank=True, null=True)),
|
||||
("entitlement_limit", models.IntegerField(blank=True, null=True)),
|
||||
("image_asset_url", models.URLField(blank=True, null=True)),
|
||||
("is_ios_available", models.BooleanField(blank=True, null=True)),
|
||||
("name", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"added_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"modified_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("history_date", models.DateTimeField(db_index=True)),
|
||||
("history_change_reason", models.CharField(max_length=100, null=True)),
|
||||
(
|
||||
"history_type",
|
||||
models.CharField(
|
||||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
(
|
||||
"game",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="+",
|
||||
to="twitch_app.game",
|
||||
),
|
||||
),
|
||||
(
|
||||
"history_user",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="+",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
(
|
||||
"owner_organization",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="+",
|
||||
to="twitch_app.organization",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "historical drop benefit",
|
||||
"verbose_name_plural": "historical drop benefits",
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
},
|
||||
bases=(simple_history.models.HistoricalChanges, models.Model),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="HistoricalDropCampaign",
|
||||
fields=[
|
||||
("id", models.TextField(db_index=True)),
|
||||
("account_link_url", models.URLField(blank=True, null=True)),
|
||||
("description", models.TextField(blank=True, null=True)),
|
||||
("details_url", models.URLField(blank=True, null=True)),
|
||||
("end_at", models.DateTimeField(blank=True, null=True)),
|
||||
("image_url", models.URLField(blank=True, null=True)),
|
||||
("name", models.TextField(blank=True, null=True)),
|
||||
("start_at", models.DateTimeField(blank=True, null=True)),
|
||||
("status", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"added_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"modified_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("history_date", models.DateTimeField(db_index=True)),
|
||||
("history_change_reason", models.CharField(max_length=100, null=True)),
|
||||
(
|
||||
"history_type",
|
||||
models.CharField(
|
||||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
(
|
||||
"game",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="+",
|
||||
to="twitch_app.game",
|
||||
),
|
||||
),
|
||||
(
|
||||
"history_user",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="+",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
(
|
||||
"owner",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="+",
|
||||
to="twitch_app.organization",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "historical drop campaign",
|
||||
"verbose_name_plural": "historical drop campaigns",
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
},
|
||||
bases=(simple_history.models.HistoricalChanges, models.Model),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="HistoricalGame",
|
||||
fields=[
|
||||
("id", models.TextField(db_index=True)),
|
||||
("slug", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"twitch_url",
|
||||
models.GeneratedField( # type: ignore # noqa: PGH003
|
||||
db_persist=True,
|
||||
expression=django.db.models.functions.text.Concat(
|
||||
models.Value("https://www.twitch.tv/directory/category/"),
|
||||
"slug",
|
||||
),
|
||||
output_field=models.TextField(),
|
||||
),
|
||||
),
|
||||
(
|
||||
"image_url",
|
||||
models.GeneratedField( # type: ignore # noqa: PGH003
|
||||
db_persist=True,
|
||||
expression=django.db.models.functions.text.Concat(
|
||||
models.Value("https://static-cdn.jtvnw.net/ttv-boxart/"),
|
||||
"id",
|
||||
models.Value("_IGDB.jpg"),
|
||||
),
|
||||
output_field=models.URLField(),
|
||||
),
|
||||
),
|
||||
("display_name", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"added_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"modified_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("history_date", models.DateTimeField(db_index=True)),
|
||||
("history_change_reason", models.CharField(max_length=100, null=True)),
|
||||
(
|
||||
"history_type",
|
||||
models.CharField(
|
||||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
(
|
||||
"history_user",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="+",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "historical game",
|
||||
"verbose_name_plural": "historical games",
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
},
|
||||
bases=(simple_history.models.HistoricalChanges, models.Model),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="HistoricalTimeBasedDrop",
|
||||
fields=[
|
||||
("id", models.TextField(db_index=True)),
|
||||
("required_subs", models.IntegerField(blank=True, null=True)),
|
||||
("end_at", models.DateTimeField(blank=True, null=True)),
|
||||
("name", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"required_minutes_watched",
|
||||
models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
("start_at", models.DateTimeField(blank=True, null=True)),
|
||||
(
|
||||
"added_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"modified_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("history_date", models.DateTimeField(db_index=True)),
|
||||
("history_change_reason", models.CharField(max_length=100, null=True)),
|
||||
(
|
||||
"history_type",
|
||||
models.CharField(
|
||||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
(
|
||||
"history_user",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="+",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "historical time based drop",
|
||||
"verbose_name_plural": "historical time based drops",
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
},
|
||||
bases=(simple_history.models.HistoricalChanges, models.Model),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="HistoricalUser",
|
||||
fields=[
|
||||
("id", models.TextField(db_index=True)),
|
||||
(
|
||||
"added_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"modified_at",
|
||||
models.DateTimeField(blank=True, editable=False, null=True),
|
||||
),
|
||||
("history_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
("history_date", models.DateTimeField(db_index=True)),
|
||||
("history_change_reason", models.CharField(max_length=100, null=True)),
|
||||
(
|
||||
"history_type",
|
||||
models.CharField(
|
||||
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
(
|
||||
"history_user",
|
||||
models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="+",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "historical user",
|
||||
"verbose_name_plural": "historical users",
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
},
|
||||
bases=(simple_history.models.HistoricalChanges, models.Model),
|
||||
),
|
||||
]
|
@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.0.6 on 2024-07-01 15:23
|
||||
|
||||
from django.db import migrations
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies: list[tuple[str, str]] = [
|
||||
("twitch_app", "0003_historicaldropbenefit_historicaldropcampaign_and_more"),
|
||||
]
|
||||
|
||||
operations: list[Operation] = [
|
||||
migrations.RemoveField(
|
||||
model_name="user",
|
||||
name="drop_campaigns",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="HistoricalUser",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="User",
|
||||
),
|
||||
]
|
@ -0,0 +1,92 @@
|
||||
# Generated by Django 5.0.6 on 2024-07-01 15:40
|
||||
|
||||
from django.db import migrations
|
||||
from django.db.migrations.operations.base import Operation
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies: list[tuple[str, str]] = [
|
||||
(
|
||||
"twitch_app",
|
||||
"0004_remove_user_drop_campaigns_delete_historicaluser_and_more",
|
||||
),
|
||||
]
|
||||
|
||||
operations: list[Operation] = [
|
||||
migrations.AlterModelOptions(
|
||||
name="dropbenefit",
|
||||
options={
|
||||
"ordering": ("name",),
|
||||
"verbose_name": "Drop Benefit",
|
||||
"verbose_name_plural": "Drop Benefits",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="dropcampaign",
|
||||
options={
|
||||
"ordering": ("name",),
|
||||
"verbose_name": "Drop Campaign",
|
||||
"verbose_name_plural": "Drop Campaigns",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="game",
|
||||
options={
|
||||
"ordering": ("display_name",),
|
||||
"verbose_name": "Game",
|
||||
"verbose_name_plural": "Games",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="historicaldropbenefit",
|
||||
options={
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"verbose_name": "historical Drop Benefit",
|
||||
"verbose_name_plural": "historical Drop Benefits",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="historicaldropcampaign",
|
||||
options={
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"verbose_name": "historical Drop Campaign",
|
||||
"verbose_name_plural": "historical Drop Campaigns",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="historicalgame",
|
||||
options={
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"verbose_name": "historical Game",
|
||||
"verbose_name_plural": "historical Games",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="historicaltimebaseddrop",
|
||||
options={
|
||||
"get_latest_by": ("history_date", "history_id"),
|
||||
"ordering": ("-history_date", "-history_id"),
|
||||
"verbose_name": "historical Time-Based Drop",
|
||||
"verbose_name_plural": "historical Time-Based Drops",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="organization",
|
||||
options={
|
||||
"ordering": ("name",),
|
||||
"verbose_name": "Organization",
|
||||
"verbose_name_plural": "Organizations",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="timebaseddrop",
|
||||
options={
|
||||
"ordering": ("name",),
|
||||
"verbose_name": "Time-Based Drop",
|
||||
"verbose_name_plural": "Time-Based Drops",
|
||||
},
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user