Created
June 21, 2018 15:08
-
-
Save rbrady/a7acb23df93c0088da9e4bd4c698aae4 to your computer and use it in GitHub Desktop.
Sample Report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExternalEffortReport(reports.FileReport): | |
template_name = "/home/rbrady/ee_rpt.txt", | |
output_name = "/home/rbrady/external_efforts.txt" | |
def get_context_data(self, **kwargs): | |
# Call the base implementation first to get a context | |
context = super(ExternalEffortReport, self).get_context_data(**kwargs) | |
# get a reference to the desired cards | |
config = configuration.get_config() | |
manager = boards.BoardManager(config['trello'], BOARD_NAME) | |
in_progress = [item for item in manager.board.open_lists() if | |
item.name == 'In Progress'][0] | |
ex_label = [label for label in manager.board.get_labels() if | |
label.name == 'External Effort'][0] | |
cards = [card for card in in_progress.list_cards() if | |
ex_label in card.labels] | |
context['cards'] = cards | |
return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment