Skip to content

Commit

Permalink
Adiciona campo novo para cities
Browse files Browse the repository at this point in the history
  • Loading branch information
trevineju committed Feb 5, 2025
1 parent 0fe7619 commit 78de300
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cities/city_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ def __init__(
uf: str,
openness_level: OpennessLevel,
gazettes_urls: List[str],
availability_date: str
):
self.publication_urls = gazettes_urls
self.territory_id = ibge_id
self.territory_name = name
self.level = openness_level
self.state_code = uf
self.availability_date = availability_date

def __eq__(self, other):
return (
Expand All @@ -35,14 +37,15 @@ def __eq__(self, other):
and self.level == other.level
and self.state_code == other.state_code
and self.publication_urls == other.publication_urls
and self.availability_date == other.availability_date
)

def __repr__(self):
return f"CitySearchResult({self.territory_name}, {self.territory_id}, {self.level}, {self.state_code}, {self.publication_urls})"
return f"CitySearchResult({self.territory_name}, {self.territory_id}, {self.level}, {self.state_code}, {self.publication_urls}, {self.availability_date})"

def __hash__(self):
return hash(
(self.territory_id, self.territory_name, self.state_code, self.level,)
(self.territory_id, self.territory_name, self.state_code, self.level, self.availability_date)
)


Expand Down Expand Up @@ -109,6 +112,7 @@ def get_cities(self, city_name: str, levels: List[str]):
row["uf"],
OpennessLevel(row["openness_level"]),
self._split_urls(row["gazettes_urls"]),
row["availability_date"]
)
results.append(city)
return results
Expand All @@ -124,6 +128,7 @@ def get_city(self, territory_id: str):
row["uf"],
OpennessLevel(row["openness_level"]),
self._split_urls(row["gazettes_urls"]),
row["availability_date"]
)
return city

Expand Down

0 comments on commit 78de300

Please sign in to comment.