DemocracyClub / uk-election-timetables

Encapsulates timetable legislation for elections run in the United Kingdom and its devolved administrations. 🗳🕰
MIT License
3 stars 0 forks source link

Export entire timetable per election #7

Closed mrwilson closed 3 years ago

mrwilson commented 3 years ago

We want something like .timetable() on Election that aggregates all the known dates into a single dict (possibly alongside source legislation, but that's a stretch goal)

This dict can be used for e.g. templating out tables in HTML.

def timetable(self) -> Dict[str,Dict[str,date]]:
  return {
    "sopn_publish_date": {
      "label": "Publication of persons nominated",
      "date": self.sopn_publish_date,
      "legislation": "..."
    }
  }
mrwilson commented 3 years ago

This has been done.