diff --git a/depsec_db/models.py b/depsec_db/models.py index 18d7460..0106a87 100644 --- a/depsec_db/models.py +++ b/depsec_db/models.py @@ -18,6 +18,15 @@ class Project(db.Model): titre = db.Column(db.String, nullable=False) status = db.Column(db.String, nullable=False) path = db.Column(db.String, nullable=False) + def to_dict(self): + """Function to return projects as JSON""" + return { + "id": self.id, + "auteur_id": self.auteur_id, + "titre": self.titre, + "status": self.status, + "path": self.path + } class User(db.Model): """Modèle utilisateur principal pour l'authentification."""