Skip to content

Commit

Permalink
Ensure that encode_model_property is called for encoding xdb Model in…
Browse files Browse the repository at this point in the history
…stances
  • Loading branch information
njoyce committed Feb 16, 2015
1 parent e1f90dc commit 0ff0bd5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pyamf/adapters/_google_appengine_ext_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ def getEncodableAttributes(self, obj, codec=None):
for attr in obj.dynamic_properties():
attrs[attr] = self.getAttribute(obj, attr, codec=codec)

if self.properties:
for name in self.encodable_properties:
prop = self.properties.get(name, None)

if not prop:
continue

try:
value = attrs[name]
except KeyError:
value = self.getAttribute(obj, name, codec=codec)

attrs[name] = adapter_models.encode_model_property(
obj,
prop,
value
)

return attrs

def getDecodableAttributes(self, obj, attrs, codec=None):
Expand Down

0 comments on commit 0ff0bd5

Please sign in to comment.