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
Post a Comment