mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Added description to ConfigContext
This commit is contained in:
@ -140,7 +140,9 @@ class ConfigContextSerializer(ValidatedModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = ConfigContext
|
||||
fields = ['name', 'weight', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenants', 'data']
|
||||
fields = [
|
||||
'name', 'weight', 'description', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenants', 'data',
|
||||
]
|
||||
|
||||
|
||||
#
|
||||
|
@ -197,7 +197,9 @@ class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = ConfigContext
|
||||
fields = ['name', 'weight', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenants', 'data']
|
||||
fields = [
|
||||
'name', 'weight', 'description', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenants', 'data',
|
||||
]
|
||||
|
||||
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Generated by Django 2.0.6 on 2018-06-27 17:45
|
||||
# Generated by Django 2.0.6 on 2018-06-29 13:34
|
||||
|
||||
import django.contrib.postgres.fields.jsonb
|
||||
from django.db import migrations, models
|
||||
@ -20,6 +20,7 @@ class Migration(migrations.Migration):
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('weight', models.PositiveSmallIntegerField(default=1000)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('description', models.CharField(blank=True, max_length=100)),
|
||||
('data', django.contrib.postgres.fields.jsonb.JSONField()),
|
||||
('platforms', models.ManyToManyField(blank=True, related_name='_configcontext_platforms_+', to='dcim.Platform')),
|
||||
('regions', models.ManyToManyField(blank=True, related_name='_configcontext_regions_+', to='dcim.Region')),
|
@ -646,6 +646,10 @@ class ConfigContext(models.Model):
|
||||
weight = models.PositiveSmallIntegerField(
|
||||
default=1000
|
||||
)
|
||||
description = models.CharField(
|
||||
max_length=100,
|
||||
blank=True
|
||||
)
|
||||
is_active = models.BooleanField(
|
||||
default=True,
|
||||
)
|
||||
|
@ -70,7 +70,7 @@ class ConfigContextTable(BaseTable):
|
||||
|
||||
class Meta(BaseTable.Meta):
|
||||
model = ConfigContext
|
||||
fields = ('pk', 'name', 'weight', 'is_active')
|
||||
fields = ('pk', 'name', 'weight', 'is_active', 'description', 'actions')
|
||||
|
||||
|
||||
class ObjectChangeTable(BaseTable):
|
||||
|
@ -7,7 +7,13 @@
|
||||
<div class="panel-body">
|
||||
{% render_field form.name %}
|
||||
{% render_field form.weight %}
|
||||
{% render_field form.description %}
|
||||
{% render_field form.is_active %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Assignment</strong></div>
|
||||
<div class="panel-body">
|
||||
{% render_field form.regions %}
|
||||
{% render_field form.sites %}
|
||||
{% render_field form.roles %}
|
||||
|
@ -26,6 +26,9 @@
|
||||
<span class="text-muted">{{ context.weight }}</span>
|
||||
</div>
|
||||
<a href="{{ context.get_absolute_url }}"><strong>{{ context.name }}</strong></a>
|
||||
{% if context.description %}
|
||||
<br /><small>{{ context.description }}</small>
|
||||
{% endif %}
|
||||
<pre>{{ context.data|render_json }}</pre>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user