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 almost everywhere, before generating dynamic model, after, between > > steps, it did not help a bit, error is exactly the same. > > Also, I have additionally tested my application against django 1.10 and > > django 1.9 and got exactly the same result. > > On which models did you call that? You should call it on the target > model of any relationship that you create dynamically. So if you have > existing models Target1, and Target2, and create a new model Dynamic > with a ForeignKey(Target1) and ManyToManyField(Target2), you'd need to > call _expire_cache() on Target1 and Target2 right after creating the > dynamic model, but before trying to make any queries using those new > reverse relations. > > If this doesn't help, then you might have to investigate if there's > perhaps some cached attribute that doesn't get cleared. > > Good luck, > > Michal >
-- You received this message because you are subscribed to the Google Groups "Django users" 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]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9e7aa61d-23e0-498c-83e2-500f39941351%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

