}}}
Catalog.parent always return null, while Catalog.children.all() works
fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/28899>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* 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>