You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue where the table renders correctly when viewed by default, but when I sort on the related_name, last_response, it duplicates rows multiplied by the number of related objects. I've simplified my code down to just the problem area.
class Inquiry(models.Model):
status = models.CharField(max_length=20, default="OPEN")
title = models.CharField(max_length=255)
class Message(models.Model):
inquiry = models.ForeignKey(Inquiry, on_delete=models.CASCADE, related_name="messages")
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, verbose_name="Sender", related_name="users")
date = models.DateTimeField(auto_now_add=True)
message = models.CharField(max_length=1000)
Should I just try reconstructing the table so that model = Message instead of model = Inquiry and just filter it down and use a bunch of accessors?
The text was updated successfully, but these errors were encountered:
I'm having an issue where the table renders correctly when viewed by default, but when I sort on the related_name, last_response, it duplicates rows multiplied by the number of related objects. I've simplified my code down to just the problem area.
My code:
tables.py
models.py
Should I just try reconstructing the table so that model = Message instead of model = Inquiry and just filter it down and use a bunch of accessors?
The text was updated successfully, but these errors were encountered: