chore(storage): migrate to beanie2
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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():
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user