@view_config(route_name='admin:operations:log', renderer='/admin/operations-log.mako')
@view_config(route_name='admin:operations:log_paginated', renderer='/admin/operations-log.mako')
def operations_log(self):
    _items_per_page = 25
    (event_type, event_type_id) = self._parse__event_type()
    event_type_ids = ((event_type_id,) if event_type_id else None)
    items_count = lib_db.get.get__OperationsEvent__count(self.request.api_context, event_type_ids=event_type_ids)
    _url_template = ('%s/operations/log/{0}' % self.request.registry.settings['app_settings']['admin_prefix'])
    if event_type:
        _url_template = ('%s/operations/log/{0}?event_type=%s' % (self.request.registry.settings['app_settings']['admin_prefix'], event_type))
    (pager, offset) = self._paginate(items_count, url_template=_url_template, items_per_page=_items_per_page)
    items_paged = lib_db.get.get__OperationsEvent__paginated(self.request.api_context, event_type_ids=event_type_ids, limit=_items_per_page, offset=offset)
    return {'project': 'peter_sslers', 'OperationsEvent__count': items_count, 'OperationsEvents': items_paged, 'pager': pager, 'enable_redis': self.request.registry.settings['app_settings']['enable_redis'], 'enable_nginx': self.request.registry.settings['app_settings']['enable_nginx'], 'event_type': event_type}
@view_config(route_name='admin:operations:log', renderer='/admin/operations-log.mako')
@view_config(route_name='admin:operations:log_paginated', renderer='/admin/operations-log.mako')
def operations_log(self):
    _items_per_page = 25
    (event_type, event_type_id) = self._parse__event_type()
    event_type_ids = ((event_type_id,) if event_type_id else None)
    items_count = lib_db.get.get__OperationsEvent__count(self.request.api_context, event_type_ids=event_type_ids)
    _url_template = ('%s/operations/log/{0}' % self.request.registry.settings['app_settings']['admin_prefix'])
    if event_type:
        _url_template = ('%s/operations/log/{0}?event_type=%s' % (self.request.registry.settings['app_settings']['admin_prefix'], event_type))
    (pager, offset) = self._paginate(items_count, url_template=_url_template, items_per_page=_items_per_page)
    items_paged = lib_db.get.get__OperationsEvent__paginated(self.request.api_context, event_type_ids=event_type_ids, limit=_items_per_page, offset=offset)
    return {'project': 'peter_sslers', 'OperationsEvent__count': items_count, 'OperationsEvents': items_paged, 'pager': pager, 'enable_redis': self.request.registry.settings['app_settings']['enable_redis'], 'enable_nginx': self.request.registry.settings['app_settings']['enable_nginx'], 'event_type': event_type}