def edit(self, id=0): soft_id = id if soft_id == 0: #soft_id = self.form_result.get('software_id') redirect(url(controller="mobile", action="index")) soft = Session.query(Software).filter(Software.id == soft_id).first() if not soft is None: c.soft = soft return render('/mobile/edit.html')
def login(self): """ This is where the login form should be rendered. Without the login counter, we won't be able to tell if the user has tried to log in with wrong credentials """ identity = request.environ.get('repoze.who.identity') return_url = str(request.GET.get('return_url', '')) or \ url(controller='member', action='welcome') if identity: redirect(url(controller='member', action='welcome')) else: c.return_url = return_url #c.login_counter = request.environ['repoze.who.logins'] + 1 return render('/member/login.html')
def login(self): """ This is where the login form should be rendered. Without the login counter, we won't be able to tell if the user has tried to log in with wrong credentials """ identity = request.environ.get('repoze.who.identity') came_from = str(request.GET.get('came_from', '')) or \ url(controller='account', action='welcome') if identity: redirect(url(came_from)) else: c.came_from = came_from c.login_counter = request.environ['repoze.who.logins'] + 1 return render('/derived/account/login.html')
def doeditX(self, id=0): schema = NewSoftwareForm() try: c.form_result = schema.to_python(dict(request.params)) except formencode.Invalid, error: c.form_result = error.value c.form_errors = error.error_dict or {} soft_id = id if soft_id == 0: redirect(url(controller="mobile", action="index")) soft = Session.query(Software).filter(Software.id == soft_id).first() #if not soft is None: c.soft = soft html = render('/mobile/edit.html') return htmlfill.render( html, defaults=c.form_result, errors=c.form_errors #auto_error_formatter=self.custom_formatter )
def doeditX(self, id=0): schema = NewSoftwareForm() try: c.form_result = schema.to_python(dict(request.params)) except formencode.Invalid, error: c.form_result = error.value c.form_errors = error.error_dict or {} soft_id = id if soft_id == 0: redirect(url(controller="mobile", action="index")) soft = Session.query(Software).filter( Software.id == soft_id).first() #if not soft is None: c.soft = soft html = render('/mobile/edit.html') return htmlfill.render(html, defaults=c.form_result, errors=c.form_errors #auto_error_formatter=self.custom_formatter )
def new_software(self): return render("/admin/new_software.html")
def index(self): # Return a rendered template #return render('/admin.mako') # or, return a string return render('/admin/index.html')
def _editform(self, id=0): return render('/mobile/editform.html')
def add(self): return render('/mobile/add.html')
def detail(self): return render('/market/detail.html')
def info(self): return render('/home/info.html')
def index(self): # Return a rendered template #return render('/market.mako') # or, return a string return render('/market/index.html')
def category(self, what=None): return render('/market/category.html')
def index(self): return render('/member/index.html')
def register(self): return render('/member/register.html')
def index(self): softq = Session.query(Software).limit(100) c.softs = softq return render('/mobile/index.html')