diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-02 14:23:42 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-02 14:23:42 -0500 |
commit | 350aed3fdb9f1e73e69655e53f44ca6a91c196da (patch) | |
tree | 3d2a128667b5f6ca6d0b4e1f4865fc98aac6b60b /examples/beaker_caching/model.py | |
parent | 71f92436bdc86f30e2c21d8f5244733601e8c39e (diff) | |
download | sqlalchemy-350aed3fdb9f1e73e69655e53f44ca6a91c196da.tar.gz |
- whitespace removal bonanza
Diffstat (limited to 'examples/beaker_caching/model.py')
-rw-r--r-- | examples/beaker_caching/model.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/beaker_caching/model.py b/examples/beaker_caching/model.py index c139d3284..629b263a7 100644 --- a/examples/beaker_caching/model.py +++ b/examples/beaker_caching/model.py @@ -18,7 +18,7 @@ class Country(Base): id = Column(Integer, primary_key=True) name = Column(String(100), nullable=False) - + def __init__(self, name): self.name = name @@ -41,15 +41,15 @@ class PostalCode(Base): code = Column(String(10), nullable=False) city_id = Column(Integer, ForeignKey('city.id'), nullable=False) city = relationship(City) - + @property def country(self): return self.city.country - + def __init__(self, code, city): self.code = code self.city = city - + class Address(Base): __tablename__ = 'address' @@ -58,21 +58,21 @@ class Address(Base): street = Column(String(200), nullable=False) postal_code_id = Column(Integer, ForeignKey('postal_code.id')) postal_code = relationship(PostalCode) - + @property def city(self): return self.postal_code.city - + @property def country(self): return self.postal_code.country - + def __str__(self): return "%s\t"\ "%s, %s\t"\ "%s" % (self.street, self.city.name, self.postal_code.code, self.country.name) - + class Person(Base): __tablename__ = 'person' @@ -86,13 +86,13 @@ class Person(Base): def __str__(self): return self.name - + def __repr__(self): return "Person(name=%r)" % self.name - + def format_full(self): return "\t".join([str(x) for x in [self] + list(self.addresses)]) - + # Caching options. A set of three RelationshipCache options # which can be applied to Query(), causing the "lazy load" # of these attributes to be loaded from cache. |