mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-11 01:27:29 +08:00
update: r
This commit is contained in:
parent
433ecf39ee
commit
d1795f0ca8
2
main.py
2
main.py
@ -1,7 +1,5 @@
|
|||||||
from src.liteyuki import *
|
from src.liteyuki import *
|
||||||
from pymongo import MongoClient
|
|
||||||
|
|
||||||
a = MongoClient("mongodb://localhost:27017/")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
liteyuki = Liteyuki()
|
liteyuki = Liteyuki()
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
nonebot2[fastapi]
|
nonebot2[fastapi]
|
||||||
keyvalue-sqlite=1.0.7
|
nonebot-adapter-onebot==2.4.1
|
||||||
motor=3.3.2
|
|
@ -1,12 +1,9 @@
|
|||||||
import json
|
import json
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import types
|
import types
|
||||||
import typing
|
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from copy import deepcopy
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
BaseIterable = list | tuple | set | dict
|
BaseIterable = list | tuple | set | dict
|
||||||
@ -291,7 +288,8 @@ class SqliteORMAdapter(BaseORMAdapter):
|
|||||||
new_d = {}
|
new_d = {}
|
||||||
for k, v in d.items():
|
for k, v in d.items():
|
||||||
if k.startswith(self.FOREIGNID):
|
if k.startswith(self.FOREIGNID):
|
||||||
new_d[k.replace(self.FOREIGNID, '')] = load(dict(self.cursor.execute(f'SELECT * FROM {v.split(":")[1]} WHERE id = ?', (v.split(":")[2],)).fetchone()))
|
new_d[k.replace(self.FOREIGNID, '')] = load(
|
||||||
|
dict(self.cursor.execute(f'SELECT * FROM {v.split(":")[1]} WHERE id = ?', (v.split(":")[2],)).fetchone()))
|
||||||
elif k.startswith(self.JSON):
|
elif k.startswith(self.JSON):
|
||||||
new_d[k.replace(self.JSON, '')] = load(json.loads(v))
|
new_d[k.replace(self.JSON, '')] = load(json.loads(v))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user