Example #1
0
    def post(self):
        o = ObjectDict()
        o.title = self.get_argument('title', None)
        o.slug = self.get_argument('slug', None)
        o.content = self.get_argument('content', None)

        if not (o.title and o.slug and o.content):
            self.flash_message('Please fill the required field', 'error')
            self.render('doc.html', doc=o)
            return

        doc = Document(**o)

        db.session.add(doc)
        db.session.commit()

        self.reverse_redirect('dashboard')
Example #2
0
    def post(self):
        o = ObjectDict()
        o.title = self.get_argument('title', None)
        o.slug = self.get_argument('slug', None)
        o.content = self.get_argument('content', None)

        if not (o.title and o.slug and o.content):
            self.flash_message('Please fill the required field', 'error')
            self.render('doc.html', doc=o)
            return

        doc = Document(**o)

        db.session.add(doc)
        db.session.commit()

        self.reverse_redirect('dashboard')
Example #3
0
    def post(self):
        o = ObjectDict()
        o.title = self.get_argument('title', None)
        o.slug = self.get_argument('slug', None)
        o.avatar = self.get_argument('avatar', None)
        o.description = self.get_argument('description', None)
        o.fgcolor = self.get_argument('fgcolor', None)
        o.bgcolor = self.get_argument('bgcolor', None)
        o.header = self.get_argument('header', None)
        o.sidebar = self.get_argument('sidebar', None)
        o.footer = self.get_argument('footer', None)
        try:
            o.limit_reputation = int(self.get_argument('reputation', 0))
        except:
            o.limit_reputation = 0

        try:
            o.limit_role = int(self.get_argument('role', 0))
        except:
            o.limit_role = 0

        if not (o.slug and o.title and o.description):
            self.flash_message('Please fill the required field', 'error')
            self.render('node.html', node=o)
            return

        node = Node(**o)

        db.session.add(node)
        db.session.commit()

        self.reverse_redirect('dashboard')
Example #4
0
    def post(self):
        o = ObjectDict()
        o.title = self.get_argument('title', None)
        o.slug = self.get_argument('slug', None)
        o.avatar = self.get_argument('avatar', None)
        o.description = self.get_argument('description', None)
        o.fgcolor = self.get_argument('fgcolor', None)
        o.bgcolor = self.get_argument('bgcolor', None)
        o.header = self.get_argument('header', None)
        o.sidebar = self.get_argument('sidebar', None)
        o.footer = self.get_argument('footer', None)
        try:
            o.limit_reputation = int(self.get_argument('reputation', 0))
        except:
            o.limit_reputation = 0

        try:
            o.limit_role = int(self.get_argument('role', 0))
        except:
            o.limit_role = 0

        if not (o.slug and o.title and o.description):
            self.flash_message('Please fill the required field', 'error')
            self.render('node.html', node=o)
            return

        node = Node(**o)

        db.session.add(node)
        db.session.commit()

        self.reverse_redirect('dashboard')
Example #5
0
 def get(self):
     node = ObjectDict()
     self.render('admin/node.html', node=node)
Example #6
0
 def get(self):
     doc = ObjectDict()
     self.render('admin/doc.html', doc=doc)