Ejemplo n.º 1
0
	def get(self,service=""):
		if self.currentUser:
			template_values= {'user':self.currentUser,'defaultExpressions':defaultExpressions}
			self.templateRender(template_values=template_values,path=getApproot(["templates","users"]),template="userUpdate.html",render=True)
Ejemplo n.º 2
0
	def get(self,gameName=""):
		if gameName:
			cli = memcache.Client()
			toUpdate = cli.get("game-"+gameName)
			if   toUpdate:
				updatedData = toUpdate
				if "X-Requested-With" in self.request.headers and self.request.headers["X-Requested-With"]=="XMLHttpRequest" :self.response.out.write( json.dumps(updatedData))
				else:self.templateRender(template_values={"scores":{"teamA":updatedData['teams'][0],"teamB":updatedData['teams'][1]}},path=getApproot(["templates"]),template="Scorefeeder.html")
			else: self.response.out.write('Invalid Game Id or Game not found')
Ejemplo n.º 3
0
	def get(self,gameName=""):
		#self.session = None
		#return
				
		if gameName:
			cli = memcache.Client()
			toUpdate = cli.get("game-"+gameName)
		   
			if not  toUpdate:
								toUpdate = finalData
								toUpdate['teams'][0]['playerInfo']['A1']['names']=self.request.get('a1') 
								toUpdate['teams'][0]['playerInfo']['A2']['names']=self.request.get('a2') 
								toUpdate['teams'][1]['playerInfo']['B1']['names']=self.request.get('b1') 
								toUpdate['teams'][1]['playerInfo']['B2']['names']=self.request.get('b2')
								toUpdate['teams'][0]['playerInfo']['A1']['img']=self.request.get('a1i')
								toUpdate['teams'][0]['playerInfo']['A2']['img']=self.request.get('a2i')
								toUpdate['teams'][1]['playerInfo']['B1']['img']=self.request.get('b1i') 
								toUpdate['teams'][1]['playerInfo']['B2']['img']=self.request.get('b2i')
								cli.set("game-"+gameName,toUpdate)
			updatedData = toUpdate
			self.templateRender(template_values={'Feeder':True,"scores":{"teamA":updatedData['teams'][0],"teamB":updatedData['teams'][1]}},path=getApproot(["templates"]),template="Scorefeeder.html")
Ejemplo n.º 4
0
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' 
from appRoot import getApproot

from django.conf import settings
_ = settings.TEMPLATE_DIRS
settings.TEMPLATE_DIRS  = (getApproot(["templates"]))