Пример #1
0
 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')
Пример #2
0
 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')        
Пример #3
0
 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')
Пример #4
0
 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')
Пример #5
0
 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
         )
Пример #6
0
 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
                                )
Пример #7
0
 def new_software(self): 
     return render("/admin/new_software.html")
Пример #8
0
 def index(self):
     # Return a rendered template
     #return render('/admin.mako')
     # or, return a string
     return render('/admin/index.html')
Пример #9
0
 def _editform(self, id=0):
     return render('/mobile/editform.html')
Пример #10
0
 def add(self):
     return render('/mobile/add.html')
Пример #11
0
 def detail(self):
     return render('/market/detail.html')
Пример #12
0
 def detail(self):
     return render('/market/detail.html')
Пример #13
0
 def info(self):
     return render('/home/info.html')
Пример #14
0
 def index(self):
     # Return a rendered template
     #return render('/market.mako')
     # or, return a string
     return render('/market/index.html')
Пример #15
0
    def category(self, what=None):

        return render('/market/category.html')
Пример #16
0
 def new_software(self):
     return render("/admin/new_software.html")
Пример #17
0
 def index(self):
     # Return a rendered template
     #return render('/admin.mako')
     # or, return a string
     return render('/admin/index.html')
Пример #18
0
 def index(self):
     # Return a rendered template
     #return render('/market.mako')
     # or, return a string
     return render('/market/index.html')
Пример #19
0
 def index(self):
     return render('/member/index.html')
Пример #20
0
 def _editform(self, id=0):
     return render('/mobile/editform.html')   
Пример #21
0
 def register(self):
     return render('/member/register.html')
Пример #22
0
 def register(self):
     return render('/member/register.html')
Пример #23
0
 def index(self):
     softq = Session.query(Software).limit(100)
     c.softs = softq       
     return render('/mobile/index.html')
Пример #24
0
 def info(self):
     return render('/home/info.html')
Пример #25
0
 def index(self):
     softq = Session.query(Software).limit(100)
     c.softs = softq
     return render('/mobile/index.html')
Пример #26
0
 def category(self, what=None):
     
     return render('/market/category.html')
Пример #27
0
 def add(self):
     return render('/mobile/add.html')
Пример #28
0
 def index(self):
     return render('/member/index.html')