减去日期并找到余额天数并检查它是否大于零。
view.py
fee_start_date = form.cleaned_data['fee_start_date'] '''1994-01-01 format'''
fee_end_date = form.cleaned_data['fee_end_date'] '''1994-01-01 format'''
def date_check(start_date,end_date):
rem = datetime.timedelta(start_date) - datetime.timedelta(end_date)
if rem > 0:
return False
else:
return True