#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xmlrpclib
import os
import sys
import time
import math
import optparse
import tm.filecheck
import service
from django.http import HttpResponse
from django.core.cache import cache
def getCategoryAndDetail(request):
keyword = request.GET.__getitem__('keyword' )
result1 = keyword + str(cache.has_key('SC_MAPPER'))
if not (cache.has_key('SC_MAPPER')):
cache.set('SC_MAPPER','SC',99999)
else:
sc = cache.get('SC_MAPPER')
result2 = keyword + str(cache.has_key('SC_MAPPER'))
return HttpResponse(result1 + result2)
before is my testing code.
When I call this mothod by http, it should retrun false when I first visit,
and return true all the other time, but it is not return true all time after
I first visit. any one meeting the same problem? this code is work well in
local django development server.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---