Skip to content

Commit

Permalink
Update database.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Dec 20, 2024
1 parent c6b7f52 commit 0bacc74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OpenOversight/app/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Department(BaseModel, TrackUpdates, Serializable):
__table_args__ = (UniqueConstraint("name", "state", name="departments_name_state"),)

def __repr__(self):
return f"<Department ID {self.id}: {self.name} {self.state}>"
return f"<Department ID {self.id} : {self.name} : {self.state}>"

def to_custom_dict(self):
return {
Expand Down Expand Up @@ -430,7 +430,7 @@ class Salary(BaseModel, TrackUpdates, Serializable):
)

def __repr__(self):
return f"<Salary: ID {self.officer_id} : {self.salary}"
return f"<Salary: ID {self.officer_id} : {self.salary}>"

@property
def total_pay(self) -> float:
Expand Down Expand Up @@ -729,6 +729,9 @@ class Link(BaseModel, TrackUpdates, Serializable):
db.Boolean, nullable=False, default=False
)

def __repr__(self):
return f"<Link ID: {self.id} : {self.description}>"

@validates("url")
def validate_url(self, key, url):
return url_validator(url)
Expand Down

0 comments on commit 0bacc74

Please sign in to comment.