refactor: improve code formatting and organization across multiple files
This commit is contained in:
@@ -17,11 +17,15 @@ class UserRepository(BaseRepository[User]):
|
||||
super().__init__(session)
|
||||
|
||||
def get_by_username(self, username: str) -> User | None:
|
||||
statement = sa.select(self.model).where(sa.func.lower(self.model.username) == username.lower())
|
||||
statement = sa.select(self.model).where(
|
||||
sa.func.lower(self.model.username) == username.lower()
|
||||
)
|
||||
return self.session.scalar(statement)
|
||||
|
||||
def list_recent(self, limit: int = 50) -> list[User]:
|
||||
statement = sa.select(self.model).order_by(self.model.created_at.desc()).limit(limit)
|
||||
statement = (
|
||||
sa.select(self.model).order_by(self.model.created_at.desc()).limit(limit)
|
||||
)
|
||||
return list(self.session.scalars(statement))
|
||||
|
||||
def create(self, data: UserCreate) -> User:
|
||||
|
||||
Reference in New Issue
Block a user