alchemy flush and save functions updated
This commit is contained in:
@@ -24,11 +24,11 @@ class FilterAttributes:
|
||||
FilterModel = ListOptions
|
||||
|
||||
def flush(self):
|
||||
from fastapi import status
|
||||
"""Flush the current session."""
|
||||
try:
|
||||
self.__session__.add(self)
|
||||
self.__session__.flush()
|
||||
return self
|
||||
except SQLAlchemyError as e:
|
||||
self.raise_http_exception(
|
||||
status_code="HTTP_400_BAD_REQUEST",
|
||||
@@ -47,6 +47,7 @@ class FilterAttributes:
|
||||
"""Saves the updated model to the current entity db."""
|
||||
try:
|
||||
cls.__session__.commit()
|
||||
return cls
|
||||
except SQLAlchemyError as e:
|
||||
cls.raise_http_exception(
|
||||
status_code="HTTP_400_BAD_REQUEST",
|
||||
|
||||
Reference in New Issue
Block a user