#34433: OneToOneField can only be saved one way
-------------------------------------+-------------------------------------
     Reporter:  Alexis Lesieur       |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  4.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

 > It's also problematic as foreigh keys work this way: (from my work
 example)

 That's not true, on foreign keys you also cannot assign to a **reverse**
 side.

 > `.save()` "fails" silently, there is no way to know that the change
 didn't take, especially when this happens:

 `save()` doesn't fail silently. By assigning an object to the
 `.restaurant` you override a lazy reverse side of `OneToOneField` to a
 "static" instance so it's not recognize as a relationship anymore.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34433#comment:3>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701871220bd42-3742e1a8-3227-4fe9-9b43-f4cc092d9eaf-000000%40eu-central-1.amazonses.com.

Reply via email to