Hi!
derek wrote:
> when
> iterating through Buiding objects, a call to display
> "alarm.manufacturer__name" gives me an "AttributeError: 'Building'
> object has no attribute 'alarm'". Clearly, this is because, from the
> building point of view, there is no known relationship to Alarm.
class Alarm(models.Model):
...
building = models.ForeignKey(Building, related_name = 'alarm')
...
You need to name it properly, that's all.
--
Dmitry Dulepov
Twitter: http://twitter.com/dmitryd/
Web: http://dmitry-dulepov.com/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.