#15130: Model.validate_unique method doesn't take in account multi-db -------------------------------------+------------------------------------- Reporter: t2y | Owner: Type: Bug | Status: new Component: Database layer | Version: 1.2 (models, ORM) | Severity: Normal | Resolution: Keywords: multi-db | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by akaariai): Yes, that would be a step in the right direction. But using the write router is just a guess. There is an explicit way to tell which database to use when saving, so there should also be an explicit way to tell Django which database to use when validating. The solution I see as the right one is: {{{ 1) Use explicitly given database for validation 2) Use write router's database for validation 3) Use the default database for validation }}} And currently, if I'm not mistake, we have this: {{{ 1) Use read router's database for validation 2) Use the default database for validation (here 2 is actually implemented by the router for reading) }}} So, just changing Django to use write router instead of read router as done in the attached patch would be an improvement, but not a complete solution. -- Ticket URL: <https://code.djangoproject.com/ticket/15130#comment:17> 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/061.97d748a3749d79cb4e3b213d48b63776%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.