Exemplo n.º 1
0
    def post_general(self, I):

        form = BaseinfoForm(self)
        if form.validate():
            I.name = form.name.data
            I.summary = form.summary.data
            I.description = form.description.data
            I.updated = datetime.now()
            self.db2.commit()

            url = self.reverse_url('myun:instance:view', I.id)
            url += '?tab=general'
            return self.redirect( url )

        self.d['form'] = form
        self.render( 'myun/instance/edit_general.html', **self.d)
Exemplo n.º 2
0
    def post(self, id):

        inst = self.get_instance(id, isowner=True)
        if not inst: return

        form = BaseinfoForm( self.request.arguments )
        if form.validate():
            inst.name = form.name.data
            inst.summary = form.summary.data
            inst.description = form.description.data
            inst.updated = datetime.utcnow()
            self.db2.commit()

            url = self.reverse_url('instance:view', id)
            url += '?view=baseinfo'
            return self.redirect( url )

        # Get error
        d = { 'title': _('Edit Baseinfo'),
              'instance': inst, 'form': form }
        self.render('instance/baseinfo_edit.html', **d)
Exemplo n.º 3
0
    def post(self, id):

        inst = self.get_instance(id, isowner=True)
        if not inst: return

        form = BaseinfoForm( self.request.arguments )
        if form.validate():
            inst.name = form.name.data
            inst.summary = form.summary.data
            inst.description = form.description.data
            inst.updated = datetime.utcnow()
            self.db2.commit()

            url = self.reverse_url('instance:view', id)
            url += '?view=baseinfo'
            return self.redirect( url )

        # Get error
        d = { 'title': _('Edit Baseinfo'),
              'instance': inst, 'form': form }
        self.render('instance/baseinfo_edit.html', **d)
Exemplo n.º 4
0
    def post(self, id):

        inst = self.get_instance(id, isowner=True)
        if not inst:
            return

        form = BaseinfoForm(self.request.arguments)
        if form.validate():
            inst.name = form.name.data
            inst.summary = form.summary.data
            inst.description = form.description.data
            inst.updated = datetime.utcnow()
            self.db2.commit()

            url = self.reverse_url("instance:view", id)
            url += "?view=baseinfo"
            return self.redirect(url)

        # Get error
        d = {"title": _("Edit Baseinfo"), "instance": inst, "form": form}
        self.render("instance/baseinfo_edit.html", **d)
Exemplo n.º 5
0
    def get(self, id):

        inst = self.get_instance(id, isowner=True)
        if not inst: return

        form = BaseinfoForm()
        form.name.data = inst.name
        form.summary.data = inst.summary
        form.description.data = inst.description


        d = { 'title': _('Edit Baseinfo'),
              'instance': inst, 'form': form }

        self.render('instance/baseinfo_edit.html', **d)