#29764: in_bulk does not works with composed unique field -------------------------------------+------------------------------------- Reporter: Jean- | Owner: nobody Daniel | Type: Bug | Status: new Component: Database | Version: 2.1 layer (models, ORM) | Severity: Normal | Keywords: Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- For instance, I have a model 'Data' with an unique_together constraint on (foo, bar) fields.
I would like to use in_bulk() on a query like: {{{ Data.objects.filter(foo='a').in_bulk(<list of bar values>, field_name='bar'). }}} Obviously, the fact that bar is not unique should not be an issue to run the query, but Django performs a check to make sure the queried field is unique and raise an error if not. As it may not be simple to check for all cases where field_name would result in a unique constraint, maybe it should be possible to disable this check (using an optional parameter). -- Ticket URL: <https://code.djangoproject.com/ticket/29764> Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/054.7dc4b840f9c6bd0e6bc92e5cb0982a95%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.