def invoice_display(request,counter): invoice_key = 'invoice:%s' % counter invoice = redis_helpers.get_entity(redis_key=invoice_key) return direct_to_template(request, 'orders/app.html', {'app':APP, 'entity':invoice, 'entity_type':'Invoice', 'institution':INSTITUTION, 'date':datetime.today()})
def pcard_display(request,counter): """ Displays a single pcard display :param request: Web request :param request: counter """ pcard_key = 'pcard:%s' % counter pcard = redis_helpers.get_entity(redis_key=pcard_key) return direct_to_template(request, 'orders/app.html', {'app':APP, 'entity':pcard, 'entity_type':'PCARD', 'institution':INSTITUTION, 'date':datetime.today()})
def default(request): """ default is the standard view for the orders app :param request: Web request """ entity_key = redis_helpers.redis_server.zrange('orders',-1,-1) entity_type = entity_key[0].split(":")[0].upper() entity = redis_helpers.get_entity(redis_key=entity_key[0]) return direct_to_template(request, 'orders/app.html', {'app':APP, 'entity':entity, 'entity_type':entity_type, 'institution':INSTITUTION, 'date':datetime.today()})