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

Minimal implemtnation of custom fields

This commit is contained in:
Jeremy Stretch
2016-08-15 15:24:23 -04:00
parent 550a05487d
commit 6cdb62b67e
32 changed files with 244 additions and 60 deletions

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-12 19:52
# Generated by Django 1.10 on 2016-08-15 19:18
from __future__ import unicode_literals
from django.db import migrations, models
@ -20,11 +20,11 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.PositiveSmallIntegerField(choices=[(100, b'Text'), (200, b'Integer'), (300, b'Boolean (true/false)'), (400, b'Date'), (500, b'Selection')], default=100)),
('name', models.CharField(max_length=50, unique=True)),
('label', models.CharField(help_text=b'Name of the field as displayed to users', max_length=50)),
('label', models.CharField(blank=True, help_text=b"Name of the field as displayed to users (if not provided, the field's name will be used)", max_length=50)),
('description', models.CharField(blank=True, max_length=100)),
('required', models.BooleanField(default=False, help_text=b'This field is required when creating new objects')),
('default', models.CharField(blank=True, help_text=b'Default value for the field', max_length=100)),
('obj_type', models.ManyToManyField(related_name='custom_fields', to='contenttypes.ContentType')),
('required', models.BooleanField(default=False, help_text=b'Determines whether this field is required when creating new objects or editing an existing object.')),
('default', models.CharField(blank=True, help_text=b'Default value for the field. N/A for selection fields.', max_length=100)),
('obj_type', models.ManyToManyField(help_text=b'The object(s) to which this field applies.', related_name='custom_fields', to='contenttypes.ContentType', verbose_name=b'Object(s)')),
],
options={
'ordering': ['name'],
@ -57,6 +57,10 @@ class Migration(migrations.Migration):
'ordering': ['obj_type', 'obj_id'],
},
),
migrations.AlterUniqueTogether(
name='customfieldvalue',
unique_together=set([('field', 'obj_type', 'obj_id')]),
),
migrations.AlterUniqueTogether(
name='customfieldchoice',
unique_together=set([('field', 'value')]),