我的数据没有保存在数据库中。
这是我的views.py文件
def rr_reply(request):
cc_user = request.user.id
conversation_id = request.GET.get('conversation_id','')
b_id = request.GET.get('b_id','')
if request.method == 'POST':
form = CcReply(request.POST)
if form.is_valid():
date_time = datetime.datetime.now()
reply = form.cleaned_data['reply']
queries = WebQuery.objects.using('launchg').filter(conversation_id = conversation_id)
for query in queries:
q_id = query.query_id
cc_chat_data_obj = CcChatData(conversation_id = conversation_id , reply_from = request.user.id ,
b_id = b_id, q_id = q_id)
web_reply_obj = WebReply(query_id = q_id, conversation_id = conversation_id , b_id = b_id,
u_query = reply , date_time = date_time.strftime("%Y-%m-%d %H:%M:%S"),diff = 0)
cc_chat_data_obj.save()
web_reply_obj.save()
else:
form = CcReply()