propose uuid-name for doors

This commit is contained in:
Laura Klünder 2016-10-16 15:56:24 +02:00
parent ba036fe900
commit e81af28efa

View file

@ -1,4 +1,5 @@
import json
import uuid
from collections import OrderedDict
from django.conf import settings
@ -22,6 +23,9 @@ class FeatureFormMixin(ModelForm):
if not creating and not settings.DIRECT_EDITING:
self.fields['name'].disabled = True
if creating and self._meta.model in (Door, ):
self.fields['name'].initial = uuid.uuid4()
# restrict package choices and field_name
if not creating:
if not settings.DIRECT_EDITING: