marvin_refactor: update the object during non-create transforms

When an entity is updated/ the object attributes should be updated.
Previously we only updated the attributes when creating the entity.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-09-13 15:57:05 +05:30
parent 0fdc4e25bc
commit 8a816e5d19
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ class Entity(object):
'if %s and len(%s) > 0 else None' % (
entity, entity.lower(), entity.lower(), entity.lower()))
else:
m.body.append(self.tabspace + 'return %s if %s else None' % (entity.lower(), entity.lower()))
m.body.append(self.tabspace + 'return self.__update__(%s.__dict__) if %s else None' % (entity.lower(), entity.lower()))
else:
if len(details['args']) > 0: #has required arguments
m.signature = 'def __init__(self, apiclient=None, %s, factory=None, **kwargs):' % (