@@ 38-55 (lines=18) @@ | ||
35 | return "<%s#%s>" % self.__class__.__name__, self.id |
|
36 | ||
37 | ||
38 | class Address(Base): |
|
39 | """Define an Address.""" |
|
40 | ||
41 | __tablename__ = "addresses" |
|
42 | ||
43 | id = Column(Integer, primary_key=True) |
|
44 | ||
45 | description = Column(Unicode, unique=True) |
|
46 | ||
47 | user_id = Column(Integer, ForeignKey("users.id")) |
|
48 | ||
49 | def __unicode__(self): |
|
50 | """Give a readable representation of an instance.""" |
|
51 | return "%s" % self.id |
|
52 | ||
53 | def __repr__(self): |
|
54 | """Give a unambiguous representation of an instance.""" |
|
55 | return "<%s#%s>" % self.__class__.__name__, self.id |
|
56 |
@@ 41-56 (lines=16) @@ | ||
38 | return func.substr(cls.name, 0, 3) |
|
39 | ||
40 | ||
41 | class Address(Base): |
|
42 | """Define an Address.""" |
|
43 | ||
44 | __tablename__ = 'addresses' |
|
45 | ||
46 | id = Column(Integer, primary_key=True) |
|
47 | description = Column(String, unique=True) |
|
48 | user_id = Column(Integer, ForeignKey('users.id')) |
|
49 | ||
50 | def __unicode__(self): |
|
51 | """Give a readable representation of an instance.""" |
|
52 | return '%s' % (self.id) |
|
53 | ||
54 | def __repr__(self): |
|
55 | """Give a unambiguous representation of an instance.""" |
|
56 | return '<%s#%s>' % (self.__class__.__name__, self.id) |
|
57 |