def post(self, pageid1): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return pageid2 = self.request.get('pageid') page1 = Page.get_by_id(int(pageid1)) page2 = Page.get_by_id(int(pageid2)) PagePageLink.new(page1, page2) self.redirect('/page/' + pageid1)
def post(self,pageid1): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return pageid2 = self.request.get('pageid') page1 = Page.get_by_id(int(pageid1)) page2 = Page.get_by_id(int(pageid2)) PagePageLink.new(page1,page2) self.redirect('/page/'+pageid1)
def post(self, keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) pageid = int(self.request.get('pageid')) pageToImport = Page.get_by_id(int(pageid)) for link in pageToImport.contents: try: if None != link and None != link.content and None != page: PageContentLink.new(page, link.content) except: pass self.redirect('/page/' + keyid)
def post(self,keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) pageid = int(self.request.get('pageid')) pageToImport = Page.get_by_id(int(pageid)) for link in pageToImport.contents: try: if None != link and None != link.content and None != page: PageContentLink.new(page,link.content) except: pass self.redirect('/page/'+keyid)
def post(self, keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) story_ = Story.get_by_id(int(keyid)) page = Page.new(account, story_) pageid = int(self.request.get('pageid')) pageToImport = Page.get_by_id(int(pageid)) for link in pageToImport.contents: PageContentLink.new(page, link.content) self.redirect('/story/' + keyid)
def get(self, storyid, pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) for link in page.contents: link.delete() page.delete() self.redirect("/story/" + storyid)
def get(self,pageid,contentid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) content = Content.get_by_id(int(contentid)) PageContentLink.new(page,content) self.redirect('/page/'+pageid)
def get(self,storyid,pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) for link in page.contents: link.delete() page.delete() self.redirect("/story/"+storyid)
def post(self,keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) story_ = Story.get_by_id(int(keyid)) page = Page.new(account,story_) pageid = int(self.request.get('pageid')) pageToImport = Page.get_by_id(int(pageid)) for link in pageToImport.contents: PageContentLink.new(page,link.content) self.redirect('/story/'+keyid)
def get(self, pageid, contentid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) content = Content.get_by_id(int(contentid)) PageContentLink.new(page, content) self.redirect('/page/' + pageid)
def get(self, pageid, contentid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return p = Page.get_by_id(int(pageid)) c = Content.get_by_id(int(contentid)) obj = PageContentLink.get_by_key_name( str(p.key().id()) + "+" + str(c.key().id())) obj.delete() self.redirect("/page/" + pageid)
def post(self, pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) page.setter(params) self.redirect('/page/' + pageid)
def get(self,pageid,contentid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return p = Page.get_by_id(int(pageid)) c = Content.get_by_id(int(contentid)) obj = PageContentLink.get_by_key_name( str(p.key().id())+"+"+str(c.key().id())) obj.delete() self.redirect("/page/"+pageid)
def post(self,pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pageid)) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) page.setter(params) self.redirect('/page/'+pageid)
def post(self, pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return content_ = Content.new(account) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) content_.setter(params) page_ = Page.get_by_id(int(pageid)) PageContentLink.new(page_, content_) self.redirect('/page/' + pageid)
def post(self,pageid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return content_ = Content.new(account) params = {} for key in self.request.arguments(): params[key] = self.request.get(key) content_.setter(params) page_ = Page.get_by_id(int(pageid)) PageContentLink.new(page_,content_) self.redirect('/page/'+pageid)
def get(self, keyid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) contents = [] for link in page.contents: try: content = link.content content.keyid = content.key().id() contents.append(content) except: content = None contentsortedlist = sorted(contents, key=lambda p: p.index) parents = [] for link in page.parents: p = link.parent_page p.keyid = p.key().id() parents.append(p) childs = [] for link in page.childs: p = link.child_page p.keyid = p.key().id() childs.append(p) storykeyid = None if None != page.story: storykeyid = str(page.story.key().id()) context = { 'static_path': STATIC_PATH, 'APP_TITLE': APP_TITLE, 'pagemultisearchshow': PAGE_MULTISEARCH_SHOW, 'pagemultiupdateshow': PAGE_MULTIUPDATE_SHOW, 'pagesyncshow': PAGE_SYNC_SHOW, 'pageimportshow': PAGE_IMPORT_SHOW, 'page': page, 'contents': contentsortedlist, 'parents': parents, 'childs': childs, 'storyid': storykeyid, 'keyid': page.key().id() } self.render_to_response('page_read.html', context)
def get(self,keyid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) contents = [] for link in page.contents: try: content = link.content content.keyid = content.key().id() contents.append(content) except: content = None contentsortedlist = sorted(contents, key=lambda p: p.index) parents = [] for link in page.parents: p = link.parent_page p.keyid = p.key().id() parents.append(p) childs = [] for link in page.childs: p = link.child_page p.keyid = p.key().id() childs.append(p) storykeyid = None if None != page.story: storykeyid = str(page.story.key().id()) context = {'static_path': STATIC_PATH, 'APP_TITLE' : APP_TITLE, 'pagemultisearchshow':PAGE_MULTISEARCH_SHOW, 'pagemultiupdateshow':PAGE_MULTIUPDATE_SHOW, 'pagesyncshow':PAGE_SYNC_SHOW, 'pageimportshow':PAGE_IMPORT_SHOW, 'page':page, 'contents':contentsortedlist, 'parents':parents, 'childs':childs, 'storyid':storykeyid, 'keyid':page.key().id()} self.render_to_response('page_read.html',context)
def get(self,pagekeyid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pagekeyid)) f_data = page.to_formdict() s_form = PageInfoForm (f_data) del s_form.fields['index'] del s_form.fields['score'] del s_form.fields['price'] del s_form.fields['visible'] del s_form.fields['expiration_days'] del s_form.fields['expiration_mins'] context = {'static_path': STATIC_PATH, 'APP_TITLE' : APP_TITLE, 'form':s_form} self.render_to_response('form.html',context)
def get(self, pagekeyid): accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(pagekeyid)) f_data = page.to_formdict() s_form = PageInfoForm(f_data) del s_form.fields['index'] del s_form.fields['score'] del s_form.fields['price'] del s_form.fields['visible'] del s_form.fields['expiration_days'] del s_form.fields['expiration_mins'] context = { 'static_path': STATIC_PATH, 'APP_TITLE': APP_TITLE, 'form': s_form } self.render_to_response('form.html', context)
def post(self, keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) for link in page.contents: link.delete() indexfrom = int(self.request.get('indexfrom')) indexto = int(self.request.get('indexto')) pagelist = [] for p in page.story.pages: pagelist.append(p) pagelist = sorted(pagelist, key=lambda p: p.index) for p in pagelist: if p.index >= indexfrom: for link in p.contents: PageContentLink.new(page, link.content) if p.index > indexto: break self.redirect('/page/' + keyid)
def post(self,keyid): #logout accountid = self.session.get('accountid') account = Account.get_by_accountid(accountid) if 1 != account.mod: return page = Page.get_by_id(int(keyid)) for link in page.contents: link.delete() indexfrom = int(self.request.get('indexfrom')) indexto = int(self.request.get('indexto')) pagelist = [] for p in page.story.pages: pagelist.append(p) pagelist = sorted(pagelist, key=lambda p: p.index) for p in pagelist: if p.index >= indexfrom: for link in p.contents: PageContentLink.new(page,link.content) if p.index > indexto: break self.redirect('/page/'+keyid)