Пример #1
0
 def validate_handle(self, field):
     if not (self.instance and self.instance.handle == field.data):
         try:
             MeetingType.select().get(handle=field.data)
             raise ValidationError('A meeting type with the same handle '
                                   'already exists')
         except MeetingType.DoesNotExist:
             pass
Пример #2
0
def meeting_types():
    meeting_types = MeetingType.select().order_by('id')
    return {
        'meeting_types': meeting_types,
    }
Пример #3
0
 def value_labels(self):
   return {i.handle: i.name for i in MeetingType.select()}
Пример #4
0
 def valid_values(self):
     return [i.handle for i in MeetingType.select()]