Open lfalvarez opened 8 years ago
Hi @lfalvarez - I'm afraid this is very under-documented at the moment, but rather than defining a property like that, you're expected to use django.contrib.contenttypes.fields.GenericRelation
instead. So in your definition of the Organization
model, you should add:
images = GenericRelation(Image)
Does that work for you? (I'm not quite sure why your property doesn't work, although I'd note that it's generally a good idea to add mixins first in the list of superclasses (though that shouldn't make a difference in this case), and it would need to filter on content_type_id as well.)
Works pefectly! thanks a lot! :sparkles:
Hello there: I'm using this mixin as follow, but I'm not entirely sure if I'm doing it right This is the test
And when I run it I get this error:
So, I decided to write a property for the Organization model
Which does the job, but I'm not entirely sure if you meant the creation of that property or am I getting it all wrong?
Thanks for this code BTW. :smile: