Comments (3)
That raise this error:
Process SpawnProcess-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/uvicorn/config.py", line 458, in load
self.loaded_app = import_from_string(self.app)
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/./app/main.py", line 25, in <module>
from app.routers import dependency
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/./app/routers/dependency.py", line 17, in <module>
from app.db.session import AsyncSessionLocal
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/./app/db/session.py", line 17, in <module>
AsyncSessionLocal = mptt_sessionmaker(sessionmaker(
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/./app/db/mptt/events.py", line 567, in register_factory
event.listen(sessionmaker, 'after_flush_postexec',
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/sqlalchemy/event/api.py", line 115, in listen
_event_key(target, identifier, fn).listen(*args, **kw)
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/sqlalchemy/event/registry.py", line 232, in listen
self.dispatch_target.dispatch._listen(self, *args, **kw)
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/events.py", line 44, in _listen
cls._no_async_engine_events()
File "/media/vip/FE94893A9488F685/projects/akat_market_platform/src/version_2/.venv/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/events.py", line 37, in _no_async_engine_events
raise NotImplementedError(
NotImplementedError: asynchronous events are not implemented at this time. Apply synchronous listeners to the AsyncSession.sync_session.
from sqlalchemy_mptt.
Somethind need to do when register listener:
~/sqlalchemy_mptt/events.py - 530 line
def register_factory(self, sessionmaker):
"""
Registers this TreesManager instance to respond on
`after_flush_postexec` events on the given session or session factory.
This method returns the original argument, so that it can be used by
wrapping an already exisiting instance:
.. code-block:: python
:linenos:
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, mapper
from sqlalchemy_mptt.mixins import BaseNestedSets
engine = create_engine('...')
trees_manager = TreesManager(BaseNestedSets)
trees_manager.register_mapper(mapper)
Session = tree_manager.register_factory(
sessionmaker(bind=engine)
)
A reference to this method, bound to a default instance of this class
and already registered to a mapper, is importable directly from
`sqlalchemy_mptt`:
.. code-block:: python
:linenos:
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy_mptt import mptt_sessionmaker
engine = create_engine('...')
Session = mptt_sessionmaker(sessionmaker(bind=engine))
"""
event.listen(sessionmaker, 'after_flush_postexec',
self.after_flush_postexec)
return sessionmaker
from sqlalchemy_mptt.
Please help how to solve this problem?
from sqlalchemy_mptt.
Related Issues (20)
- Add a method get_drilldown_branches
- Incompatibility with Django MPTT: level value for root node HOT 4
- IntegrityError on attempt to initalize the tree HOT 9
- Compatibility with joined-table inheritance HOT 3
- Feature Request: Implement Child and sibling methods HOT 5
- linear structure HOT 2
- How to apply soft-delete for a node deletion?
- move_after moves node too far right HOT 1
- Moving node to leftmost position doesn't work HOT 4
- Dynamic query HOT 8
- Updating nodes without an existing parent does not work
- null value in column \"lft\" violates not-null constraint
- drilldown_tree as a list
- drilldown_tree as a list HOT 1
- The problem with duplicate nodes in same tree
- A problem when I insert the root HOT 7
- rebuild_tree performance issue - Takes too much time
- New release?
- Error when committing tree object column value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlalchemy_mptt.