Exemplo n.º 1
0
    def edit(self):
        c = TemplateContext()
        c.heading = _('Edit preferences')
        c.formDisabled = ''

        try:
            member = self.session.get('user')
            c.member = member
            pref = self.db.query(Preferences).filter(
                Preferences.uidNumber == member.uidNumber).all()

            c.language = 'en'

            if len(pref) > 0:
                for p in pref:
                    if p.key == 'language':
                        c.language = p.value

            c.languages = Config.get('mematool', 'languages', ['en'])

            return self.render('preferences/edit.mako', template_context=c)

        except LookupError:
            print 'Edit :: No such user !'

        return 'ERROR 4x0'
Exemplo n.º 2
0
  def edit(self):
    c = TemplateContext()
    c.heading = _('Edit preferences')
    c.formDisabled = ''

    try:
      member = self.session.get('user')
      c.member = member
      pref = self.db.query(Preferences).filter(Preferences.uidNumber == member.uidNumber).all()

      c.language = 'en'

      if len(pref) > 0:
        for p in pref:
          if p.key == 'language':
            c.language = p.value

      c.languages = Config.get('mematool', 'languages', ['en'])

      return self.render('preferences/edit.mako', template_context=c)

    except LookupError:
      print 'Edit :: No such user !'

    return 'ERROR 4x0'