def post(self): do=self.request.get('do') c=None rframeseq=None if do=="addcomic": c=newComic(self) elif do=="editcomic": c=editComic(self) else: rframeseq=saveFrame(self) if not c: comickey=self.request.get('comickey') c=comic.Comic.get(comickey) template_values={} template_values.update(loadComicStd(c, self)) if rframeseq: template_values.update({'rframeseq':rframeseq}) template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/comicmain.html') self.response.out.write(template.render(path, template_values))
def doindex(handler): tagname=handler.request.get('tag') entries=[] if tagname: tag=Tag.all().filter('name = ', tagname).get() if tag and tag.tagedEntries: for tagedEntry in tag.tagedEntries: if not(tagedEntry.entry.cparent) and tagedEntry.entry.user and tagedEntry.entry.user.nickname()=='JoeyKBlack': entries.append(tagedEntry.entry) else: for entry in Entry.all().fetch(100): if not(entry.cparent) and entry.user and entry.user.nickname()=='JoeyKBlack': entries.append(entry) entries.reverse() util.imageafi(entries) template_values = { 'entries':entries, 'ispost':users.is_current_user_admin(), 'filters':util.filters('') } template_values.update(util.loadstd(handler)) path = os.path.join(os.path.dirname(__file__), '../html/index.html') handler.response.out.write(template.render(path, template_values))
def get(self): template_values = { } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/research.html') self.response.out.write(template.render(path, template_values))
def get(self): template_values = { 'entryform':EntryForm() } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/post.html') self.response.out.write(template.render(path, template_values))
def get(self): comickey=self.request.get('comickey') c=None #get desired comic if comickey: c=comic.Comic.get(comickey) #delete type=self.request.get('type') if c and type and type=='delete': old=c for frame in old.frames: frame.delete() if len(c.nexts.fetch(1))>0: c=c.nexts.fetch(1)[0] else: c=c.last for next in old.nexts.fetch(100): next.last=old.last next.put() old.delete() #move go=self.request.get('go') if go: if go=='last' and c and c.last: c=c.last elif go=='next' and c and len(c.nexts.fetch(1))>0: c=c.nexts.fetch(1)[0] #not found, get first if not c and len(comic.Comic.all().fetch(1))>0: c=comic.Comic.all().order('-date').fetch(1) if len(c)>0: c=c[0] #none found, make new if not c: c=comic.Comic(name="First", owner=users.get_current_user()) c.put() template_values={} template_values.update(loadComicStd(c, self)) template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/comicmain.html') self.response.out.write(template.render(path, template_values))
def post(self): lusers=Minime.all().fetch(100) votes=self.request.get_all('votes') for vote, luser in zip(votes, lusers): luser.votes=int(vote) luser.put() template_values = { 'lusers':lusers } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/admin.html') self.response.out.write(template.render(path, template_values))
def get(self): action=self.request.get('action') if action=='dropdb': dropdb() lusers=Minime.all().fetch(100) template_values = { 'lusers':lusers } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/admin.html') self.response.out.write(template.render(path, template_values))
def post(self): key=self.request.get('topkey') entry=Entry.get(key) util.saveEntry(self) template_values = { 'up':up(entry), 'comments':commentsHtml(top=entry,entry=entry), 'entryform':EntryForm(), 'topkey':key } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/comments.html') self.response.out.write(template.render(path, template_values))
def get(self): key=self.request.get('topkey') if key: entry=Entry.get(key) else: index.doindex(self) return entryform=EntryForm() editkey=self.request.get('editkey') tags='' if editkey: editentry=Entry.get(editkey) if editentry: if editentry.type=='Text': editentry.text=editentry.text.replace('<br />', '\n') entryform=EntryForm(instance=editentry) for tagged in editentry.tagedEntries: tags+=tagged.tag.name+',' tags=tags[0:-1] #takes off last char deletekey=self.request.get('deletekey') deleted=False if deletekey: deleteentry=Entry.get(deletekey) if deleteentry: delete.deleteEntry(deleteentry) deleted=True template_values = { 'editkey':editkey, 'up':up(entry), 'deleleted':deleted, 'comments':commentsHtml(top=entry,entry=entry), 'entryform':entryform, 'topkey':key, 'tags':tags } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/comments.html') self.response.out.write(template.render(path, template_values))
def dopostit(handler, entryform=EntryForm(), editkey='', tags=''): tagname=handler.request.get('tag') entries=[] if tagname: tag=Tag.all().filter('name = ', tagname).get() if tag and tag.tagedEntries: for tagedEntry in tag.tagedEntries: if not(tagedEntry.entry.cparent): entries.append(tagedEntry.entry) else: for entry in Entry.all().fetch(100): if not(entry.cparent): entries.append(entry) entries.reverse() util.imageafi(entries) username='' if users.get_current_user(): username=users.get_current_user().nickname() template_values = { 'currentuser':username, 'filters':util.filters('postit'), 'entryform':entryform, 'entries':entries, 'editkey':editkey, 'tags':tags } template_values.update(util.loadstd(handler)) path = os.path.join(os.path.dirname(__file__), '../html/postit.html') handler.response.out.write(template.render(path, template_values))