示例#1
0
文件: matter.py 项目: rosscdh/toolkit
from ..serializers import MatterSerializer
from ..serializers.matter import LiteMatterSerializer
from ..serializers.revision import EXT_WHITELIST
from ..serializers.attachment import ATTACHMENT_EXT_WHITELIST

from toolkit.apps.notification.template_loaders import ACTIVITY_TEMPLATES

import logging
logger = logging.getLogger('django.request')


#
# Have to re-output the variable names here
# can adapt them to the ng variable style here as desired
#
ITEM_COMMENTS_TEMPLATE = render_to_string(ACTIVITY_TEMPLATES.get('item-commented').name, {
    'actor_name': '{{ actor_name }}',
    'action_object_name': '{{ action_object_name }}',
    'timesince': '{{ timesince }}',
    'comment': '{{ comment }}',
})


class MatterEndpoint(viewsets.ModelViewSet):
    """
    Primary Matter ViewSet
    """
    model = Workspace
    serializer_class = MatterSerializer
    lookup_field = 'slug'
    renderer_classes = (_MetaJSONRendererMixin, )
示例#2
0
 def _get_template(verb_slug):
     return ACTIVITY_TEMPLATES.get(verb_slug, ACTIVITY_TEMPLATES.get('default'))