From 8a816e5d19f1abf3fcdf0e83381ea66f17ca381d Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Fri, 13 Sep 2013 15:57:05 +0530 Subject: [PATCH] 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 --- tools/marvin/marvin/generate/entity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/generate/entity.py b/tools/marvin/marvin/generate/entity.py index dc96a14bd0d..b9f825bee65 100644 --- a/tools/marvin/marvin/generate/entity.py +++ b/tools/marvin/marvin/generate/entity.py @@ -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):' % (