This is what I have so far:
def get_ad():
total_count = Ad.all().count()
all_Ads = Query(Ad).fetch(1000)
memcache.add(total_count_of_ads, total_count)
# assume total_ads to be less than 1000 for now
a_random_Ad = random.randint(0, total_count - 1)
my_random_Ad = all_Ads[a_random_Ad]
Hi,
execfile is a builtin Python function, so it seems like there is
something amiss with your python installation. What version of Python
are you using? Does it run, and can you use built-in functions, from
the command line interpreter? What is your PYTHONPATH?
-Marzia
On Fri, Jan 9, 2009