Show the available document attributes during document indexing setup form

This commit is contained in:
Roberto Rosario
2014-11-11 03:01:49 -04:00
parent 0916bbacb0
commit 924dfc0a4c

View File

@@ -2,6 +2,9 @@ from __future__ import absolute_import
from django import forms
from common.classes import ModelAttribute
from documents.models import Document
from .models import Index, IndexTemplateNode
@@ -22,6 +25,7 @@ class IndexTemplateNodeForm(forms.ModelForm):
super(IndexTemplateNodeForm, self).__init__(*args, **kwargs)
self.fields['index'].widget = forms.widgets.HiddenInput()
self.fields['parent'].widget = forms.widgets.HiddenInput()
self.fields['expression'].help_text = ' '.join([unicode(self.fields['expression'].help_text), ModelAttribute.help_text_for(Document, type_names=['indexing'])])
class Meta:
model = IndexTemplateNode