Skip to content

Django ORM does not work well with IDOM #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Archmonger opened this issue Jun 26, 2022 · 0 comments · Fixed by #86
Closed

Django ORM does not work well with IDOM #79

Archmonger opened this issue Jun 26, 2022 · 0 comments · Fixed by #86

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Jun 26, 2022

Current Situation

Currently, the Django ORM will shoot out a SynchronousOnlyOperation if used within a IDOM component. This is caused by Django's current limitation surrounding mixed sync-async contexts.

Proposed Actions

Choose one of the following

  1. Create a React-style hooks to perform ORM CRUD
  2. Set DJANGO_ALLOW_ASYNC_UNSAFE when within a component rendering context.
  3. Create a hook that utilizes database_sync_to_async that can perform ORM queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant