objects: don't allow to update create_at and update_at

Those fields are managed by sqlalchemy layer, we should not allow to
update them via OVO.

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: Ica8f50c45eb482e7a48d9b5b2b997cf9133b3100
This commit is contained in:
Ihar Hrachyshka
2017-05-22 19:07:43 -07:00
parent 80e8304bfe
commit 8c907905b0

View File

@@ -25,3 +25,5 @@ def add_standard_attributes(cls):
# its own instance of list
cls.fields = cls.fields.copy()
cls.fields.update(STANDARD_ATTRIBUTES)
# those fields are updated by sqlalchemy itself
cls.fields_no_update += ('created_at', 'updated_at')