propose uuid-name for doors
This commit is contained in:
parent
ba036fe900
commit
e81af28efa
1 changed files with 4 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue