update acl

This commit is contained in:
pycook
2019-11-15 16:54:56 +08:00
parent 3beb2706dc
commit 332659c1d5
5 changed files with 57 additions and 11 deletions

View File

@@ -10,9 +10,9 @@ from api.lib.exception import CommitException
class FormatMixin(object):
def to_dict(self):
return dict([(k.name,
getattr(self, k.name) if not isinstance(getattr(self, k.name), datetime.datetime) else getattr(
self, k.name).strftime('%Y-%m-%d %H:%M:%S')) for k in getattr(self, "__table__").columns])
return dict([(k.name, isinstance(getattr(self, k.name), datetime.datetime) and
getattr(self, k.name).strftime('%Y-%m-%d %H:%M:%S')) or
getattr(self, k.name) for k in getattr(self, "__table__").columns])
@classmethod
def get_columns(cls):