from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_noop

from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader
from corehq.apps.reports.generic import GenericTabularReport
from corehq.apps.reports.standard import ProjectReport


class WebUserActivityReport(GenericTabularReport, ProjectReport):
    slug = 'web_user_activity'
    name = ugettext_noop("Web User Activity")

    fields = [
        'corehq.apps.reports.filters.dates.DatespanFilter',
        'corehq.apps.reports.filters.simple.SimpleUsername',
    ]

    @property
    def headers(self):
        return DataTablesHeader(
            DataTablesColumn(_("Username")),
            DataTablesColumn(_("Activity")),
        )

    @property
    def rows(self):
        yield ['test1', 'downloaded something']
        yield ['test1', 'downloaded something']
        yield ['test1', 'exported something']

@@ -96,16 +96,78 @@
 t_noop%0A%0A
+from corehq.apps.auditcare.models import NavigationEventAudit%0A
 from cor
@@ -337,16 +337,31 @@
 d import
+ DatespanMixin,
  Project
@@ -397,16 +397,31 @@
 yReport(
+DatespanMixin, 
 GenericT
@@ -822,204 +822,964 @@
 (_(%22
-Activity%22)),%0A        )%0A%0A    @property%0A    def rows(self):%0A        yield %5B'test1', 'downloaded something'%5D%0A        yield %5B'test1', 'downloaded something'%5D%0A        yield %5B'test1', 'exported something'%5D
+Date%22)),%0A            DataTablesColumn(_(%22Request Path%22)),%0A            DataTablesColumn(_(%22View Name%22)),%0A            DataTablesColumn(_(%22Params%22)),%0A            DataTablesColumn(_(%22View Kwargs%22)),%0A            DataTablesColumn(_(%22Status%22)),%0A        )%0A%0A    @property%0A    def rows(self):%0A        events = self._get_navigation_events()%0A        for event in events:%0A            yield %5B%0A                event.user,%0A                event.event_date,%0A                event.path,%0A                event.view,%0A                event.params,%0A                event.view_kwargs,%0A                event.status_code,%0A            %5D%0A%0A    def _get_navigation_events(self):%0A        username = self.request.GET.get('username')%0A        return NavigationEventAudit.objects.filter(%0A            domain=self.domain,%0A            user=username,%0A            event_date__gt=self.datespan.startdate,%0A            event_date__lt=self.datespan.enddate_adjusted,%0A        ).select_related('view_fk')
 %0A

Include real data