I have a Django project with two databases, each has a game model and a language model that are connected with Many2Many relationships. When saving each object with: game.save(using=db) I’m able to save to the desired database, but when I attempt to add the related field: game.add(language) It doesn’t work for the second database. Any idea why? *from research I think it might be a problem in my routers.py but I took it from the Django documentation..
Django adding related field with multiple databases
24 Views Asked by Daniel Bele At
0
There are 0 best solutions below
Related Questions in DJANGO
- Django Admin Panel and Sub URLs Returning 404 Error on Deployment
- How to return HTTP Get request response from models class in Django project
- Issue with Quantity Increment in Django E-commerce Cart
- Can't install Pipenv on Windows
- use dict from python in django html template and also in js
- 'pyodbc.Cursor' object has no attribute 'callproc', mssql with django
- Django socketio process
- Root path analogue in uWSGI as in Uvicorn
- Django - ModuleNotFoundError: No module named 'backend'
- Does Python being a loosely typed programming language make it less secure?
- sorl-thumbnail adds a background color when padding is used
- Can't connect to local postgresql server from my docker container
- Why ProductHunt api dont work with Python?
- why i have to put extra space in before write option selected because it show error if i don't ' option:selected'
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
Related Questions in MANY-TO-MANY
- SQLAlchemy Many-to-Many Relationship: UNIQUE constraint failed
- Spring does not map set of roles
- Laravel Eloquent Relationships with Many to Many
- Trying to understand many-to-many relationship in flask
- Many to many relationship with the same table
- Simultaneously add and remove multiple many-to-many relation entries using TypeORM
- How to get data from many-to-many relationship in SQLModel
- Doctrine - delete self-many-to-many
- Pytest --no-migrations throws "relation already exists"
- Tableau - join and compare 3 tables many to many
- Can I fetch the corresponding value of an aggregate from another table in a many to many database using group by in MySQL?
- Nestjs: module structure and many-to-many relationships
- Finding items that match multiple LIKE keywords
- How to define many-to-many relationship using Entity Framework for MongoDB
- LINQ: Select values from two columns based on one of the column value
Related Questions in MULTIPLE-DATABASES
- Finbuckel per tenant authenication using JWT
- crystal report - uses subreport, has to get data from 2 different database in one command
- Create from multiple data frames complex customized figure on ggplot2
- Relationships from multiple non-unique data sources in Power BI
- Deployment On Heroku failing -multiole database
- How to use two database one for development and other production in the same application django
- Using Rails 6 Multi-database with audited gem
- Connecting Multiple Databases in Dbt Cloud
- Rails App: using multiple versions table in paper_trail
- Laravel Multi mysql DBs - login worked fine on Login controller - but after login Auth::user() showing data from 1st DB instead of login one
- Changing the database name dynamically over the same connection does not work
- Could not autowire. Qualified bean must be of 'EntityManagerFactory' type
- Nested loop with using multiple data sets
- How can I configure my Django application to use separate databases for different superusers?
- Django adding related field with multiple databases
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?