Skip to content

Instantly share code, notes, and snippets.

@jjangdm
Created December 13, 2012 19:13
Show Gist options
  • Save jjangdm/4278884 to your computer and use it in GitHub Desktop.
Save jjangdm/4278884 to your computer and use it in GitHub Desktop.
1. <input type="date" name="date" />
2. views.py
def search(request):
today = datetime.datetime.now()
if 'date' in request.POST and request.POST['date']:
date = request.POST['date']
date_sallary = Sallary.objects.filter(date=today.date)
date_asset = Asset.objects.filter(date=today.date)
...
date_sallary_sum = sum(Sallary.objects.filter(date=today.date).values_list('money', flat='true'))
date_asset_sum = sum(Asset.objects.filter(date=today.date).values_list('money', flat='true'))
...
return render_to_response("search_day.html", dict(...))
else:
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment