python - ORM object value as default for model field in Django 1.7 -


Apparently, Junk does not work in 1.7 because the app is now loaded:

  entity = models.ForeignKey (counterparty, default = counterparty.objects.get (counterparty_name = 'one company limited') .pk, related_name = 'entity')  

this one django.core.exceptions.AppRegistryNotReady: Models are not loaded yet. Error .. Is there a way to get the same thing in 1.7?

It seems that lazy evaluation is a trick, just fetch is an anonymous function, which is said in runtime It appears in the move

  entity = model.Irganki (counterparty, default = lambda: counterparty.obies.jet (counterparty_name = 'a company limited'). Pk, related_name = ' Entity ')  

Thanks Tip!


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -