On Fri, Mar 26, 2010 at 8:00 PM, Asim Yuksel <[email protected]>wrote:

> I've tried this.
> The model is
>
> class Advisors(models.Model):
>     advisorid = models.IntegerField(primary_key=True,
> db_column='advisorId') # Field name made lowercase.
>    maphdid = models.ForeignKey(Tblmaphds, db_column='maPhDId') #
> Field name made lowercase.
>    rank = models.SmallIntegerField()
>    def __unicode__(self):
>        return self.maphdid
>    class Meta:
>        db_table = u'Advisors'
>
>
You are showing a __unicode__ method for the Advisors model. A ForeignKey
field where the related model is a Tblmaphds will use the __unicode__ method
of the Tblmaphds model to display the value of the related field. You need
to add a __unicode__ method to the Tblmaphds model.

Karen

-- 
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.

Reply via email to