mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 20:06:25 -06:00
Model cleanup
This commit is contained in:
parent
90cf71ba58
commit
e46d9a6d29
@ -60,8 +60,8 @@ class Migration(migrations.Migration):
|
||||
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||
('description', models.CharField(blank=True, max_length=200)),
|
||||
('comments', models.TextField(blank=True)),
|
||||
('mac_address', dcim.fields.MACAddressField(blank=True, null=True)),
|
||||
('is_primary', models.BooleanField(default=False)),
|
||||
('mac_address', dcim.fields.MACAddressField()),
|
||||
('is_primary', models.BooleanField(default=True)),
|
||||
('assigned_object_id', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('assigned_object_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface')), models.Q(('app_label', 'virtualization'), ('model', 'vminterface')), _connector='OR')), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='contenttypes.contenttype')),
|
||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||
|
@ -1484,8 +1484,6 @@ class VirtualDeviceContext(PrimaryModel):
|
||||
|
||||
class MACAddress(PrimaryModel):
|
||||
mac_address = MACAddressField(
|
||||
null=True,
|
||||
blank=True,
|
||||
verbose_name=_('MAC address')
|
||||
)
|
||||
assigned_object_type = models.ForeignKey(
|
||||
@ -1506,7 +1504,7 @@ class MACAddress(PrimaryModel):
|
||||
)
|
||||
is_primary = models.BooleanField(
|
||||
verbose_name=_('is primary for interface'),
|
||||
default=False
|
||||
default=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
@ -1515,7 +1513,7 @@ class MACAddress(PrimaryModel):
|
||||
verbose_name_plural = _('MAC addresses')
|
||||
|
||||
def __str__(self):
|
||||
return f'{str(self.mac_address)} {self.assigned_object}'
|
||||
return str(self.mac_address)
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
Loading…
Reference in New Issue
Block a user