vpnmanager/manager/forms.py

14 lines
626 B
Python
Raw Normal View History

2019-02-02 15:01:18 +00:00
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)