[Django] #35299: Remove ValueError in Create method with OneToOne relation

7 views
Skip to first unread message

Django

unread,
Mar 13, 2024, 11:47:35 AM3/13/24
to django-...@googlegroups.com
#35299: Remove ValueError in Create method with OneToOne relation
-------------------------------------+-------------------------------------
Reporter: ozahirnyi | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 5.0
layer (models, ORM) | Keywords: create OneToOne
Severity: Normal | exception
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The issue
[https://code.djangoproject.com/ticket/34586?utm_campaign=Django%2BNewsletter&utm_medium=web&utm_source=Django_Newsletter_193
#34586] was fixed in
[https://github.com/django/django/commit/e02fc588893485e5f5e509cdb67c63d8e1a45b31
commit] by raising an Exception. However, now there is no possibility to
create a new row with a OneToOne relation because of the condition {{{if
reverse_one_to_one_fields:}}}. I believe that the issue must fix this part
{{{create() does not save reverse OneToOne relationship}}}.
--
Ticket URL: <https://code.djangoproject.com/ticket/35299>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 13, 2024, 11:48:47 AM3/13/24
to django-...@googlegroups.com
#35299: Remove ValueError in Create method with OneToOne relation
-------------------------------------+-------------------------------------
Reporter: ozahirnyi | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: create OneToOne | Triage Stage:
exception | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by ozahirnyi:

Old description:

> The issue
> [https://code.djangoproject.com/ticket/34586?utm_campaign=Django%2BNewsletter&utm_medium=web&utm_source=Django_Newsletter_193
> #34586] was fixed in
> [https://github.com/django/django/commit/e02fc588893485e5f5e509cdb67c63d8e1a45b31
> commit] by raising an Exception. However, now there is no possibility to
> create a new row with a OneToOne relation because of the condition {{{if
> reverse_one_to_one_fields:}}}. I believe that the issue must fix this
> part {{{create() does not save reverse OneToOne relationship}}}.

New description:

The issue
[https://code.djangoproject.com/ticket/34586?utm_campaign=Django%2BNewsletter&utm_medium=web&utm_source=Django_Newsletter_193
#34586] was resolved in
[https://github.com/django/django/commit/e02fc588893485e5f5e509cdb67c63d8e1a45b31
commit] by introducing an Exception. However, as a result of the condition
{{{if reverse_one_to_one_fields:}}}, it's currently not possible to create
a new row with a OneToOne relationship. In my opinion, the issue should
address the part {{{create() does not save reverse OneToOne
relationship}}} instead of merely adding the Exception.

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35299#comment:1>

Django

unread,
Mar 13, 2024, 12:52:11 PM3/13/24
to django-...@googlegroups.com
#35299: Remove ValueError in Create method with OneToOne relation
-------------------------------------+-------------------------------------
Reporter: Oleksandr Zahirnyi | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: create OneToOne | Triage Stage:
exception | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* resolution: => duplicate
* status: new => closed

Comment:

Duplicate of #18638.
--
Ticket URL: <https://code.djangoproject.com/ticket/35299#comment:2>
Reply all
Reply to author
Forward
0 new messages