Help with getting drop-downs to work

0 views
Skip to first unread message

steve skelton

unread,
Apr 13, 2008, 5:31:08 PM4/13/08
to Django developers
Trying to get admin on my system to load values based on related
tables on db. I have set the FK on the papers table to tie with the
PK of each look-up table and set models like so:

class LuPaperContentEra(models.Model):
paper_content_era = models.CharField(blank=True, maxlength=150)

def __unicode__(self):
return self.paper_content_era

class Meta:
db_table='lu_paper_content_era'

The main table, which should contain drop-downs for things like the
model/table above, has things like:

class Paper(models.Model):
... many fields defined
PaperContent_Era = models.ForeignKey(LuPaperContentEra)
... more fields defined

class Meta:
db_table='papers_admin'

class Admin:
list_display=('id','FirstName','LastName','Institution')
search_fields=['LastName']

However, Admin displays the drop-down as

LuPaperContactEra object, NOT the actual human-readable value list.

I feel I am probably close to getting this to work but can't seem to
find the right direction in which to be "nudged".

Thanks!

Karen Tracey

unread,
Apr 13, 2008, 6:23:32 PM4/13/08
to django-d...@googlegroups.com

The first direction I'll nudge you is to the django...@googlegroups.com list, not this one.  This one is for development of Django, not development with Django.  When you repost your question over there please include the version of Django you are using.

Karen
Reply all
Reply to author
Forward
0 new messages