python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Django ORM prefetch field from manual join table on many-to-many relationship
I'm facing an n-plus-1 query explosion after changing a Django model and I think it is because I am having to re-query for fields from a manual join table
As a stripped-down example
class Dashboard(mo...
Paul D'Ambra
Votes: 0
Answers: 1
Generic ManyToMany for multiple inherited models
First of all, the following code is not an example of best practices in DB modelling and I know it, unfortunately, this is already made and it's what it is. Remodelling everything is just not an optio...
andrepz
Votes: 0
Answers: 0
Problem with adding objects to manytomany fields
I have a User model:
class User(AbstractUser):
followers_num = models.IntegerField(default=0)
followings_num = models.IntegerField(default=0)
followers = models.ManyToManyField('self', bla...
ParsaAi
Votes: 0
Answers: 2
How to retrieve the data from referencing side of a many-to-many relationship?
I have a entity class named Question and it have the relationship with the exam class. In order to allow the user access to the list of question that belonged to the particular exam id, I have tried t...
user11848520
Votes: 0
Answers: 1