Format strings are your friend: "%s: %d" % (self.consequence, self.slope_height_rr)
Colin On Wed, Jul 16, 2008 at 8:14 AM, Molly <[EMAIL PROTECTED]> wrote: > > I am trying to add an integer and a string: > > ==================================================================== > def __unicode__(self): > return self.consequence + ': ' + self.slope_height_rr > ==================================================================== > > When I run my app, I get an error: > > ==================================================================== > TypeError at /admin/base/incident/add/ > coercing to Unicode: need string or buffer, float found > ==================================================================== > > I think that I need to make the integer and the string one string. > > Any ideas? > > Thanks! > Molly > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---