1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Added JS for SlugField autofill

This commit is contained in:
Jeremy Stretch
2016-05-20 15:32:17 -04:00
parent 5a2946b146
commit bbdc7dccba
7 changed files with 47 additions and 6 deletions

View File

@ -4,6 +4,7 @@ from django.db.models import Count
from dcim.models import Site, Device, Interface, Rack, IFACE_FF_VIRTUAL
from utilities.forms import (
APISelect, BootstrapMixin, BulkImportForm, CommentField, ConfirmationForm, CSVDataField, Livesearch, SmallTextarea,
SlugField,
)
from .models import PORT_SPEED_CHOICES, Circuit, CircuitType, Provider
@ -14,6 +15,7 @@ from .models import PORT_SPEED_CHOICES, Circuit, CircuitType, Provider
#
class ProviderForm(forms.ModelForm, BootstrapMixin):
slug = SlugField()
comments = CommentField()
class Meta:
@ -25,7 +27,6 @@ class ProviderForm(forms.ModelForm, BootstrapMixin):
}
help_texts = {
'name': "Full name of the provider",
'slug': "URL-friendly unique shorthand (e.g. 'decix' for DE-CIX)",
'asn': "BGP autonomous system number (if applicable)",
'portal_url': "URL of the provider's customer support portal",
'noc_contact': "NOC email address and phone number",
@ -63,6 +64,7 @@ class ProviderBulkDeleteForm(ConfirmationForm):
#
class CircuitTypeForm(forms.ModelForm, BootstrapMixin):
slug = SlugField()
class Meta:
model = CircuitType