Hi Django world I keep getting problems accessing and storing data in foreignkey and one-to-one relationships. Error is basically of the form: "AttributeError Exception Value: 'DirectoryAdmin' object has no attribute 'abbrev'"
The models.py file is here: http://pastebin.com/mcc4ee45 The SQL it produces is here: http://pastebin.com/m5b70bce5 I don't think the problem is in here but you can see what I am trying to achieve. At the moment i am just trying to save multiple records in 'class DirectoryType' which relate through a foreignkey to Directory. MAIN CULPRIT: Views.py http://pastebin.com/m10eac87f I seem to be able to .save() new instances of Directory, DirectoryAdmin, DirectoryType However i cant get Directory to associate with multiple instances of DirectoryType or even DirectoryAdmin. At a more fundamental level the .add() method says: 'DirectoryType' object has no attribute 'add' And if i try to see an attribute in another table: var = dirdir.admin.abbrev #error: 'DirectoryAdmin' object has no attribute 'name' However i seem to be able to access the database for id's. var = dirdir.admin.id #works Any help would be greatly appreciated as i dont know what is going wrong beyond this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---