from django.shortcuts import render
from rakka.utils import rerender
from . import models
from main.models import Update
@rerender
def nerdshope():
accounts=models.BankAccount.objects.all()
sums={curr:sum([n.balance for n in filter(lambda x:x.currency==curr,accounts)]) for curr in set(map(lambda x:x.currency,accounts))}
moneyblob='\n
'.join([f'{k}: {v}' for k,v in sums.items()])
moneyblob='Current monetary state: '
return {'title':"Nerds' Hope",'content':"Store stuff. TODOing. Will include inventory and budget. FB
\nAddress is 21 Kensington St, Glenorchy
\nThe store isn't open when other events happen on Fridays, usually the last Friday of each month. Additionally, on the first and third weeks of each month the store will move around the back (through the gate) around 18:00 to make room for a youth group. If in doubt, ask the youth group for directions.
\nFull list of dates:\n- 16th Sept - round the back later
\n- 30th Sept - closed
\n- 21st Oct - round the back later
\n- 28th Oct - closed
\n- 4th Nov - round the back later
\n- 18th Nov - round the back later
\n- 25th Nov - closed
\n- 2nd Dec - round the back later
\n- 16th Dec - round the back later
\n- 30th Dec - maybe party
\n"+moneyblob,'date':Update.objects.get_or_create(page='nh_main')[0].date}
@rerender
def budget():
pass