mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Add description field to CircuitType (#3655)
This commit is contained in:
parent
3d5fb2491a
commit
a6904dc5d5
@ -136,13 +136,14 @@ PATCH) to maintain backward compatibility. This behavior will be discontinued be
|
|||||||
* [#3455](https://github.com/digitalocean/netbox/issues/3455) - Add tenant assignment to cluster
|
* [#3455](https://github.com/digitalocean/netbox/issues/3455) - Add tenant assignment to cluster
|
||||||
* [#3564](https://github.com/digitalocean/netbox/issues/3564) - Add list views for device components
|
* [#3564](https://github.com/digitalocean/netbox/issues/3564) - Add list views for device components
|
||||||
* [#3538](https://github.com/digitalocean/netbox/issues/3538) - Introduce a REST API endpoint for executing custom scripts
|
* [#3538](https://github.com/digitalocean/netbox/issues/3538) - Introduce a REST API endpoint for executing custom scripts
|
||||||
* [#3655](https://github.com/digitalocean/netbox/issues/3655) - Add `description` field to rack, device, VLAN/prefix, secret roles
|
* [#3655](https://github.com/digitalocean/netbox/issues/3655) - Add `description` field to organizational models
|
||||||
* [#3731](https://github.com/digitalocean/netbox/issues/3731) - Change Graph.type to a ContentType foreign key field
|
* [#3731](https://github.com/digitalocean/netbox/issues/3731) - Change Graph.type to a ContentType foreign key field
|
||||||
|
|
||||||
## API Changes
|
## API Changes
|
||||||
|
|
||||||
* Choice fields now use human-friendly strings for their values instead of integers (see [#3569](https://github.com/netbox-community/netbox/issues/3569)).
|
* Choice fields now use human-friendly strings for their values instead of integers (see [#3569](https://github.com/netbox-community/netbox/issues/3569)).
|
||||||
* Introduced `/api/extras/scripts/` endpoint for retrieving and executing custom scripts
|
* Introduced `/api/extras/scripts/` endpoint for retrieving and executing custom scripts
|
||||||
|
* circuits.CircuitType: Added field `description`
|
||||||
* dcim.ConsolePort: Added field `type`
|
* dcim.ConsolePort: Added field `type`
|
||||||
* dcim.ConsolePortTemplate: Added field `type`
|
* dcim.ConsolePortTemplate: Added field `type`
|
||||||
* dcim.ConsoleServerPort: Added field `type`
|
* dcim.ConsoleServerPort: Added field `type`
|
||||||
|
@ -36,7 +36,7 @@ class CircuitTypeSerializer(ValidatedModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = CircuitType
|
model = CircuitType
|
||||||
fields = ['id', 'name', 'slug', 'circuit_count']
|
fields = ['id', 'name', 'slug', 'description', 'circuit_count']
|
||||||
|
|
||||||
|
|
||||||
class CircuitSerializer(TaggitSerializer, CustomFieldModelSerializer):
|
class CircuitSerializer(TaggitSerializer, CustomFieldModelSerializer):
|
||||||
|
@ -128,7 +128,7 @@ class CircuitTypeForm(BootstrapMixin, forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = CircuitType
|
model = CircuitType
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'slug',
|
'name', 'slug', 'description',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
18
netbox/circuits/migrations/0017_circuittype_description.py
Normal file
18
netbox/circuits/migrations/0017_circuittype_description.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2.6 on 2019-12-10 18:19
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('circuits', '0016_3569_circuit_fields'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='circuittype',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, max_length=100),
|
||||||
|
),
|
||||||
|
]
|
@ -98,8 +98,12 @@ class CircuitType(ChangeLoggedModel):
|
|||||||
slug = models.SlugField(
|
slug = models.SlugField(
|
||||||
unique=True
|
unique=True
|
||||||
)
|
)
|
||||||
|
description = models.CharField(
|
||||||
|
max_length=100,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
csv_headers = ['name', 'slug']
|
csv_headers = ['name', 'slug', 'description']
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['name']
|
ordering = ['name']
|
||||||
@ -114,6 +118,7 @@ class CircuitType(ChangeLoggedModel):
|
|||||||
return (
|
return (
|
||||||
self.name,
|
self.name,
|
||||||
self.slug,
|
self.slug,
|
||||||
|
self.description,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,12 +50,14 @@ class CircuitTypeTable(BaseTable):
|
|||||||
name = tables.LinkColumn()
|
name = tables.LinkColumn()
|
||||||
circuit_count = tables.Column(verbose_name='Circuits')
|
circuit_count = tables.Column(verbose_name='Circuits')
|
||||||
actions = tables.TemplateColumn(
|
actions = tables.TemplateColumn(
|
||||||
template_code=CIRCUITTYPE_ACTIONS, attrs={'td': {'class': 'text-right noprint'}}, verbose_name=''
|
template_code=CIRCUITTYPE_ACTIONS,
|
||||||
|
attrs={'td': {'class': 'text-right noprint'}},
|
||||||
|
verbose_name=''
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta(BaseTable.Meta):
|
class Meta(BaseTable.Meta):
|
||||||
model = CircuitType
|
model = CircuitType
|
||||||
fields = ('pk', 'name', 'circuit_count', 'slug', 'actions')
|
fields = ('pk', 'name', 'circuit_count', 'description', 'slug', 'actions')
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user