Esempio n. 1
0
    def add_parent_classifier(self):
        classifier = Classifier(classifier=self.request.params.get("parent"),
                                l3=0,
                                l4=0,
                                l5=0)

        self.request.db.add(classifier)
        self.request.db.flush()  # To get the ID

        classifier.l2 = classifier.id

        self.request.session.flash(
            f"Added classifier {classifier.classifier!r}", queue="success")

        return HTTPSeeOther(self.request.route_path("admin.classifiers"))
Esempio n. 2
0
    def add_parent_classifier(self):
        classifier = Classifier(
            classifier=self.request.params.get('parent'), l3=0, l4=0, l5=0,
        )

        self.request.db.add(classifier)
        self.request.db.flush()  # To get the ID

        classifier.l2 = classifier.id

        self.request.session.flash(
            f'Added classifier {classifier.classifier!r}',
            queue='success',
        )

        return HTTPSeeOther(self.request.route_path('admin.classifiers'))
Esempio n. 3
0
    def add_parent_classifier(self):
        classifier = Classifier(
            classifier=self.request.params.get('parent'),
            l3=0,
            l4=0,
            l5=0,
        )

        self.request.db.add(classifier)
        self.request.db.flush()  # To get the ID

        classifier.l2 = classifier.id

        self.request.session.flash(
            f'Successfully added classifier {classifier.classifier!r}',
            queue='success',
        )

        return HTTPSeeOther(self.request.route_path('admin.classifiers'))