From e561e0d50c9be95379b89e413d482e82f0c238e6 2012-08-10 16:18:03 From: Lance Edgar Date: 2012-08-10 16:18:03 Subject: [PATCH] add repr, unicode to Customer --- diff --git a/rattail/db/extension/model.py b/rattail/db/extension/model.py index 707dc3aff3a8a4d40861a62d7b69d38cb2014424..90907a793176484c3d0ccbe40729ff07f2358bbe 100644 --- a/rattail/db/extension/model.py +++ b/rattail/db/extension/model.py @@ -964,6 +964,12 @@ class Customer(Base): id = Column(String(20)) name = Column(String(255)) + def __repr__(self): + return "" % (self.id, self.name or self.person) + + def __unicode__(self): + return unicode(self.name or self.person) + def add_email_address(self, address, type='Home'): email = CustomerEmailAddress(address=address, type=type) self.emails.append(email)