mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 05:11:09 -05:00
Refactor model imports and update admin classes to use pghistory for historical tracking; replace HistoricalModel with TrackedModel in relevant models
This commit is contained in:
@@ -3,10 +3,12 @@ from django.db import models
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.validators import MinValueValidator, MaxValueValidator
|
||||
from simple_history.models import HistoricalRecords
|
||||
from django.contrib.gis.geos import Point
|
||||
import pghistory
|
||||
from history_tracking.models import TrackedModel
|
||||
|
||||
class Location(models.Model):
|
||||
@pghistory.track()
|
||||
class Location(TrackedModel):
|
||||
"""
|
||||
A generic location model that can be associated with any model
|
||||
using GenericForeignKey. Stores detailed location information
|
||||
@@ -63,7 +65,6 @@ class Location(models.Model):
|
||||
# Metadata
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
history = HistoricalRecords()
|
||||
|
||||
class Meta:
|
||||
indexes = [
|
||||
|
||||
Reference in New Issue
Block a user