def save()

in api/plugins/tasks.py [0:0]


    def save(self):
        """ Saves or updates a category in the registry """
        nc = self.conn.cursor()
        # Save a new category?
        if not self.id:
            nc.execute("INSERT INTO `nodecats` (`name`, `description`, `settings`) VALUES (?, ?, ?)",
                    (self.name, self.description, json.dumps(self.settings), )
                )
        # Update existing category?
        else:
            nc.execute("UPDATE `nodecats` SET `name` = ?, `description` = ?, `settings` = ? WHERE `id` = ? LIMIT 1",
                    (self.name, self.description, json.dumps(self.settings), self.id, )
                )
        self.conn.commit()