Merge pull request #92 from mwesterhof/master

Serializer.serialize_model fix of uncaught _SkipField exceptions
This commit is contained in:
Marko Tibold 2011-12-13 04:06:40 -08:00
commit 4f38e78580

View File

@ -229,6 +229,7 @@ class Serializer(object):
# serialize each required field
for fname in fields:
try:
if hasattr(self, smart_str(fname)):
# check first for a method 'fname' on self first
meth = getattr(self, fname)
@ -243,7 +244,6 @@ class Serializer(object):
else:
continue
try:
key = self.serialize_key(fname)
val = self.serialize_val(fname, obj)
data[key] = val