def get(self): tabs = Tab.all().order('sequence') template_values = {'tabs': tabs} path = os.path.join(os.path.dirname(__file__), 'templates/index.html') self.response.out.write(template.render(path, template_values))
def get(self): if self.request.get('action') == 'delete': fld = db.get(db.Key(self.request.get('id'))) if fld: fld.delete(); return self.redirect('/tabmgt') elif self.request.get('action') == 'update': tabs = Tab.all() fld = db.get(db.Key(self.request.get('id'))) values = { 'fld': fld, 'tabs': tabs} else: tabs = Tab.all() if self.request.get('tab'): tab = db.get(db.Key(self.request.get('tab'))) flds = Fieldset.all().filter('tab', tab) else: flds = Fieldset.all() values = { 'flds': flds, 'tabs': tabs } path = os.path.join(os.path.dirname(__file__), 'templates/fldmgt.html') self.response.out.write(template.render(path, values))
def get(self): if self.request.get('action') == 'delete': tab = db.get(db.Key(self.request.get('id'))) if tab: tab.delete() return self.redirect('/tabmgt') elif self.request.get('action') == 'update': tab = db.get(db.Key(self.request.get('id'))) values = { 'tab': tab } else: tabs = Tab.all() values = { 'tabs': tabs } path = os.path.join(os.path.dirname(__file__), 'templates/tabmgt.html') self.response.out.write(template.render(path, values))