[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
committed by
Mawoka
parent
800711b8b6
commit
518a9d72f9
+12
-60
@@ -45,11 +45,7 @@ class User(ormar.Model):
|
||||
totp_secret: str = ormar.String(max_length=32, min_length=32, nullable=True, default=None)
|
||||
storage_used: int = ormar.BigInteger(nullable=False, default=0, minimum=0)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="users"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="users")
|
||||
|
||||
|
||||
class FidoCredentials(ormar.Model):
|
||||
@@ -59,22 +55,14 @@ class FidoCredentials(ormar.Model):
|
||||
sign_count: int = ormar.Integer()
|
||||
user: Optional[User] = ormar.ForeignKey(User, ondelete=ReferentialAction.CASCADE)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="fido_credentials"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="fido_credentials")
|
||||
|
||||
|
||||
class ApiKey(ormar.Model):
|
||||
key: str = ormar.String(max_length=48, min_length=48, primary_key=True)
|
||||
user: Optional[User] = ormar.ForeignKey(User, ondelete=ReferentialAction.CASCADE)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="api_keys"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="api_keys")
|
||||
|
||||
|
||||
class UserSession(ormar.Model):
|
||||
@@ -90,11 +78,7 @@ class UserSession(ormar.Model):
|
||||
user_agent: str = ormar.String(max_length=255, nullable=True)
|
||||
last_seen: datetime = ormar.DateTime(default=datetime.now())
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="user_sessions"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="user_sessions")
|
||||
|
||||
|
||||
class ABCDQuizAnswer(BaseModel):
|
||||
@@ -187,21 +171,13 @@ class Quiz(ormar.Model):
|
||||
views: int = ormar.Integer(nullable=False, default=0, server_default="0")
|
||||
mod_rating: int | None = ormar.SmallInteger(nullable=True)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
tablename = "quiz",
|
||||
metadata = metadata,
|
||||
database = database
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(tablename="quiz", metadata=metadata, database=database)
|
||||
|
||||
|
||||
class InstanceData(ormar.Model):
|
||||
instance_id: uuid.UUID = ormar.UUID(primary_key=True, default=uuid.uuid4(), nullable=False, unique=True)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
tablename = "instance_data",
|
||||
metadata = metadata,
|
||||
database = database
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(tablename="instance_data", metadata=metadata, database=database)
|
||||
|
||||
|
||||
class Token(BaseModel):
|
||||
@@ -310,11 +286,7 @@ class GameResults(ormar.Model):
|
||||
description: str = ormar.Text(nullable=False)
|
||||
questions: Json[list[QuizQuestion]] = ormar.JSON(nullable=False)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="game_results"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="game_results")
|
||||
|
||||
|
||||
class QuizTivityInput(BaseModel):
|
||||
@@ -329,11 +301,7 @@ class QuizTivity(ormar.Model):
|
||||
user: User | None = ormar.ForeignKey(User, ondelete=ReferentialAction.CASCADE)
|
||||
pages: list[QuizTivityPage] = ormar.JSON(nullable=False)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
tablename = "quiztivitys",
|
||||
metadata = metadata,
|
||||
database = database
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(tablename="quiztivitys", metadata=metadata, database=database)
|
||||
|
||||
|
||||
class QuizTivityShare(ormar.Model):
|
||||
@@ -343,11 +311,7 @@ class QuizTivityShare(ormar.Model):
|
||||
quiztivity: QuizTivity | None = ormar.ForeignKey(QuizTivity, ondelete=ReferentialAction.CASCADE)
|
||||
user: User | None = ormar.ForeignKey(User, ondelete=ReferentialAction.CASCADE)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="quiztivityshares"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="quiztivityshares")
|
||||
|
||||
|
||||
class OnlyId(BaseModel):
|
||||
@@ -392,11 +356,7 @@ class StorageItem(ormar.Model):
|
||||
server: str | None = ormar.Text(default=None, nullable=True)
|
||||
imported: bool = ormar.Boolean(default=False, nullable=True)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="storage_items"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="storage_items")
|
||||
|
||||
|
||||
class PublicStorageItem(BaseModel):
|
||||
@@ -480,11 +440,7 @@ class Controller(ormar.Model):
|
||||
os_version: str | None = ormar.Text(nullable=True)
|
||||
wanted_os_version: str = ormar.Text(nullable=True, default=None)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
tablename = "controller",
|
||||
metadata = metadata,
|
||||
database = database
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(tablename="controller", metadata=metadata, database=database)
|
||||
|
||||
|
||||
class Rating(ormar.Model):
|
||||
@@ -494,8 +450,4 @@ class Rating(ormar.Model):
|
||||
created_at: datetime = ormar.DateTime(nullable=False, server_default=func.now())
|
||||
quiz: uuid.UUID | Quiz = ormar.ForeignKey(Quiz)
|
||||
|
||||
ormar_config = ormar.OrmarConfig(
|
||||
database=database,
|
||||
metadata=metadata,
|
||||
tablename="rating"
|
||||
)
|
||||
ormar_config = ormar.OrmarConfig(database=database, metadata=metadata, tablename="rating")
|
||||
|
||||
Reference in New Issue
Block a user