0

I have two models like this :

class A(models.Model):
    is_available = models.BooleanField()
    date = models.DateTimeField(auto_now_add=True)
    # Some Other Fields


class B(models.Model):
    is_available = models.BooleanField()
    date = models.DateTimeField(auto_now_add=True)
    # Some Other Fields

I want to get the records from both models in a single list of dictionaries based on available or not and filter by date in descending order. How can I do it?

Manoj Kamble
  • 620
  • 1
  • 4
  • 21
  • this is already answered on stackoverflow https://stackoverflow.com/questions/53495873/how-to-create-union-of-two-different-django-models – Ajay K Nov 22 '22 at 11:15

0 Answers0