Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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:
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Solve #abstract #model #relations #conflicts #inheritance
ADD COMMENT
Topic
Name
3+8 =