mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-22 11:38:45 -06:00
Closes #8593: Add link field to contact model
This commit is contained in:
@@ -98,9 +98,12 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
|
||||
max_length=200,
|
||||
required=False
|
||||
)
|
||||
link = forms.URLField(
|
||||
required=False
|
||||
)
|
||||
|
||||
model = Contact
|
||||
fieldsets = (
|
||||
(None, ('group', 'title', 'phone', 'email', 'address')),
|
||||
(None, ('group', 'title', 'phone', 'email', 'address', 'link')),
|
||||
)
|
||||
nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'comments')
|
||||
nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'link', 'comments')
|
||||
|
||||
@@ -79,4 +79,4 @@ class ContactCSVForm(NetBoxModelCSVForm):
|
||||
|
||||
class Meta:
|
||||
model = Contact
|
||||
fields = ('name', 'title', 'phone', 'email', 'address', 'group', 'comments')
|
||||
fields = ('name', 'title', 'phone', 'email', 'address', 'link', 'group', 'comments')
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from django import forms
|
||||
|
||||
from extras.models import Tag
|
||||
from netbox.forms import NetBoxModelForm
|
||||
from tenancy.models import *
|
||||
from utilities.forms import (
|
||||
BootstrapMixin, CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, SlugField, SmallTextarea,
|
||||
StaticSelect,
|
||||
BootstrapMixin, CommentField, DynamicModelChoiceField, SlugField, SmallTextarea, StaticSelect,
|
||||
)
|
||||
|
||||
__all__ = (
|
||||
@@ -87,13 +85,13 @@ class ContactForm(NetBoxModelForm):
|
||||
comments = CommentField()
|
||||
|
||||
fieldsets = (
|
||||
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'tags')),
|
||||
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'link', 'tags')),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Contact
|
||||
fields = (
|
||||
'group', 'name', 'title', 'phone', 'email', 'address', 'comments', 'tags',
|
||||
'group', 'name', 'title', 'phone', 'email', 'address', 'link', 'comments', 'tags',
|
||||
)
|
||||
widgets = {
|
||||
'address': SmallTextarea(attrs={'rows': 3}),
|
||||
|
||||
Reference in New Issue
Block a user