aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/gui/app/forms.py
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2011-10-12 13:49:56 +0000
committerMichael Elkins <melkins@tislabs.com>2011-10-12 13:49:56 +0000
commit1646f116ec8b6e9b4b28a83c08cddec398ac52db (patch)
treeb3777fa7859e8ee6be52bfa31e32c1e29f2cfa16 /rpkid/rpki/gui/app/forms.py
parent000e3654220eafc6e8933b4740797e7cb2eb17d4 (diff)
add support for oo setup via portal gui
svn path=/rpkid/rpki/gui/app/forms.py; revision=4033
Diffstat (limited to 'rpkid/rpki/gui/app/forms.py')
-rw-r--r--rpkid/rpki/gui/app/forms.py37
1 files changed, 11 insertions, 26 deletions
diff --git a/rpkid/rpki/gui/app/forms.py b/rpkid/rpki/gui/app/forms.py
index bb5b6da9..41e154e5 100644
--- a/rpkid/rpki/gui/app/forms.py
+++ b/rpkid/rpki/gui/app/forms.py
@@ -210,43 +210,25 @@ class ChildForm(forms.ModelForm):
def ImportChildForm(parent_conf, *args, **kwargs):
class wrapped(forms.Form):
handle = forms.CharField(max_length=30, help_text="Child's RPKI handle")
-
- child = forms.ModelChoiceField(queryset=models.Conf.objects.all(), required=False,
- help_text="import locally hosted child")
- xml = forms.FileField(help_text="Child's identity.xml files", required=False)
+ xml = forms.FileField(help_text="Child's identity.xml file")
def clean_handle(self):
if parent_conf.children.filter(handle=self.cleaned_data['handle']):
raise forms.ValidationError, "a child with that handle already exists"
return self.cleaned_data['handle']
- def clean(self):
- if ((self.cleaned_data.get('child') and self.cleaned_data.get('xml')) or
- not (self.cleaned_data.get('child') or self.cleaned_data.get('xml'))):
- raise forms.ValidationError, "specify either a locally hosted resource handle OR identity.xml file"
- return self.cleaned_data
-
return wrapped(*args, **kwargs)
def ImportParentForm(conf, *args, **kwargs):
class wrapped(forms.Form):
handle = forms.CharField(max_length=30, help_text="Parent's RPKI handle")
-
- parent = forms.ModelChoiceField(queryset=models.Conf.objects.all(), required=False,
- help_text="import locally hosted parent")
- xml = forms.FileField(help_text="Parent's identity.xml files", required=False)
+ xml = forms.FileField(help_text="XML response from parent", required=False)
def clean_handle(self):
if conf.parents.filter(handle=self.cleaned_data['handle']):
raise forms.ValidationError, "a parent with that handle already exists"
return self.cleaned_data['handle']
- def clean(self):
- if ((self.cleaned_data.get('parent') and self.cleaned_data.get('xml')) or
- not (self.cleaned_data.get('parent') or self.cleaned_data.get('xml'))):
- raise forms.ValidationError, "specify either a locally hosted resource handle OR xml file"
- return self.cleaned_data
-
return wrapped(*args, **kwargs)
class ImportRepositoryForm(forms.Form):
@@ -256,15 +238,12 @@ class ImportRepositoryForm(forms.Form):
class ImportPubClientForm(forms.Form):
xml = forms.FileField(help_text='xml file from publication client')
-class InitializeForm(forms.Form):
- """
- Stub form for initialize new resource handles.
- """
- pass
-
def ChildWizardForm(parent, *args, **kwargs):
class wrapped(forms.Form):
handle = forms.CharField(max_length=30, help_text='handle for new child')
+ #create_user = forms.BooleanField(help_text='create a new user account for this handle?')
+ #password = forms.CharField(widget=forms.PasswordInput, help_text='password for new user', required=False)
+ #password2 = forms.CharField(widget=forms.PasswordInput, help_text='repeat password', required=False)
def clean_handle(self):
if parent.children.filter(handle=self.cleaned_data['handle']):
@@ -273,4 +252,10 @@ def ChildWizardForm(parent, *args, **kwargs):
return wrapped(*args, **kwargs)
+class GenericConfirmationForm(forms.Form):
+ """
+ stub form used for doing confirmations.
+ """
+ pass
+
# vim:sw=4 ts=8 expandtab