Skip to content

Commit

Permalink
reply chaining: support per, sort_by, order.
Browse files Browse the repository at this point in the history
  • Loading branch information
synrg committed Aug 13, 2024
1 parent 3693235 commit a1185a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions inatcog/embeds/inat.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ def inat_content_as_dict(self):
content["obs_on"] = self.obs_on()
content["obs_d1"] = self.obs_d1()
content["obs_d2"] = self.obs_d2()
content["per"] = None
content["sort_by"] = None
content["order"] = None
return content

def query(self, query: Query = EMPTY_QUERY): # Query
Expand All @@ -243,6 +246,11 @@ def query(self, query: Query = EMPTY_QUERY): # Query
place = query.place or self.place_id()
project = query.project or self.project_id()
controlled_term = query.controlled_term or self.controlled_term()
# TODO: support storing these in the embed and reading them out to
# merge with the query
per = query.per
sort_by = query.sort_by
order = query.order
# If the query contains any date selectors, they supersede any that the
# embed may have had (i.e. mixing and matching different date selectors
# from the the base query and new query are likely not what the user meant)
Expand Down Expand Up @@ -283,6 +291,9 @@ def query(self, query: Query = EMPTY_QUERY): # Query
obs_on=obs_on,
obs_d1=obs_d1,
obs_d2=obs_d2,
per=per,
sort_by=sort_by,
order=order,
)
return query

Expand Down

0 comments on commit a1185a6

Please sign in to comment.