예제 #1
0
 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 ''
예제 #2
0
    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 ''
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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
예제 #6
0
    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 ''
예제 #7
0
    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 ''
예제 #8
0
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
예제 #9
0
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
예제 #10
0
def _get_provider_isa_best_buys():
    return Provider.objects.filter(
        providerbestbuy__bestbuys__in=get_ISA_bestbuys()).distinct()
예제 #11
0
def _get_provider_isa_best_buys():
    return Provider.objects.filter(providerbestbuy__bestbuys__in=get_ISA_bestbuys()).distinct()
예제 #12
0
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
예제 #13
0
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