vpnmanager/manager/forms.py

13 lines
626 B
Python

from django import forms
from .models import Organization
class NetworkForm(forms.Form):
name = forms.CharField(label="Common Name", max_length=64)
intip = forms.GenericIPAddressField(label="Internal IP Address", protocol="ipv4")
extip = forms.GenericIPAddressField(label="External IP Address", protocol="ipv4")
orgas = forms.MultipleChoiceField(label="Assigned Organizations", choices=[(orga.id, str(orga)) for orga in Organization.objects.all()])
class OrgaForm(forms.Form):
name = forms.CharField(label="Common Name", max_length=64)
users = forms.IntegerField(label="User Limit", required=False)