diff --git a/mayan/apps/documents/models.py b/mayan/apps/documents/models.py index e08c91a4e8..046c31d8c5 100644 --- a/mayan/apps/documents/models.py +++ b/mayan/apps/documents/models.py @@ -540,7 +540,7 @@ class DocumentTypeFilename(models.Model): List of filenames available to a specific document type for the quick rename functionality """ - document_type = models.ForeignKey(DocumentType, verbose_name=_(u'Document type')) + document_type = models.ForeignKey(DocumentType, related_name='filenames', verbose_name=_(u'Document type')) filename = models.CharField(max_length=128, verbose_name=_(u'Filename'), db_index=True) enabled = models.BooleanField(default=True, verbose_name=_(u'Enabled')) diff --git a/mayan/apps/documents/views.py b/mayan/apps/documents/views.py index 17dc097c21..f11cc11acc 100644 --- a/mayan/apps/documents/views.py +++ b/mayan/apps/documents/views.py @@ -920,7 +920,7 @@ def document_type_filename_list(request, document_type_id): document_type = get_object_or_404(DocumentType, pk=document_type_id) context = { - 'object_list': document_type.documenttypefilename_set.all(), + 'object_list': document_type.filenames.all(), 'title': _(u'filenames for document type: %s') % document_type, 'object_name': _(u'Document type'), 'navigation_object_name': 'document_type',