Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Roman Akopov
I have investigated a bit more and looks lite it is Options._relation_tree property, it's value is calculated by _populate_directed_relation_graph only once and it is @cached_property, so I see no valid way to reset value On Tuesday, September 5, 2017 at 4:40:02 PM UTC+4, Michal Petrucha wrote:

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Roman Akopov
I call it on target model, the one with reverse relation missing. On Tuesday, September 5, 2017 at 4:40:02 PM UTC+4, Michal Petrucha wrote: > > On Tue, Sep 05, 2017 at 04:56:10AM -0700, Roman Akopov wrote: > > Unfortulately, it did not help. I have added > "model._meta._expire_cache()" > > call

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Michal Petrucha
On Tue, Sep 05, 2017 at 04:56:10AM -0700, Roman Akopov wrote: > Unfortulately, it did not help. I have added "model._meta._expire_cache()" > call almost everywhere, before generating dynamic model, after, between > steps, it did not help a bit, error is exactly the same. > Also, I have additional

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Roman Akopov
On Tuesday, September 5, 2017 at 3:38:17 PM UTC+4, Michal Petrucha wrote: > > On Tue, Sep 05, 2017 at 03:47:37AM -0700, Roman Akopov wrote: > > So the deal is that each model's _meta caches a bunch of structures > storing the list of fields, reverse relations, and so on, the first > time you a

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Michal Petrucha
On Tue, Sep 05, 2017 at 03:47:37AM -0700, Roman Akopov wrote: > Hello, > > My problem is very rare so I'll try ad add as much useful detail as > possible. > > I am using python 3.5 and 3.6, Django 1.11.4 > > I am creating complex security related application and need to generate > additional

Dynamic model, reverse foreign key not working

2017-09-05 Thread Roman Akopov
Hello, My problem is very rare so I'll try ad add as much useful detail as possible. I am using python 3.5 and 3.6, Django 1.11.4 I am creating complex security related application and need to generate additional models based on other applications' models. In general, everything works fine,