Skip to content

Commit

Permalink
Merge pull request #179 from dimagi/cz/messaging-events
Browse files Browse the repository at this point in the history
add ability to export messaging events
  • Loading branch information
czue authored Mar 9, 2021
2 parents f98ce7c + 1c26998 commit a3fbb7e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commcare_export/commcare_minilinq.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


SUPPORTED_RESOURCES = {
'form', 'case', 'user', 'location', 'application', 'web-user'
'form', 'case', 'user', 'location', 'application', 'web-user', 'messaging-event'
}


Expand Down Expand Up @@ -86,7 +86,8 @@ def __call__(self, since, until):

DATE_PARAMS = {
'indexed_on': SimpleSinceParams('indexed_on_start', 'indexed_on_end'),
'server_date_modified': SimpleSinceParams('server_date_modified_start', 'server_date_modified_end')
'server_date_modified': SimpleSinceParams('server_date_modified_start', 'server_date_modified_end'),
'date': SimpleSinceParams('date__gte', 'date__lt'), # used by messaging-events
}


Expand All @@ -95,10 +96,12 @@ def get_paginator(resource, page_size=1000, pagination_mode=PaginationMode.date_
PaginationMode.date_indexed: {
'form': DatePaginator('indexed_on', page_size),
'case': DatePaginator('indexed_on', page_size),
'messaging-event': DatePaginator('date', page_size),
},
PaginationMode.date_modified: {
'form': DatePaginator(['server_modified_on', 'received_on'], page_size, params=FormFilterSinceParams()),
'case': DatePaginator('server_date_modified', page_size),
'messaging-event': DatePaginator('date', page_size),
}
}[pagination_mode].get(resource, SimplePaginator(page_size))

Expand Down

0 comments on commit a3fbb7e

Please sign in to comment.