chore(storage): migrate to beanie2

This commit is contained in:
h
2025-07-21 01:39:10 +03:00
parent c5e4f3206b
commit bfa23d4db9
4 changed files with 319 additions and 333 deletions

View File

@@ -8,7 +8,7 @@ authors = [
requires-python = ">=3.13" requires-python = ">=3.13"
dependencies = [ dependencies = [
"aiogram>=3.20.0.post0", "aiogram>=3.20.0.post0",
"beanie>=1.30.0", "beanie>=2.0.0",
"dishka>=1.6.0", "dishka>=1.6.0",
"google-genai>=1.23.0", "google-genai>=1.23.0",
"pydantic-settings>=2.10.1", "pydantic-settings>=2.10.1",

View File

@@ -1,9 +1,9 @@
from beanie import init_beanie from beanie import init_beanie
from motor.motor_asyncio import AsyncIOMotorClient from pymongo import AsyncMongoClient
from utils.env import env from utils.env import env
client = AsyncIOMotorClient(env.db.connection_url) client = AsyncMongoClient(env.db.connection_url)
async def init_db(): async def init_db():

View File

@@ -22,9 +22,6 @@ class DynamicConfig(DynamicConfigBase, Document):
class Settings: class Settings:
name = "config" name = "config"
async def save(self): # noqa
await super().save() # noqa
@classmethod @classmethod
async def get_or_create(cls): async def get_or_create(cls):
config = await cls.find_one() config = await cls.find_one()

643
uv.lock generated

File diff suppressed because it is too large Load Diff