Ticket #20429 - design decision needed

Showing 1-2 of 2 messages
Ticket #20429 - design decision needed Karol Sikora 5/19/13 12:34 AM
Hi,

At djangocon sprints I implemented update_or_create method on QuerySet, Patch is ready to merge on: https://github.com/django/django/pull/1132
But after some discussion with folks here and on bugtracker, we need design decision.
First approach is to following get_or_create approach, passing update part of this method through models instances and calling save method on object.
Second approach is to use update method from QuerySet, and use 'create' part of this method as someting like fallback. It allow us to update multiple objects at the same time, and is probablu faster, but not calling save on object has side effect - signals like post_create and so on wouldnt be called.

We need design decision which approach implement in update_or_create method.

Karol
Re: Ticket #20429 - design decision needed Karol Sikora 5/19/13 12:37 AM
Currently second approach with update is implemented.



W dniu niedziela, 19 maja 2013 09:34:18 UTC+2 użytkownik Karol Sikora napisał: