Answers for "Solve abstract model relations conflicts while using inheritance"

0

Solve abstract model relations conflicts while using inheritance

create_user = models.ForeignKey(User, related_name='%(class)s_requests_created')

 // The related_name would ensure that the fields were not conflicting with each other, but you have two models, each of which has both of those fields. You need to put the name of the concrete model in each one, which you can do with some special string substitution:
Posted by: Guest on March-23-2022

Code answers related to "Solve abstract model relations conflicts while using inheritance"

Python Answers by Framework

Browse Popular Code Answers by Language