Remember if finver form is extended

This commit is contained in:
richard-dds
2018-10-19 14:49:50 -04:00
parent 5d2b976e5f
commit 22cbca5951
9 changed files with 64 additions and 55 deletions

View File

@@ -1,26 +1,14 @@
from sqlalchemy import event
from flask import g
import re
from atst.models.audit_event import AuditEvent
from atst.utils import camel_to_snake, getattr_path
ACTION_CREATE = "create"
ACTION_UPDATE = "update"
ACTION_DELETE = "delete"
def getattr_path(obj, path, default=None):
_obj = obj
for item in path.split("."):
_obj = getattr(_obj, item, default)
return _obj
def camel_to_snake(camel_cased):
s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", camel_cased)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
class AuditableMixin(object):
@staticmethod
def create_audit_event(connection, resource, action):