snipt/accounts/views.py

20 lines
425 B
Python
Raw Permalink Normal View History

2016-03-21 11:48:44 -07:00
from annoying.decorators import render_to
from django.contrib.auth.decorators import login_required
2016-11-01 11:21:39 -07:00
from django.http import HttpResponseRedirect
from snipts.models import Snipt
2013-10-19 17:48:00 -07:00
@login_required
2019-01-23 15:52:55 -08:00
@render_to("account.html")
def account(request):
return {}
2013-10-19 17:48:00 -07:00
@login_required
2019-01-23 15:52:55 -08:00
@render_to("stats.html")
def stats(request):
2019-01-23 15:52:55 -08:00
snipts = Snipt.objects.filter(user=request.user).order_by("-views")
2019-01-23 15:52:55 -08:00
return {"snipts": snipts}