Skip to content

Instantly share code, notes, and snippets.

@rbrady
Created June 21, 2018 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbrady/a7acb23df93c0088da9e4bd4c698aae4 to your computer and use it in GitHub Desktop.
Save rbrady/a7acb23df93c0088da9e4bd4c698aae4 to your computer and use it in GitHub Desktop.
Sample Report
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