diff --git a/conntrackt/forms.py b/conntrackt/forms.py --- a/conntrackt/forms.py +++ b/conntrackt/forms.py @@ -2,7 +2,7 @@ from django.forms import ModelForm # Application imports. -from .models import Project, Entity, Interface, Communication +from .models import Project, Location, Entity, Interface, Communication class WidgetCSSClassFormMixin(object): @@ -121,3 +121,17 @@ class ProjectForm(WidgetCSSClassFormMixi "description": "Project description"} widget_css_classes = {"ALL": "span6"} + + +class LocationForm(WidgetCSSClassFormMixin, PlaceholderFormMixin, ModelForm): + """ + Implements a custom model form for projects with some styling changes. + """ + + class Meta: + model = Location + + widget_placeholders = {"name": "Location name", + "description": "Location description"} + + widget_css_classes = {"ALL": "span6"}