2016-10-10 75 views
0

我在setting.py中有2个不同的数据库。 要我用以下语句,并工作正常选择操作:django-orm:如何将元素插入到特定数据库的表中

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

但我怎么能传递价值数据库中插入同一个数据库中的一个表项。

我尝试这样做,但这似乎并不奏效:

row_to_be_added = TableName(pr=pr, case=case, comments=comments).using('bugzilla').save() 

任何人都可以请帮我在这里。

回答

0

docs

row_to_be_added = TableName(pr=pr, case=case, comments=comments).save(using='bugzilla') 
相关问题