Hello all. The docs say about QuerySet.create [1]: """ This is equivalent to (but much simpler than):
>>> b = Blog.objects.get(id=1) >>> e = Entry( .... blog=b, .... headline='Hello', .... body_text='Hi', .... pub_date=datetime.date(2005, 1, 1) .... ) >>> e.save() """ I was trying to use create() with list of dicts representing rows that may or may not exist yet (some have ids and some don't) and hoping to get the insert-or-update behavior of save() [2]. Unfortunately (for me) it looks like QuerySet.create() passes force_insert=True [3]. It's entirely sane that a method called create() would only do inserts. If that's the case, the doc can be updated to reflect that, and ... would anyone else find it useful to have a method on QuerySet that behaves the way I thought create() did? Something like QuerySet.save(**kw)? Thanks! Jason [1] http://docs.djangoproject.com/en/dev/ref/models/relations/#ref-models-relations [2] http://docs.djangoproject.com/en/dev/ref/models/instances/#how-django-knows-to-update-vs-insert [3] http://code.djangoproject.com/browser/django/trunk/django/db/models/query.py#L343 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---