mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 11:51:10 -05:00
Refactor URL patterns for parks and rides; update context fields in models to use ForeignKey for pghistory.Context
This commit is contained in:
@@ -86,16 +86,16 @@ class Migration(migrations.Migration):
|
||||
("closing_date", models.DateField(blank=True, null=True)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True, null=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"park",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="areas",
|
||||
to=PARKS_APP_MODEL,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
options = {
|
||||
options={
|
||||
"ordering": ["name"],
|
||||
},
|
||||
),
|
||||
@@ -123,7 +123,6 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
),
|
||||
(
|
||||
"pgh_context",
|
||||
"pgh_context",
|
||||
models.ForeignKey(
|
||||
db_constraint=False,
|
||||
@@ -216,12 +215,12 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
(
|
||||
"pgh_obj",
|
||||
models.ForeignKey(
|
||||
db_constraint=False,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="events",
|
||||
to=PARKS_APP_MODEL,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
|
||||
35
parks/migrations/0002_fix_pghistory_fields.py
Normal file
35
parks/migrations/0002_fix_pghistory_fields.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 5.1.4 on 2025-02-10 09:30
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('pghistory', '0006_delete_aggregateevent'),
|
||||
('parks', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='parkevent',
|
||||
name='pgh_context',
|
||||
field=models.ForeignKey(
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name='+',
|
||||
to='pghistory.context',
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='parkareaevent',
|
||||
name='pgh_context',
|
||||
field=models.ForeignKey(
|
||||
db_constraint=False,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name='+',
|
||||
to='pghistory.context',
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -36,6 +36,6 @@ urlpatterns = [
|
||||
path("<slug:park_slug>/transports/", ParkSingleCategoryListView.as_view(), {'category': 'TR'}, name="park_transports"),
|
||||
path("<slug:park_slug>/others/", ParkSingleCategoryListView.as_view(), {'category': 'OT'}, name="park_others"),
|
||||
|
||||
# Include rides URLs with park_slug
|
||||
path("<slug:park_slug>/rides/", include("rides.urls", namespace="rides")),
|
||||
# Include park-specific rides URLs
|
||||
path("<slug:park_slug>/rides/", include("rides.park_urls", namespace="rides")),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user