work around some json mess

This commit is contained in:
Frédéric Péters 2011-11-19 11:28:56 +01:00
parent 07e48ac66e
commit 854c3c1426
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class Address(Field):
def from_dict(cls, d):
o = cls()
if type(d) is list:
d = d[0] # wtf?
for attr in ('title', 'street', 'zipcode', 'city', 'phone1', 'phone2',
'fax', 'email'):
setattr(o, attr, d.get(attr))