diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-25 16:01:25 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-29 00:14:47 +0100 |
commit | 03c22862322f42a68351e70956e24e512028f0b2 (patch) | |
tree | 5822dd1f99afba9286e8c4bcc536b35659ec6759 /mediagoblin/db/sql/base.py | |
parent | 690672580e333bb6a2dc67466390847a79566045 (diff) | |
download | mediagoblin-03c22862322f42a68351e70956e24e512028f0b2.tar.lz mediagoblin-03c22862322f42a68351e70956e24e512028f0b2.tar.xz mediagoblin-03c22862322f42a68351e70956e24e512028f0b2.zip |
Support .get(fieldname) on sql db objects
Some parts of the code like to call .get("somefield") on
the db objects. It's easy to support this on sqlalchemy
based objects, so lets do it.
Diffstat (limited to 'mediagoblin/db/sql/base.py')
-rw-r--r-- | mediagoblin/db/sql/base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mediagoblin/db/sql/base.py b/mediagoblin/db/sql/base.py index 5e420bdc..1249bace 100644 --- a/mediagoblin/db/sql/base.py +++ b/mediagoblin/db/sql/base.py @@ -25,3 +25,6 @@ class GMGTableBase(object): @classmethod def one(cls, query_dict): return cls.find(query_dict).one() + + def get(self, key): + return getattr(self, key) |