django-orm : How can I insert element to a table of a particular database
<p>I have 2 different database in setting.py. 
To do select operation I use following statement and is working fine:</p>

<pre><code>all_data = Bugs.objects.using('database_one').filter(reporter=user_id, bug_status='resolved', resolution__in=all_resolutions)[:2]
</code></pre>

<p>But how can I pass the database value to insert an entry in the table of same database.</p>

<p>I tried this but this doesn't seems to be working:</p>

<pre><code>row_to_be_added = TableName(pr=pr, case=case, comments=comments).using('bugzilla').save()
</code></pre>

<p>Can anyone please help me out here.</p>

<p>From <a href="https://docs.djangoproject.com/en/1.10/topics/db/multi-db/#selecting-a-database-for-save" rel="nofollow">docs</a>:</p>

<pre><code>row_to_be_added = TableName(pr=pr, case=case, comments=comments).save(using='bugzilla')
</code></pre>

python mysql django django-orm