def render(self, context): values = get_ISA_bestbuys() ret_val = [] for value in values : ret_val.append({'id' : int(value.id), 'title' : value.title}) context[self.context_var] = json.dumps(ret_val) return ''
def render(self, context): values = get_ISA_bestbuys() ret_val = [] for value in values: ret_val.append({'id': int(value.id), 'title': value.title}) context[self.context_var] = json.dumps(ret_val) return ''
def _get_isa_account_type_choices(): vals = get_ISA_bestbuys().values('id', 'title').order_by('title') retval = [('', 'Select account type')] try: for val in vals: retval.append([val['id'], val['title']]) except ProgrammingError: # Typically appears during deployment when model tables do not exist yet. pass retval.append(('unknown', 'I don\'t know')) return retval
def _get_isa_account_type_choices(): vals = get_ISA_bestbuys().values('id', 'title').order_by('title') retval = [('', 'Select account type')] try: for val in vals: retval.append([val['id'], val['title']]) except ProgrammingError: pass retval.append(('unknown', 'I don\'t know')) return retval
def render(self, context): isa_bestbuys = get_ISA_bestbuys() values = ProviderBestBuy.objects.filter(bestbuys__in=isa_bestbuys) retval = [] for value in values: provider = {'id': int(value.provider.id)} bestbuys = [] for bestbuy in value.bestbuys.filter(id__in=isa_bestbuys): bestbuys.append(int(bestbuy.id)) provider['bestbuys'] = bestbuys retval.append(provider) context[self.context_var] = json.dumps(retval) return ''
def render(self, context): isa_bestbuys = get_ISA_bestbuys() values = ProviderBestBuy.objects.filter(bestbuys__in= isa_bestbuys) retval = [] for value in values : provider = {'id': int(value.provider.id)} bestbuys = [] for bestbuy in value.bestbuys.filter(id__in = isa_bestbuys) : bestbuys.append(int(bestbuy.id)) provider['bestbuys'] = bestbuys retval.append(provider) context[self.context_var] = json.dumps(retval) return ''
def _get_reminder_queryset(is_isa, user): queryset = RatetrackerReminder.objects.filter(is_deleted=False, user=user) if is_isa: queryset = queryset.filter(account_type__pk__in=get_ISA_bestbuys()) return queryset
def _get_portfolio_queryset(is_isa, user): queryset = ProductPortfolio.objects.filter(is_deleted=False, user=user) if is_isa: queryset = queryset.filter(account_type__pk__in=get_ISA_bestbuys()) return queryset
def _get_provider_isa_best_buys(): return Provider.objects.filter( providerbestbuy__bestbuys__in=get_ISA_bestbuys()).distinct()
def _get_provider_isa_best_buys(): return Provider.objects.filter(providerbestbuy__bestbuys__in=get_ISA_bestbuys()).distinct()