You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
437 B

from django import forms
from hc.api.models import Channel
class TimeoutForm(forms.Form):
timeout = forms.IntegerField(min_value=60, max_value=604800)
grace = forms.IntegerField(min_value=60, max_value=604800)
class AddChannelForm(forms.ModelForm):
class Meta:
model = Channel
fields = ['kind', 'value']
def clean_value(self):
value = self.cleaned_data["value"]
return value.strip()