-
-
Save esseti/0dc0f774e1155ac63797 to your computer and use it in GitHub Desktop.
ML
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
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