mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Documentation and cleanup
This commit is contained in:
@@ -20,6 +20,7 @@ class CustomFieldForm(forms.ModelForm):
|
||||
|
||||
class CustomFieldChoiceAdmin(admin.TabularInline):
|
||||
model = CustomFieldChoice
|
||||
extra = 5
|
||||
|
||||
|
||||
@admin.register(CustomField)
|
||||
|
@@ -54,7 +54,7 @@ def get_custom_fields_for_model(content_type, bulk_editing=False):
|
||||
field = forms.CharField(max_length=255, required=cf.required, initial=cf.default)
|
||||
|
||||
field.model = cf
|
||||
field.label = cf.label if cf.label else cf.name.capitalize()
|
||||
field.label = cf.label if cf.label else cf.name.replace('_', ' ').capitalize()
|
||||
field.help_text = cf.description
|
||||
|
||||
field_dict[field_name] = field
|
||||
|
@@ -98,7 +98,7 @@ class CustomField(models.Model):
|
||||
ordering = ['name']
|
||||
|
||||
def __unicode__(self):
|
||||
return self.label or self.name.capitalize()
|
||||
return self.label or self.name.replace('_', ' ').capitalize()
|
||||
|
||||
def serialize_value(self, value):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user