On 8/26/05, paolo <[EMAIL PROTECTED]> wrote:
> ... So I thought to change __repr__ to return a
> tuple containing self.code and self.price, but some problems arise.
> ...

Hi paolo -

__repr__ has to return a string - if that was what you wanted, you
could use string formatting to include the price in the result:

def __repr__(self):
   return '%s - £%s' % (self.code, self.price)

There's probably a better to way to handle your larger problem, though
- I'll leave that for the high-level Djangoistas.

Cheers,
xtian

Reply via email to