Homeseite mit sortierung was am liebsten getrunken wurde
This commit is contained in:
parent
769619310e
commit
7e5474ff16
|
@ -1,6 +1,7 @@
|
|||
WTFs:
|
||||
[x] Kontostand beim kaufen auch veraendern..
|
||||
[x] Einkaufshistory basteln
|
||||
[ ] Beim einkaufen von Objekten ohne Deposit sollten es nicht moeglich sein diese "with Deposit" zu kaufen
|
||||
|
||||
Noch zu tun:
|
||||
[ ] "Home" mit inhalt fuellen
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
No content here.
|
||||
{% if usersMost %}
|
||||
Am oeftesten hatten alle: <br /> <br />
|
||||
{% for buyable in usersMost %}
|
||||
{{ buyable.buyable__name }} ( {{ buyable.num_buys }} mal) <br />
|
||||
{% endfor %}
|
||||
<br />
|
||||
{% else %}
|
||||
{{ error }}
|
||||
Nix gekauft?
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.db.models import Count
|
||||
|
||||
from buyable.models import Purchase, Buyable
|
||||
|
||||
@login_required
|
||||
def startpage(request):
|
||||
return render_to_response("main/startpage.html", {}, RequestContext(request))
|
||||
usersMost = Purchase.objects.values('buyable__name').annotate(num_buys=Count('buyable')).order_by('-num_buys')
|
||||
return render_to_response("main/startpage.html", {'usersMost': usersMost}, RequestContext(request))
|
||||
|
||||
def register(request):
|
||||
return render_to_response("registration/register.html", RequestContext(request))
|
||||
|
|
Loading…
Reference in New Issue