Refactor URL patterns for parks and rides; update context fields in models to use ForeignKey for pghistory.Context

This commit is contained in:
pacnpal
2025-02-10 10:54:34 -05:00
parent 9ed28b15b4
commit b4c474c496
12 changed files with 670 additions and 495 deletions

View File

@@ -50,7 +50,13 @@ class RideEvent(models.Model, DiffMixin):
# Context fields
pgh_obj = models.ForeignKey('Ride', on_delete=models.CASCADE)
pgh_context = models.JSONField(null=True)
pgh_context = models.ForeignKey(
'pghistory.Context',
on_delete=models.DO_NOTHING,
db_constraint=False,
related_name='+',
null=True,
)
class Meta:
db_table = 'rides_rideevent'
@@ -80,7 +86,13 @@ class RideModelEvent(models.Model, DiffMixin):
# Context fields
pgh_obj = models.ForeignKey('RideModel', on_delete=models.CASCADE)
pgh_context = models.JSONField(null=True)
pgh_context = models.ForeignKey(
'pghistory.Context',
on_delete=models.DO_NOTHING,
db_constraint=False,
related_name='+',
null=True,
)
class Meta:
db_table = 'rides_ridemodelevent'