I have a question about model.ForeignKey field.Foreign key fields are
shown as object in admin page. How can I show them in other types like
integer type
for example I have a Model like this:

class Advisor(models.Model):

    advisorid = models.IntegerField(primary_key=True,
db_column='advisorId')
    maphdid = models.ForeignKey(Tblmaphds, db_column='maPhDId')
    def __str__(self):
        return smart_str('%s' % (self.maphdid))
    def __unicode__(self):
        return smart_str('%s' % (self.maphdid))
    class Meta:
        db_table = 'Advisor'

The problem is I see the maphdid value as "Tblmaphds object" instead
of a normal integer value.

What should I do to see a integer value?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to