dal.py: Table class: validate_and_update_or_insert method created, and minor changes in validate_and_update
This commit is contained in:
1 parent
0b7f663d43
commit
3a5a34da0a
1 file changed
+5
-1
+5
-1
@@ -9205,7 +9205,11 @@ class Table(object):
|
||||
|
||||
if record:
|
||||
response = self.validate_and_update(_key, **fields)
|
||||
response.id = {'id': self(**fields).id}
|
||||
# Now primary key must be returned
|
||||
primary_keys = {}
|
||||
for key in self._primarykey:
|
||||
primary_keys[key] = getattr(record, key)
|
||||
response.id = primary_keys
|
||||
else:
|
||||
response = self.validate_and_insert(**fields)
|
||||
return response
|
||||
|
||||
Reference in new issue
Block a user