On Tue, 2007-12-11 at 04:21 -0800, [EMAIL PROTECTED] wrote:
[...]

> Exception Type: TypeError at /admin/trak/ticket/add/
> Exception Value: coercing to Unicode: need string or buffer, int found

That error usually means you're trying to return something that isn't a
string from a __str__ or __unicode__ method. Sure enough ...


[...]
> class Ticket(models.Model):
>     class Admin:
>         pass
>     def __unicode__(self):
>         return self.ticket_numb

>     def was_submitted_today(self):
>         return self.create_date.date() == datetime.date.today()
>     summary = models.TextField()
>     date_created = models.DateTimeField('date created')
>     status = models.ForeignKey(Status)
>     ticket_text = models.TextField()
>     submitter_name = models.ForeignKey(Submitter)
>     ticket_numb = models.IntegerField().

Since 'ticket_numb' is an integer, you cannot return it unadorned form
__unicode__. Return unicode(self.ticket_numb) instead.

Regards,
Malcolm

-- 
Two wrongs are only the beginning. 
http://www.pointy-stick.com/blog/


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