Refactor the ModelAttribute class into two separate classes: ModelAttribute for executable model attributes and ModelField for actual ORM fields. Expose more document fields for use in smart links.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-17 02:43:04 -04:00
parent fafdb538b3
commit 03c54395cc
11 changed files with 196 additions and 77 deletions

View File

@@ -5,7 +5,7 @@ from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessControlList
from common.classes import ModelAttribute
from common.classes import ModelProperty
from documents.models import Document
from .models import Index, IndexTemplateNode
@@ -40,8 +40,9 @@ class IndexTemplateNodeForm(forms.ModelForm):
self.fields['expression'].help_text = ' '.join(
[
force_text(self.fields['expression'].help_text),
ModelAttribute.help_text_for(
Document, type_names=['indexing']
'<br>',
ModelProperty.get_help_text_for(
model=Document, show_name=True
).replace('\n', '<br>')
]
)