예제 #1
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     trx = manage_transactions(
         self.request.session.get('transactions').copy(),
         **(self.request.GET.dict()),
     )
     context['title'] = 'Transactions Grouped'
     context['transactions'] = trx
     self.request.session['export_transactions'] = trx
     return context
예제 #2
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     trx = manage_transactions(
         self.request.session.get('transactions').copy(),
         **self.request.GET.dict(),
     )[TRANSACTIONS_COLUMNS]
     self.request.session['export_transactions'] = trx
     context['title'] = 'Transactions'
     context['transactions'] = trx.head(500)
     return context
예제 #3
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     trx = manage_transactions(
         self.request.session.get('transactions').copy(),
         **(self.request.GET.dict()),
     )
     ref_currency = 'local_currency' if 'local_currency' in trx.columns else 'currency'
     context['title'] = 'Top Events'
     context['top_event_ars'] = get_top_events(
         trx[trx[ref_currency] == ARS], )[:10][
             TOP_EVENTS_COLUMNS['columns']].rename(
                 columns=TOP_EVENTS_COLUMNS['labels'])
     context['top_event_brl'] = get_top_events(
         trx[trx[ref_currency] == BRL], )[:10][
             TOP_EVENTS_COLUMNS['columns']].rename(
                 columns=TOP_EVENTS_COLUMNS['labels'])
     return context
예제 #4
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     trx = manage_transactions(
         self.request.session.get('transactions').copy(),
         **(self.request.GET.dict()),
     )
     ref_currency = 'local_currency' if 'local_currency' in trx.columns else 'currency'
     context['title'] = 'Top Organizers Refunds'
     context['top_ars'] = \
         get_top_organizers_refunds(
             trx[trx[ref_currency] == ARS],
         )[:10][TOP_ORGANIZERS_REFUNDS['columns']].rename(columns=TOP_ORGANIZERS_REFUNDS['labels'])
     context['top_brl'] = \
         get_top_organizers_refunds(
             trx[trx[ref_currency] == BRL],
         )[:10][TOP_ORGANIZERS_REFUNDS['columns']].rename(columns=TOP_ORGANIZERS_REFUNDS['labels'])
     return context