Kronuz/django_polymorphic — comment on commit b92ae8d852bc52ed51d86d573cb643bfebf73d1c
File:  line 0
By Kronuz:

Oh, this is just a little patch I added for myself, maybe we could leave it out ...or not.

Since my initial fixtures are created "automagically" and I add my objects there in the json files by initializing/adding only the fields that I need (the others are left for the serializer to use the model's fields defaults), I'd now have to have a way to know which models were being proxied and which not (in my fixtures generator), and add json with the primary key to create records *only* in my non-proxied models's children tables (for which I didn't have any specific fields initialized) ...I just didn't want to add much more code or a hardcoded list of all my non-proxied objects to make my queries work with my "easy to build" fixtures... so I made this patch to magically spawn objects not found. Instead of "re-creating" we could raise an exception instead or simply do nothing.

To be honest, I'd remove it... but perhaps we could leave it there with a note for now?.... until we fix fixtures. I believe fixtures should be simpler. In my opinion, one wouldn't have to need to add two or more json objects for polymorphic objects, a single polymorphic object should be a single json object in the fixtures.