I'm in a situation where the get_defaults method on the RelatedField class is called but self.rel.to as not been resolved yet and is still a string. I'm using Django 1.6.6 and I cannot upgrade easily (big number of systems in production).
Some important stuff : - the problem appears when I create a new object inside a py.test fixture - if I create the same object inside the shell_plus I have no problem Here is an extract of my model (foreigns A and B are mandatory, C is not) : class MyModel(models.Model): fielda = models.ForeignKey( 'otherapp.modela', db_column='fielda') fieldb = models.ForeignKey( 'otherapp.modelb', db_column='fieldb') fieldc = models.ForeignKey( 'otherapp.modelc', db_column='fieldc', null=True, blank=True) and here is how I use it : # A is an instance of otherapp.modela # B is an instance of otherapp.modelb my_object = MyModel(fielda=A, fieldb=B) Is there anything more I can provide to help ? Thank you -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/92a3a1aa-0e31-4293-a578-d549fa3c9f37%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.