I have the following model:-

class Rank_Advert(models.Model):
    advert = models.ForeignKey(Advert)
    brand = models.ForeignKey(Brand,verbose_name="brand_owner")
    rank= models.IntegerField(default=1,blank=True)
    def __unicode__(self):
        return self.advert
    class Admin:
        save_on_top=True
        list_display=('advert','brand','rank')

Whenever, I try to save a new record to this model I am getting the following error:-

Request Method: POST
Request URL: http://localhost/admin/promotions/rank_advert/add/
Exception Type: TypeError
Exception Value: coercing to Unicode: need string or buffer, Advert found
Exception Location: C:\Python24\lib\site-packages\django\utils\encoding.py in force_unicode, line 37

Can anybody explain what's happening.  I've run out of ideas.

Cheers

MerMer


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to