lint wip
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from graphql.error import GraphQLError
|
||||
|
||||
|
||||
# TODO: remove traceback from logs for defined exceptions
|
||||
|
||||
|
||||
class BaseHttpException(GraphQLError):
|
||||
code = 500
|
||||
message = "500 Server error"
|
||||
|
10
base/orm.py
10
base/orm.py
@@ -1,15 +1,13 @@
|
||||
from typing import TypeVar, Any, Dict, Generic, Callable
|
||||
from typing import Any, Callable, Dict, Generic, TypeVar
|
||||
|
||||
from sqlalchemy import create_engine, Column, Integer
|
||||
from sqlalchemy import Column, Integer, create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.sql.schema import Table
|
||||
|
||||
from settings import DB_URL
|
||||
|
||||
engine = create_engine(
|
||||
DB_URL, echo=False, pool_size=10, max_overflow=20
|
||||
)
|
||||
engine = create_engine(DB_URL, echo=False, pool_size=10, max_overflow=20)
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
@@ -47,7 +45,7 @@ class Base(declarative_base()):
|
||||
|
||||
def update(self, input):
|
||||
column_names = self.__table__.columns.keys()
|
||||
for (name, value) in input.items():
|
||||
for name, value in input.items():
|
||||
if name in column_names:
|
||||
setattr(self, name, value)
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
from aioredis import from_url
|
||||
from asyncio import sleep
|
||||
|
||||
from aioredis import from_url
|
||||
|
||||
from settings import REDIS_URL
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user