Changeset - e561e0d50c9b
[Not reviewed]
0 1 0
Lance Edgar (lance) - 12 years ago 2012-08-10 16:18:03
lance@edbob.org
add repr, unicode to Customer
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/db/extension/model.py
Show inline comments
 
@@ -961,12 +961,18 @@ class Customer(Base):
 
    __tablename__ = 'customers'
 

	
 
    uuid = uuid_column()
 
    id = Column(String(20))
 
    name = Column(String(255))
 

	
 
    def __repr__(self):
 
        return "<Customer: %s, %s>" % (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)
 

	
 
    def add_phone_number(self, number, type='Home'):
 
        phone = CustomerPhoneNumber(number=number, type=type)
0 comments (0 inline, 0 general)