django-simple-history
django-simple-history copied to clipboard
Link a model to a specific record
Problem Statement
I want to be able to link a model to a historial record of another model, for example:
from django.db import models
from simple_history.models import HistoricalRecords
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
history = HistoricalRecords()
class PollReview(models.Model):
poll_reviewed = HistoricalPoll()
reviewed_comment = models.CharField(max_length=200)
reviewed_by = ...
Describe the solution you'd like
I wan't to know if that is currently possible, and if so, how to do it. If not, find a workaround.
Describe alternatives you've considered I thought of storing a charfield pointing to the id of a record, but that would add an additional step of having to query the record.
Additional context Add any other context or screenshots about the feature request here.