예제 #1
0
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()})
예제 #2
0
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()})
예제 #3
0
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()})