Using StringListProperty efficently in Google App Engine


StringListProperty is a datastore value type that stores list items. Using StringListProperty is very easy: #!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext import db class Page(db.Model): title=db.StringProperty(multiline=False) keywords=db.StringListProperty() class MainHandler(webapp.RequestHandler): def get(self): newpage=Page() newpage.title=”Suat ATAN’s books” newpage.keywords=[“book”,”author”] newpage.put() newpage=Page() newpage.title=”Suat ATAN’s life” newpage.keywords=[“canada”,”author”] newpage.put() newpage=Page() newpage.title=”Suat ATAN’s gusto” newpage.keywords=[“coffe”,”pizza”] newpage.put()…

Using StringListProperty efficently in Google App Engine


StringListProperty is a datastore value type that stores list items. Using StringListProperty is very easy: #!/usr/bin/env pythonfrom google.appengine.ext import webappfrom google.appengine.ext.webapp import utilfrom google.appengine.ext import dbclass Page(db.Model): title=db.StringProperty(multiline=False) keywords=db.StringListProperty()class MainHandler(webapp.RequestHandler): def get(self): newpage=Page() newpage.title=”Suat ATAN’s books” newpage.keywords=[“book”,”author”] newpage.put() newpage=Page() newpage.title=”Suat ATAN’s life” newpage.keywords=[“canada”,”author”] newpage.put() newpage=Page() newpage.title=”Suat ATAN’s gusto” newpage.keywords=[“coffe”,”pizza”] newpage.put() pages=Page().all().filter(“keywords” = “author”) for page…

A new version of Python template maker


I developed a script early for dressing pages with demanded template here is newer version: from BeautifulSoup import BeautifulSoup #Configuration root=”D:/users/suat.atan/Desktop/yenisehrivan/” cssroot=”/htmlres/css/” jsroot=”/htmlres/js/” class TemplateMaker(): def generate(self,NUDEPAGE_NAME): NUDEPAGE=open(root+”pages/”+NUDEPAGE_NAME+”.html”).read() index=open(root+”pages/index.html”).read() soup = BeautifulSoup(index) head= soup.findAll(“head”) #header header_1=soup.findAll(“div”,id=”header”) #menu header_2=soup.findAll(“div”,id=”topmenu”) #change css css=soup.findAll(“link”,id=”maincss”) css[0][‘href’]=cssroot+NUDEPAGE_NAME+”.css” #change js js=soup.findAll(“script”,id=”mainjs”) js[0][‘src’]=jsroot+NUDEPAGE_NAME+”.js” HEADER=str(header_1[0])+str(header_2[0]) HEAD= str(head[0]) html1=”””\n “”” html2=”””\n “”” html3=” \n…

A new version of Python template maker


I developed a script early for dressing pages with demanded template here is newer version: from BeautifulSoup import BeautifulSoup#Configurationroot=”D:/users/suat.atan/Desktop/yenisehrivan/”cssroot=”/htmlres/css/”jsroot=”/htmlres/js/”class TemplateMaker(): def generate(self,NUDEPAGE_NAME): NUDEPAGE=open(root+”pages/”+NUDEPAGE_NAME+”.html”).read() index=open(root+”pages/index.html”).read() soup = BeautifulSoup(index) head= soup.findAll(“head”) #header header_1=soup.findAll(“div”,id=”header”) #menu header_2=soup.findAll(“div”,id=”topmenu”) #change css css=soup.findAll(“link”,id=”maincss”) css[0][‘href’]=cssroot+NUDEPAGE_NAME+”.css” #change js js=soup.findAll(“script”,id=”mainjs”) js[0][‘src’]=jsroot+NUDEPAGE_NAME+”.js” HEADER=str(header_1[0])+str(header_2[0]) HEAD= str(head[0]) html1=”””n “”” html2=”””n “”“ html3=” n n” sign=”” HTML=html1+HEAD+html2+HEADER+NUDEPAGE+html3 file =open(root+”pages/gen-“+NUDEPAGE_NAME+”.html”,”w”)…

Dreamweaver-like html template dressing in Aptana with Python


The best way for dressing multiple page with a single template is Dreamweaver HTML template system. This system is ok but not available in Aptana.  For this problem i coded a simple python script that can launchable under Aptana. This script reading head elements of main page for css and javascript’s after this asks the…

Dreamweaver-like html template dressing in Aptana with Python


The best way for dressing multiple page with a single template is Dreamweaver HTML template system. This system is ok but not available in Aptana.  For this problem i coded a simple python script that can launchable under Aptana. This script reading head elements of main page for css and javascript’s after this asks the…

Getting url variables quickly in Google App Engine


Normally, getting url variables in Google App Engine Python is a line of code: param=self.request.get(‘url_param’); print param; But i just discovered that it can also be, with a quick and easy method: def get(self, url_param) print url_param; We can define url param that page work with it, in the get() function params. After that we…

Getting url variables quickly in Google App Engine


Normally, getting url variables in Google App Engine Python is a line of code: param=self.request.get(‘url_param’); print param; But i just discovered that it can also be, with a quick and easy method: def get(self, url_param) print url_param; We can define url param that page work with it, in the get() function params. After that we…

Blueprint typography class


Blueprint css framework also have the typography classes for quick and stable styling texts:   .small 0.8em; line 1.875 .large 1.2em; line 2.5 .hide display: none .quiet color 666 (grey) // Quiet is very useful for notificating not important notes .loud color 000 (black) .highlight bg ff0 (yellow) //Hightlight is very useful notificatinf imortant notes…

Blueprint typography class


Blueprint css framework also have the typography classes for quick and stable styling texts:   .small 0.8em; line 1.875.large 1.2em; line 2.5.hide display: none.quiet color 666 (grey) // Quiet is very useful for notificating not important notes.loud color 000 (black).highlight bg ff0 (yellow) //Hightlight is very useful notificatinf imortant notes and search results including words.added…