From 769159ec6dca75c91bf226a21b4c77fa147a2795 Mon Sep 17 00:00:00 2001 From: Rezart Abazi Date: Mon, 11 Dec 2023 14:24:10 +0100 Subject: [PATCH] keeping the docstrings --- backend/models/data_profile.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/backend/models/data_profile.py b/backend/models/data_profile.py index bb54e12..d961fe7 100644 --- a/backend/models/data_profile.py +++ b/backend/models/data_profile.py @@ -4,6 +4,19 @@ class DataProfile(Base): + + """ + DataProfile Model + ----------------- + This class represents the 'dataprofile' table in the database. + Attributes: + - id: A unique identifier for each data profile. + - name: The name of the data profile. + - file_type: The type of file associated with the data profile. + - organization_id: The organization associated with the data profile. + The class also is converting the model instance into a dictionary. + """ + __tablename__ = "data_profiles" id = Column(Integer, primary_key=True) name = Column(String) @@ -12,20 +25,23 @@ class DataProfile(Base): description = Column(String) # New description column def to_dict(self): + """ + Converts the DataProfile instance into a dictionary. + """ return { "id": self.id, "name": self.name, "file_type": self.file_type, "organization_id": self.organization_id, - "description": self.description, # Include description in the dictionary + "description": self.description, } class DataProfileCreateRequest(BaseModel): name: str - description: str # Include description here + description: str class DataProfileCreateResponse(BaseModel): name: str - description: str # Include description here + description: str