def get(self): query = Sport.select().order_by(Sport.sort.desc()) sports = [] for sport in query: sports.append(sport.info) self.write({"sports": sports})
def get(self): team = self.current_team if team.sport: team.sport = [s for s in Sport.select().where(Sport.id << team.sport)] form = TeamBasicFrom(obj=team) province = self.current_team.province if province: form.city.choices = ChinaCity.get_cities(province) self.render("settings/basic.html", form=form, cities=ChinaCity.get_cities() )