Skip to content

Commit

Permalink
keeping the docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rezart95 committed Dec 11, 2023
1 parent 62855b0 commit 769159e
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions backend/models/data_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 769159e

Please sign in to comment.