#4459: loaddata failure if model has overridden save() method -----------------------+---------------------------------------------------- Reporter: russellm | Owner: russellm Status: new | Component: Serialization Version: SVN | Keywords: Stage: Unreviewed | Has_patch: 0 -----------------------+---------------------------------------------------- If a model overrides the save() method, and performs a query in that save(), loaddata may fail when objects of that type are loaded. dumpdata/loaddata don't preserve dependency order (they can't really, because there could easily be circular dependencies), so loaddata can't guarantee that the subject of the search will have been deserialized yet. I suspect that the fix for this is to introduce a 'raw save' - a guaranteed use of the original Model.save(), rather than the model's overidden variant. raw_save should proabably also avoid running pre-save methods on fields - these methods can mutate the data as part of the load (e.g., you can't correctly deserialize an auto_add_now field, as deserializing will update the field). The errors reported by #4431 are a direct cause of this problem.
-- Ticket URL: <http://code.djangoproject.com/ticket/4459> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
