我如何同时做这两件事(同一个实例)?
entity = payment_detail( payment_status='Paid', payment_date=datetime.datetime.now())
a=payment_detail.objects.get(job_post_id=num)
答案 0 :(得分:2)
这是你的意思吗?
a=payment_detail.objects.get(job_post_id=num)
a.payment_status = 'Paid'
a.payment_date = datetime.datetime.now()
a.save()