Changes between Version 1 and Version 2 of Ticket #34207, comment 3


Ignore:
Timestamp:
Dec 10, 2022, 12:19:57 PM (22 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34207, comment 3

    v1 v2  
    99To make it clear, intermediary models that don't define a strict unique relationship on `(from, to)` are supported. However `add(through_defaults)` is focused on enforcing that at least one entry of the `(from, to)` tuple exists and doesn't make any assumption with regards to the unique constraints defined on the intermediary model.
    1010
    11 If you want to enforce the unique existence of a tuple that is a superset of the the `(from, to)` relationship you should use `get_or_create` instead of expecting `add(through_defaults)` to figure out which of your unique constraints should be enforced based on your provided `through_defaults`.
     11If you want to enforce the unique existence of a tuple that is a superset of the the `(from, to)` relationship you should use `get_or_create` instead of expecting `add` to figure out which of your unique constraints should be enforced based on your provided `through_defaults` (as there could be many).
    1212
    1313
Back to Top