Beispiel #1
0
        class TestSettings(DjSettingsGroup):
            test_string = values.StringValue(default='test string setting',
                                             verbose_name='Test string name',
                                             help_text='test sting help text')
            test_boolean = values.BooleanValue(default=False)
            test_integer = values.IntegerValue(default=1)
            test_decimal = values.DecimalValue(default=decimal.Decimal(0.01))
            test_float = values.FloatValue(default=0.01)
            test_model_choice = values.ModelChoiceValue(
                queryset=User.objects.all(), default=self.user)

            class Meta:
                verbose_name = 'Test settings'
Beispiel #2
0
        class TestOptionalSettings(DjSettingsGroup):
            test_string_optional = values.StringValue(default=None,
                                                      required=False)
            test_integer_optional = values.IntegerValue(default=None,
                                                        required=False)
            test_decimal_optional = values.DecimalValue(default=None,
                                                        required=False)
            test_float_optional = values.FloatValue(default=None,
                                                    required=False)
            test_model_choice_optional = values.ModelChoiceValue(
                queryset=User.objects.all(), default=None, required=False)

            class Meta:
                verbose_name = 'Test optional settings'
Beispiel #3
0
 class TestSetting(DjSettingsGroup):
     test_string = values.StringValue(default=self.default, min_length=5)
Beispiel #4
0
 class TestStringValueSettings(DjSettingsGroup):
     test_string = values.StringValue(default='test',
                                      max_length=self.max_length,
                                      min_length=self.min_length)
Beispiel #5
0
 class TestSetting(DjSettingsGroup):
     test_string = values.StringValue(default=default)