mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-25 12:59:59 -06:00
Minimal implemtnation of custom fields
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
from django import forms
|
||||
from django.db.models import Count
|
||||
|
||||
from utilities.forms import (
|
||||
BootstrapMixin, BulkImportForm, CommentField, CSVDataField, SlugField,
|
||||
)
|
||||
from extras.forms import CustomFieldForm
|
||||
from utilities.forms import BootstrapMixin, BulkImportForm, CommentField, CSVDataField, SlugField
|
||||
|
||||
from .models import Tenant, TenantGroup
|
||||
|
||||
@@ -48,7 +47,7 @@ class TenantGroupForm(forms.ModelForm, BootstrapMixin):
|
||||
# Tenants
|
||||
#
|
||||
|
||||
class TenantForm(forms.ModelForm, BootstrapMixin):
|
||||
class TenantForm(BootstrapMixin, CustomFieldForm):
|
||||
slug = SlugField()
|
||||
comments = CommentField()
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db import models
|
||||
|
||||
from extras.models import CustomFieldModel
|
||||
from utilities.models import CreatedUpdatedModel
|
||||
|
||||
|
||||
@@ -21,7 +22,7 @@ class TenantGroup(models.Model):
|
||||
return "{}?group={}".format(reverse('tenancy:tenant_list'), self.slug)
|
||||
|
||||
|
||||
class Tenant(CreatedUpdatedModel):
|
||||
class Tenant(CreatedUpdatedModel, CustomFieldModel):
|
||||
"""
|
||||
A Tenant represents an organization served by the NetBox owner. This is typically a customer or an internal
|
||||
department.
|
||||
|
||||
Reference in New Issue
Block a user