Is it possible to have model which references itself through foreign key?
In django there is setForeignKey("self"), but I dont see that kind of method in QDjango.
When I run my app then stack overflows because of recursive call to constructor..
class Dirindex : public QDjangoModel
{
Q_OBJECT
Q_PROPERTY(Dirindex *parent READ parent WRITE setParent)
...
}
Dirindex::Dirindex(QObject *parent)
: QDjangoModel(parent)
{
setForeignKey("dirindex", new Dirindex(this));
}
I worked around this by declaring parent as int - but then I have to implement "on delete cascade" etc..
Maybe if setForeignKey would accept (at least) this format:
I've read somewhere that the foreign key implementation does not allow this - is this still the case?