I am working on an extending a current project and came cross this line of code:
MyGenericRelation().contribute_to_class(model, 'field_name')
The result of this code is a field with 'field_name' added to the 'model' and from what I gather, the objects inside the field are a list of type X (part of MyGenericRelation).
I wanted to understand how this contribute_to_class
method works. Why do I get a list of X objects attached to 'field_name' and does it have to be generic relations?