@@ -51,7 +51,8 @@ def as_dict(self, attributes=None):
5151        kwargs  =  {
5252            'type_name' : self .schema_name ,
5353            'key_attribute' : self .id_attribute ,
54-             'key_value' : self .id_value ,
54+             # must be a "JSON" string 
55+             'key_value' : '"{}"' .format (self .id_value ),
5556        }
5657        if  attributes  is  not None :
5758            kwargs ['attributes' ] =  attributes 
@@ -71,7 +72,8 @@ def validate_password(self, password, password_attribute='password'):
7172        kwargs  =  {
7273            'type_name' : self .schema_name ,
7374            'key_attribute' : self .id_attribute ,
74-             'key_value' : self .id_value ,
75+             # must be a "JSON" string 
76+             'key_value' : '"{}"' .format (self .id_value ),
7577            'password_attribute' : password_attribute ,
7678            'password_value' : password ,
7779            'attributes' : [self .id_attribute ],
@@ -98,6 +100,8 @@ def create(self, attributes):
98100            'attributes' : attributes ,
99101        }
100102        r  =  self .app .apicall ('entity.create' , ** kwargs )
103+         self ._id_attribute  =  'uuid' 
104+         self ._id_value  =  r ['uuid' ]
101105
102106        return  {
103107            'id' : r ['id' ],
@@ -109,7 +113,8 @@ def delete(self):
109113        kwargs  =  {
110114            'type_name' : self .schema_name ,
111115            'key_attribute' : self .id_attribute ,
112-             'key_value' : self .id_value ,
116+             # must be a "JSON" string 
117+             'key_value' : '"{}"' .format (self .id_value ),
113118        }
114119        self .app .apicall ('entity.delete' , ** kwargs )
115120
@@ -125,7 +130,8 @@ def replace(self, attributes, attribute_path=None):
125130        kwargs  =  {
126131            'type_name' : self .schema_name ,
127132            'key_attribute' : self .id_attribute ,
128-             'key_value' : self .id_value ,
133+             # must be a "JSON" string 
134+             'key_value' : '"{}"' .format (self .id_value ),
129135            'attributes' : attributes ,
130136        }
131137        if  attribute_path  is  not None :
@@ -142,7 +148,8 @@ def update(self, attributes, attribute_path=None):
142148        kwargs  =  {
143149            'type_name' : self .schema_name ,
144150            'key_attribute' : self .id_attribute ,
145-             'key_value' : self .id_value ,
151+             # must be a "JSON" string 
152+             'key_value' : '"{}"' .format (self .id_value ),
146153            'attributes' : attributes ,
147154        }
148155        if  attribute_path  is  not None :
0 commit comments