mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(fastapi): include all models in aurweb.models package
This gives developers the ability to import models without importing them directly from their module: from aurweb.models import Ban, AccountType This provides more conciseness: from aurweb import models def some_func(ban: models.Ban): pass def some_other_func(user: models.User): pass This more aligns with a Django-style of core model bases. NOTE: Docker images must be rebuilt with this change, as setup.cfg has changed. Old Docker images will cause flake8 violation reports. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
c572a97d1c
commit
6d59a97955
2 changed files with 32 additions and 1 deletions
|
@ -1 +1,31 @@
|
||||||
# aurweb SQLAlchemy ORM model collection.
|
""" Collection of all aurweb SQLAlchemy declarative models. """
|
||||||
|
from .accepted_term import AcceptedTerm
|
||||||
|
from .account_type import AccountType
|
||||||
|
from .api_rate_limit import ApiRateLimit
|
||||||
|
from .ban import Ban
|
||||||
|
from .dependency_type import DependencyType
|
||||||
|
from .group import Group
|
||||||
|
from .license import License
|
||||||
|
from .official_provider import OfficialProvider
|
||||||
|
from .package import Package
|
||||||
|
from .package_base import PackageBase
|
||||||
|
from .package_blacklist import PackageBlacklist
|
||||||
|
from .package_comaintainer import PackageComaintainer
|
||||||
|
from .package_comment import PackageComment
|
||||||
|
from .package_dependency import PackageDependency
|
||||||
|
from .package_group import PackageGroup
|
||||||
|
from .package_keyword import PackageKeyword
|
||||||
|
from .package_license import PackageLicense
|
||||||
|
from .package_notification import PackageNotification
|
||||||
|
from .package_relation import PackageRelation
|
||||||
|
from .package_request import PackageRequest
|
||||||
|
from .package_source import PackageSource
|
||||||
|
from .package_vote import PackageVote
|
||||||
|
from .relation_type import RelationType
|
||||||
|
from .request_type import RequestType
|
||||||
|
from .session import Session
|
||||||
|
from .ssh_pub_key import SSHPubKey
|
||||||
|
from .term import Term
|
||||||
|
from .tu_vote import TUVote
|
||||||
|
from .tu_voteinfo import TUVoteInfo
|
||||||
|
from .user import User
|
||||||
|
|
|
@ -32,6 +32,7 @@ per-file-ignores =
|
||||||
aurweb/routers/accounts.py:C901
|
aurweb/routers/accounts.py:C901
|
||||||
test/test_ssh_pub_key.py:E501
|
test/test_ssh_pub_key.py:E501
|
||||||
aurweb/routers/packages.py:E741
|
aurweb/routers/packages.py:E741
|
||||||
|
aurweb/models/__init__.py:F401
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
line_length = 127
|
line_length = 127
|
||||||
|
|
Loading…
Add table
Reference in a new issue