models: Extract db into own file to prevent circular dependency

master
Felix Stupp 11 months ago
parent c2c7cd69ed
commit 2e81fc188f
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -8,6 +8,10 @@ from .custom_types import (
SafeStr, SafeStr,
) )
from .db import (
db,
)
from .entities import ( from .entities import (
CollectionStats, CollectionStats,
CollectionUriMapping, CollectionUriMapping,
@ -20,7 +24,6 @@ from .entities import (
Tag, Tag,
Tagable, Tagable,
TagKey, TagKey,
db,
) )
from .predefined_tags import ( from .predefined_tags import (

@ -0,0 +1,4 @@
from pony import orm
db = orm.Database()

@ -18,13 +18,13 @@ import requests
from pony import orm from pony import orm
from .custom_types import Query from .custom_types import Query
from .db import db
from .thumbnails import THUMBNAIL_ALLOWED_TYPES, THUMBNAIL_HEADERS from .thumbnails import THUMBNAIL_ALLOWED_TYPES, THUMBNAIL_HEADERS
from .extras import ( from .extras import (
UriHolder, UriHolder,
) )
from ..preferences.tag_protocol import TagableProto, TagProto from ..preferences.tag_protocol import TagableProto, TagProto
db = orm.Database()
T = TypeVar("T") T = TypeVar("T")

Loading…
Cancel
Save