Relative Content

Tag Archive for pythondjangodjango-orm

Is it possible to switch to a through model in one release? [duplicate]

This question already has answers here: How to add through option to existing ManyToManyField with migrations and data in django (3 answers) Closed 14 days ago. Assume I have those Django models: class Book(models.Model): title = models.CharField(max_length=100) class Author(models.Model): name = models.CharField(max_length=100) books = models.ManyToManyField(Book) I already have a production system with several objects and […]

How to optimize method with multiple query calls?

I have an event system in my app. Every time a user deletes/updates/creates and object a new event is created in the database with the info of the object and the type of event it is.
My Event model looks something like this: