Issue #35 resolved

PositiveIntegerValue class must be > 0

Anonymous created an issue

Why in .../django-livesettings/livesettings/values.py there is PositiveIntegerValue (as I think it's values must be > 0) class with min_value = 0

class PositiveIntegerValue(IntegerValue):

class field(forms.IntegerField): def init(self, args, *kwargs): ...
kwargs['min_value'] = 0 ...

I think that this class must named NotNegativeIntegerValue. But class PositiveIntegerValue must be:

class PositiveIntegerValue(IntegerValue):

class field(forms.IntegerField): def init(self, args, *kwargs): ...
kwargs['min_value'] = 1 ...

Is it my bad english or can I give patch with classes?

Comments (2)

  1. Hynek Cernoch

    You are right, however...

    "PositiveIntegerValue" is a nicer name than "NonNegativeIntegerValue", though inaccurate. Zero values are frequently expected in existing applications and probably also in user's code. The min_value=1 is less frequently useful than zero.Therefore the best possible fix is a better documentation. You can easily create a "ReallyPositiveIntegerValue".

    Your issue was motivation for bigger improving the package and the documentation, hower for you I modified a little: 57608412

  2. Log in to comment