#14019: SQLInsertCompiler.as_sql() failure ---------------------------------------------------+------------------------ Reporter: mlavin | Owner: nobody Status: new | Milestone: Component: Database layer (models, ORM) | Version: 1.2 Resolution: | Keywords: Stage: Accepted | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------------------------+------------------------ Changes (by tobias):
* stage: Unreviewed => Accepted Comment: Internal API or not, it seems like a generally good idea to make the code as fool-proof as possible, and this is a fairly simple change. Two thoughts: 1) Does as_sql() return anything useful if execute was not called first? 2) It's often cleaner just to set self.return_id in __init__, instead of spreading hasattr() throughout the code. I see no other cases where return_id is used within or outside the class, so setting it in __init__ should be fine. -- Ticket URL: <http://code.djangoproject.com/ticket/14019#comment:5> Django <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 django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.