Deferred model references broken
kreichgauer opened this issue · 1 comments
kreichgauer commented
When you create a model reference with a string as the target type, redisco fails to create an <origin>_set
attribute on the target.
>>> class User(models.Model):
... name = models.CharField()
... address = models.ReferenceField('Address')
...
>>> class Address(models.Model):
... street_address = models.CharField()
...
>>> a=Address()
>>> a.user_set
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'Address' object has no attribute 'user_set'
>>> a.address_set # Exists and raises redisco.models.exceptions.MissingID
Modified test case and fix are here
kreichgauer commented
fixed, see #11