Apologies if this is simple, but...
I have a simple 2 object app with which I'm having what appears to be a
foreign key lookup problem.
----------- archie.py ----------------
class Vendor(meta.Model):
class META:
admin=meta.Admin()
name = meta.CharField("Name", maxlength=100, core=True)
def __repr__(self):
return (self.name)
class ServerModel(meta.Model):
class META:
admin=meta.Admin()
vendor = meta.ForeignKey(Vendor)
model = meta.CharField(maxlength=200, core=True)
def __repr__(self):
return (self.vendor.name + " " + self.model)
--------------------------------------
When I run this, everything's fine with Vendors. However the
ServerModel list shows (None) for each entry created instead of the
expected <Vendor> <ServerName>. Also if I click on an entry to edit I
get a traceback error listing. I also tried replacing self.vendor.name
with self.vendor.get_name() but with the same results.
Occurs on both OSX & Windows, django 0.93, sqlite3 db.
Am sure this must be simple, all help much appreciated.
Thanks,
Scott.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---