Files
mayan-edms/mayan/apps/linking/managers.py
2015-01-19 04:06:40 -04:00

9 lines
347 B
Python

from django.db import models
from .classes import ResolvedSmartLink
class SmartLinkManager(models.Manager):
def get_for(self, document):
return [ResolvedSmartLink(smart_link=smart_link, queryset=smart_link.get_linked_document_for(document)) for smart_link in self.filter(enabled=True).filter(document_types=document.document_type)]