2 more comments ( I just noticed ):
- these questions should be sent to django-users, not django-developers
- why go through all stock values to find the best one in the loop
(you could use agregates for that) and then only return count?
Cheers
Jirka
--
You received this message becau
Hi there,
I have not used this myself, but believe that "Q objects" don't
support & operator as you use it. So it's really a Python error, not
Django error.
FYI, you need Q objects only to provide "OR" functionality. For "AND"
functionality, you only need:
mu1 = MarketUpdate.objects.filter(stoc
This is my django snippet to calculate custome stmts but it displays
the error
from optionsAlpha.models import MarketUpdate
from datetime import datetime
from django.db.models import Q
def stock_up(ticker, test_start_date):
#stock_value=0
mu1 = MarketUpdate.objects.filter(Q(stock_symbol=ticker) &