#28899: recursive relationship only works one way
-------------------------------------+-------------------------------------
Reporter: HenrySiau | Owner: nobody
Type: Uncategorized | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: ForeignKey, self | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):
* status: new => closed
* resolution: => needsinfo
Comment:
I tried this and it worked for me:
{{{
In [1]: from test_app.models import Catalog
In [2]: parent = Catalog.objects.create()
In [3]: child = Catalog.objects.create(parent=parent)
In [4]: child.parent
Out[4]: <Catalog: Catalog object (1)>
In [5]: child.refresh_from_db()
In [6]: child.parent
Out[6]: <Catalog: Catalog object (1)>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28899#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.c7401df054586d1306a278b695326665%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.