def prepare(self): teams = [] if self.new: teams += [('__new__', 'New Team')] teams += [('', '-' * 16, {'disabled': 'disabled'})] if self.lesson.teams: teams += [(t.id, t.name) for t in self.lesson.teams] if not teams: teams += [('', 'No Teams in Lesson "%s"' % (self.lesson.name))] self.options = [(self.lesson.name, teams)] _SingleSelectField.prepare(self)
def prepare(self): self.options = [(l.id, l.name) for l in self.event.lessons] _SingleSelectField.prepare(self)