獲取信息:
# 指定數(shù)據(jù)庫
R_profile.objects.using('db4').get(project_id=1, user_id =1)
# 不指定數(shù)據(jù)庫
R_profile.objects.get(project_id=1, user_id =1)
# 根據(jù)條件更新sql信息
lg = Log.objects.get(project_id=1, user_id = 1)
lg.code =0
lg.save()
# 插入數(shù)據(jù)
lg = Log(project_id= 1, user_id = 1, code = 0)
lg.save((using='db4') # 用默認數(shù)據(jù)庫的話就括號是空