Ticket #20429 - design decision needed

79 views
Skip to first unread message

Karol Sikora

unread,
May 19, 2013, 3:34:18 AM5/19/13
to django-d...@googlegroups.com
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

Karol Sikora

unread,
May 19, 2013, 3:37:12 AM5/19/13
to django-d...@googlegroups.com
Currently second approach with update is implemented.
Reply all
Reply to author
Forward
0 new messages