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

@ -15,6 +15,7 @@ from django.utils.decorators import method_decorator
from django.utils.http import is_safe_url
from django.views.generic import View
from extras.forms import CustomFieldForm
from extras.models import ExportTemplate, UserAction
from .error_handlers import handle_protectederror
@ -135,6 +136,8 @@ class ObjectEditView(View):
obj = form.save(commit=False)
obj_created = not obj.pk
obj.save()
if isinstance(form, CustomFieldForm):
form.save_custom_fields()
msg = u'Created ' if obj_created else u'Modified '
msg += self.model._meta.verbose_name