style: sort imports in compute, db and services modules

This commit is contained in:
Mark Paronyan committed 2026-10-02 12:43:26 +03:00
1 parent 38e9ddca09
commit b9cdac487c
42 files changed
+247 -256

No files matched your search

+7 -7
View File
@@ -15,18 +15,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .base import Base
from .acl import ACE
from .users import User, UserGroup
from .roles import Role
from .privileges import Privilege
from .api_keys import ApiKey
from .base import Base
from .computes import Compute
from .images import Image, ImageSyncJob
from .pools import Resource, ResourcePool
from .llm_model_configs import LLMModelConfig
from .api_keys import ApiKey
from .pools import Resource, ResourcePool
from .privileges import Privilege
from .roles import Role
from .templates import (
Template,
CloudTemplate,
DockerTemplate,
DynamipsTemplate,
@@ -34,7 +32,9 @@ from .templates import (
EthernetSwitchTemplate,
IOUTemplate,
QemuTemplate,
Template,
VirtualBoxTemplate,
VMwareTemplate,
VPCSTemplate,
)
from .users import User, UserGroup
+4 -4
View File
@@ -15,12 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Column, String, Boolean, ForeignKey, CheckConstraint
import logging
from sqlalchemy import Boolean, CheckConstraint, Column, ForeignKey, String
from sqlalchemy.orm import relationship
from .base import BaseTable, generate_uuid, GUID
import logging
from .base import GUID, BaseTable, generate_uuid
log = logging.getLogger(__name__)
+2 -2
View File
@@ -16,10 +16,10 @@
import uuid
from sqlalchemy import Column, String, Boolean, DateTime, ForeignKey, func
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, String, func
from sqlalchemy.orm import Mapped, mapped_column
from .base import BaseTable, GUID
from .base import GUID, BaseTable
class ApiKey(BaseTable):
+1 -1
View File
@@ -21,9 +21,9 @@ from typing import Optional
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 DeclarativeBase, Mapped, mapped_column
from sqlalchemy.types import CHAR, VARCHAR, TypeDecorator
class Base(DeclarativeBase):
+2 -2
View File
@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Column, String, Integer
from sqlalchemy import Column, Integer, String
from .base import BaseTable, GUID
from .base import GUID, BaseTable
class Compute(BaseTable):
+2 -3
View File
@@ -15,11 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Table, Column, String, ForeignKey, BigInteger, Integer, DateTime, JSON, Boolean
from sqlalchemy import JSON, BigInteger, Boolean, Column, DateTime, ForeignKey, Integer, String, Table
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import Base, BaseTable, GUID
from .base import GUID, Base, BaseTable
image_template_map = Table(
"image_template_map",
+4 -4
View File
@@ -15,12 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Column, Boolean, ForeignKey, CheckConstraint, Index, Integer, String, text, JSON
import logging
from sqlalchemy import JSON, Boolean, CheckConstraint, Column, ForeignKey, Index, Integer, String, text
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import BaseTable, generate_uuid, GUID
import logging
from .base import GUID, BaseTable, generate_uuid
log = logging.getLogger(__name__)
+3 -4
View File
@@ -15,14 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import uuid
from sqlalchemy import Table, Column, String, ForeignKey
from sqlalchemy import Column, ForeignKey, String, Table
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import Base, BaseTable, generate_uuid, GUID
import logging
from .base import GUID, Base, BaseTable, generate_uuid
log = logging.getLogger(__name__)
+4 -4
View File
@@ -15,12 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Table, Column, String, ForeignKey, event
import logging
from sqlalchemy import Column, ForeignKey, String, Table, event
from sqlalchemy.orm import relationship
from .base import Base, BaseTable, generate_uuid, GUID
import logging
from .base import GUID, Base, BaseTable, generate_uuid
log = logging.getLogger(__name__)
+3 -4
View File
@@ -15,16 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import uuid
from sqlalchemy import Column, String, Boolean, event
from sqlalchemy import Boolean, Column, String, event
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import BaseTable, generate_uuid, GUID
from .base import GUID, BaseTable, generate_uuid
from .privileges import privilege_role_map
import logging
log = logging.getLogger(__name__)
+2 -2
View File
@@ -19,10 +19,10 @@
import uuid
from typing import Optional
from sqlalchemy import Boolean, Column, String, Integer, Float, ForeignKey, JSON
from sqlalchemy import JSON, Boolean, Column, Float, ForeignKey, Integer, String
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import BaseTable, generate_uuid, GUID
from .base import GUID, BaseTable, generate_uuid
from .images import image_template_map
+4 -5
View File
@@ -15,19 +15,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import uuid
from datetime import datetime
from typing import Optional
from sqlalchemy import Table, Boolean, Column, Integer, String, DateTime, ForeignKey, event
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String, Table, event
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import Base, BaseTable, generate_uuid, GUID
from gns3server.config import Config
from gns3server.services import auth_service
import logging
import uuid
from .base import GUID, Base, BaseTable, generate_uuid
log = logging.getLogger(__name__)