mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
fix(typing): resolve mypy errors in db models
This commit is contained in:
3 files changed
+3
-12
No files matched your search
@@ -29,7 +29,7 @@ class ACE(BaseTable):
|
||||
__tablename__ = "acl"
|
||||
|
||||
ace_id = Column(GUID, primary_key=True, default=generate_uuid)
|
||||
ace_type: str = Column(String)
|
||||
ace_type = Column(String)
|
||||
path = Column(String)
|
||||
propagate = Column(Boolean, default=True)
|
||||
allowed = Column(Boolean, default=True)
|
||||
|
||||
@@ -21,11 +21,10 @@ from fastapi.encoders import jsonable_encoder
|
||||
from sqlalchemy import Column, DateTime, func, inspect
|
||||
from sqlalchemy.types import TypeDecorator, CHAR, VARCHAR
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.orm import as_declarative
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
|
||||
@as_declarative()
|
||||
class Base:
|
||||
class Base(DeclarativeBase):
|
||||
def asdict(self):
|
||||
|
||||
return {c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs}
|
||||
|
||||
Reference in new issue
Block a user