Esempio n. 1
0
    def field_impl(self):
        """Gets the implementation of the field.

        :return: An instance of a `RegistrationFormFieldBase` subclass
        """
        field_cls = get_field_types().get(self.input_type, InvalidRegistrationFormField)
        return field_cls(self)
Esempio n. 2
0
 def _check_input_type(self, input_type, **kwargs):
     field = self.context['field']
     if field.input_type is not None and field.input_type != input_type:
         # TODO: when moving the frontend to react we should probably simply
         # stop sending it except when creating a new field and reject requests
         # that contain an input_type
         raise ValidationError('Cannot change field input type')
     if input_type not in get_field_types():
         raise ValidationError('Invalid field type')
Esempio n. 3
0
    def field_impl(self):
        """Gets the implementation of the field.

        :return: An instance of a `RegistrationFormFieldBase` subclass
        """
        return get_field_types()[self.input_type](self)
Esempio n. 4
0
    def field_impl(self):
        """Gets the implementation of the field.

        :return: An instance of a `RegistrationFormFieldBase` subclass
        """
        return get_field_types()[self.input_type](self)