예제 #1
0
    def entity_browser_committee_part(self, *args):
        entity_key = args[0]
        entity = db.get(entity_key)
        committee_result = Committee.gql("where entiti=:entity_key",
                                         entity_key=entity.key())
        param = self.render_parameters()
        committee = None
        committee_list = []
        for cmte in committee_result:
            if cmte.year.is_current:
                committee = cmte
                param["president"] = committee.president()
            else:
                committee_list.append(cmte)
        param["committee_list"] = committee_list
        param["committee"] = committee
        param["entity"] = entity
        year = Year.all()
        if committee:
            year.filter("__key__ !=", committee.year.key())
        for cmte in committee_list:
            year.filter("__key__ !=", cmte.year.key())
        if year.count > 0:
            year_list = []
            for y in year:
                year_list.append(y)
            param["year_list"] = year_list
        #Temporary

        return self.render("entity_browser_committee_part", param)
예제 #2
0
파일: views.py 프로젝트: Teezus/T
def schedule():
  years = Year.all()
  return render_template('schedule.html', years=years)