lots of typing fixes
This commit is contained in:
parent
51f580a304
commit
3665c34961
43 changed files with 260 additions and 178 deletions
|
@ -4,7 +4,7 @@ from typing import Union, List, Optional, Any
|
|||
from app.extensions import db
|
||||
|
||||
|
||||
class AbstractConfiguration(db.Model):
|
||||
class AbstractConfiguration(db.Model): # type: ignore
|
||||
__abstract__ = True
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
|
@ -13,23 +13,23 @@ class AbstractConfiguration(db.Model):
|
|||
updated = db.Column(db.DateTime(), default=datetime.utcnow, nullable=False)
|
||||
destroyed = db.Column(db.DateTime(), nullable=True)
|
||||
|
||||
def destroy(self):
|
||||
def destroy(self) -> None:
|
||||
self.destroyed = datetime.utcnow()
|
||||
self.updated = datetime.utcnow()
|
||||
|
||||
@classmethod
|
||||
def csv_header(cls):
|
||||
def csv_header(cls) -> List[str]:
|
||||
return [
|
||||
"id", "description", "added", "updated", "destroyed"
|
||||
]
|
||||
|
||||
def csv_row(self):
|
||||
def csv_row(self) -> List[Any]:
|
||||
return [
|
||||
getattr(self, x) for x in self.csv_header()
|
||||
]
|
||||
|
||||
|
||||
class AbstractResource(db.Model):
|
||||
class AbstractResource(db.Model): # type: ignore
|
||||
__abstract__ = True
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue