def get_campaign_choices(): campaigns = db.fetch_campaigns() campaign_choices = map(lambda c: (c.key.urlsafe(), c.name), campaigns) return campaign_choices
def render_campaigns(self, add_campaign_form=None): campaigns = db.fetch_campaigns() if add_campaign_form is None: add_campaign_form = AddCampaignForm().get_form() self.render_template('admin/admin_campaigns.html', campaigns=campaigns, add_campaign_form=add_campaign_form)