Skip to content

Instantly share code, notes, and snippets.

@esseti
Created January 19, 2015 09:25
Show Gist options
  • Save esseti/0dc0f774e1155ac63797 to your computer and use it in GitHub Desktop.
Save esseti/0dc0f774e1155ac63797 to your computer and use it in GitHub Desktop.
ML
calls_open = Call.query(Call.status == "OPEN").fetch()
calls_past = Call.query(Call.status == "CLOSED").fetch()
res_past = []
for call in calls_past:
d_call = call.to_dict()
res_offers = []
for offer in call.offers:
r_offer = offer.get()
d_offer = r_offer.to_dict()
d_offer['team'] = r_offer.team.get().name
res_offers.append(d_offer)
d_call['offers'] = res_offers
res_past.append(d_call)
template_values = dict(open=calls_open, past=res_past)
template = JINJA_ENVIRONMENT.get_template('templates/index.html')
self.response.write(template.render(template_values))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment