Files
mayan-edms/mayan/apps/events/apps.py
Roberto Rosario 8179c35189 Simplify test runner by adding a new option '--mayan-apps' that
automatically tests all Mayan apps that report to have tests.
Change the app flag that indicates when an app has test
from 'test' to the more explicit 'has_test'.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-03-14 23:47:40 -04:00

36 lines
1.0 KiB
Python

from __future__ import unicode_literals
from django.apps import apps
from django.utils.translation import ugettext_lazy as _
from common import MayanAppConfig, menu_tools
from navigation import SourceColumn
from rest_api.classes import APIEndPoint
from .links import link_events_list
from .licenses import * # NOQA
from .widgets import event_type_link
class EventsApp(MayanAppConfig):
has_tests = True
name = 'events'
verbose_name = _('Events')
def ready(self):
super(EventsApp, self).ready()
Action = apps.get_model(app_label='actstream', model_name='Action')
APIEndPoint(app=self, version_string='1')
SourceColumn(
source=Action, label=_('Timestamp'), attribute='timestamp'
)
SourceColumn(source=Action, label=_('Actor'), attribute='actor')
SourceColumn(
source=Action, label=_('Verb'),
func=lambda context: event_type_link(context['object'])
)
menu_tools.bind_links(links=(link_events_list,))