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'
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'
class TestSetting(DjSettingsGroup): test_string = values.StringValue(default=self.default, min_length=5)
class TestStringValueSettings(DjSettingsGroup): test_string = values.StringValue(default='test', max_length=self.max_length, min_length=self.min_length)
class TestSetting(DjSettingsGroup): test_string = values.StringValue(default=default)