In reality it isn't error and looks that using: ', '.join(["%s=%r" % (key, getattr(self, key))
it's better since that you know easily the data type, althought it shows a large text for date/datetime. On Jul 13, 3:20 pm, Kless <[EMAIL PROTECTED]> wrote: > Solved, if it's used > ', '.join(["%s=%s" % (key, getattr(self, key)) > > instead of: > ', '.join(["%s=%r" % (key, getattr(self, key)) > > On Jul 13, 2:14 pm, Kless <[EMAIL PROTECTED]> wrote: > > > It fails with fields of date. It shows: > > > created_at=*datetime.datetime(2008, 7, 13, 13, 59, 57)* > > > On Jun 21, 7:25 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > that __repr__ is pretty tortured too; a typical ORM-agnostic approach > > > is: > > > > def __repr__(self): > > > return "%s(%s)" % ( > > > (self.__class__.__name__), > > > ', '.join(["%s=%r" % (key, getattr(self, key)) > > > for key in sorted(self.__dict__.keys()) > > > if not key.startswith('_')])) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---