我的代码是:
In model:
claimed_date = models.DateField(null=True, blank=True)
In view:
claim_date = request.POST.get('date_totclaimfee','')
显示错误:
[U"''值具有无效的日期格式。它必须是YYYY-MM-DD格式。"]
All fields in views.py:
shoes_date = request.POST.get('date_shoesfee','')
vvn_receipt = request.POST.get('bill_vvnfee','')
vvn_fees = request.POST.get(str(c)+'c_vvnfee','')
vvn_date = request.POST.get('date_vvnfee',''))
mODEL.PY:
shoes_date = models.DateField(null=True, blank=True)
vvn_receipt = models.CharField(max_length=10,null=True,blank=True)
vvn_fees = models.IntegerField(null=True,blank=True,)
vvn_date = models.DateField(null=True, blank=True)
claimed_date = models.DateField(null=True, blank=True)
答案 0 :(得分:0)
尝试:
claim_date = request.POST.get('date_totclaimfee', None)