mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Standardize description & comments fields on primary models * Update REST API serializers * Update forms * Update tables * Update templates
This commit is contained in:
@@ -2,7 +2,7 @@ from django import forms
|
||||
|
||||
from netbox.forms import NetBoxModelBulkEditForm
|
||||
from tenancy.models import *
|
||||
from utilities.forms import DynamicModelChoiceField
|
||||
from utilities.forms import CommentField, DynamicModelChoiceField, SmallTextarea
|
||||
|
||||
__all__ = (
|
||||
'ContactBulkEditForm',
|
||||
@@ -101,9 +101,17 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
|
||||
link = forms.URLField(
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
required=False
|
||||
)
|
||||
comments = CommentField(
|
||||
widget=SmallTextarea,
|
||||
label='Comments'
|
||||
)
|
||||
|
||||
model = Contact
|
||||
fieldsets = (
|
||||
(None, ('group', 'title', 'phone', 'email', 'address', 'link')),
|
||||
(None, ('group', 'title', 'phone', 'email', 'address', 'link', 'description')),
|
||||
)
|
||||
nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'link', 'comments')
|
||||
nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'link', 'description', 'comments')
|
||||
|
@@ -79,4 +79,4 @@ class ContactCSVForm(NetBoxModelCSVForm):
|
||||
|
||||
class Meta:
|
||||
model = Contact
|
||||
fields = ('name', 'title', 'phone', 'email', 'address', 'link', 'group', 'comments')
|
||||
fields = ('name', 'title', 'phone', 'email', 'address', 'link', 'group', 'description', 'comments')
|
||||
|
@@ -103,13 +103,13 @@ class ContactForm(NetBoxModelForm):
|
||||
comments = CommentField()
|
||||
|
||||
fieldsets = (
|
||||
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'link', 'tags')),
|
||||
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'link', 'description', 'tags')),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Contact
|
||||
fields = (
|
||||
'group', 'name', 'title', 'phone', 'email', 'address', 'link', 'comments', 'tags',
|
||||
'group', 'name', 'title', 'phone', 'email', 'address', 'link', 'description', 'comments', 'tags',
|
||||
)
|
||||
widgets = {
|
||||
'address': SmallTextarea(attrs={'rows': 3}),
|
||||
|
Reference in New Issue
Block a user