Commits

Anonymous committed ffa54a5

added validators support for Value class

  • Participants
  • Parent commits 756c27d

Comments (0)

Files changed (1)

livesettings/values.py

         self.hidden = kwargs.pop('hidden', False)
         self.update_callback = kwargs.pop('update_callback', None)
         self.requires = kwargs.pop('requires', None)
+        self.validators = kwargs.pop('validators', [])
         if self.requires:
             reqval = kwargs.pop('requiresvalue', key)
             if not is_list_or_tuple(reqval):
         return enabled
 
     def make_field(self, **kwargs):
+        kwargs['validators'] = self.validators
         if self.choices:
             if self.hidden:
                 kwargs['widget'] = forms.MultipleHiddenInput()