当前位置: 首页>>代码示例>>Python>>正文


Python models.EventLog类代码示例

本文整理汇总了Python中editors.models.EventLog的典型用法代码示例。如果您正苦于以下问题:Python EventLog类的具体用法?Python EventLog怎么用?Python EventLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventLog类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: home

def home(request):
    data = context(reviews_total=Approval.total_reviews(),
                   reviews_monthly=Approval.monthly_reviews(),
                   new_editors=EventLog.new_editors(),
                   eventlog=ActivityLog.objects.editor_events()[:6])

    return jingo.render(request, 'editors/home.html', data)
开发者ID:LittleForker,项目名称:zamboni,代码行数:7,代码来源:views.py

示例2: home

def home(request):
    if (not acl.action_allowed(request, 'Addons', 'Review') and
            acl.action_allowed(request, 'Personas', 'Review')):
        return http.HttpResponseRedirect(reverse('editors.themes.home'))

    motd_editable = acl.action_allowed(request, 'AddonReviewerMOTD', 'Edit')
    durations = (('new', _('New Add-ons (Under 5 days)')),
                 ('med', _('Passable (5 to 10 days)')),
                 ('old', _('Overdue (Over 10 days)')))

    progress, percentage = _editor_progress()
    unlisted_progress, unlisted_percentage = _editor_progress(unlisted=True)
    reviews_max_display = getattr(settings, 'EDITOR_REVIEWS_MAX_DISPLAY', 5)
    reviews_total = ActivityLog.objects.total_reviews()[:reviews_max_display]
    reviews_monthly = (
        ActivityLog.objects.monthly_reviews()[:reviews_max_display])
    reviews_total_count = ActivityLog.objects.user_approve_reviews(
        request.user).count()
    reviews_monthly_count = (
        ActivityLog.objects.current_month_user_approve_reviews(
            request.user).count())

    # Try to read user position from retrieved reviews.
    # If not available, query for it.
    reviews_total_position = (
        ActivityLog.objects.user_position(reviews_total, request.user)
        or ActivityLog.objects.total_reviews_user_position(request.user))

    reviews_monthly_position = (
        ActivityLog.objects.user_position(reviews_monthly, request.user)
        or ActivityLog.objects.monthly_reviews_user_position(request.user))

    data = context(
        request,
        reviews_total=reviews_total,
        reviews_monthly=reviews_monthly,
        reviews_total_count=reviews_total_count,
        reviews_monthly_count=reviews_monthly_count,
        reviews_total_position=reviews_total_position,
        reviews_monthly_position=reviews_monthly_position,
        new_editors=EventLog.new_editors(),
        eventlog=ActivityLog.objects.editor_events()[:6],
        progress=progress,
        unlisted_progress=unlisted_progress,
        percentage=percentage,
        unlisted_percentage=unlisted_percentage,
        durations=durations,
        reviews_max_display=reviews_max_display,
        motd_editable=motd_editable,
        queue_counts_total=queue_counts(admin_reviewer=True),
        unlisted_queue_counts_total=queue_counts(admin_reviewer=True,
                                                 unlisted=True),
    )

    return render(request, 'editors/home.html', data)
开发者ID:ddurst,项目名称:olympia,代码行数:55,代码来源:views.py

示例3: home

def home(request):
    if not acl.action_allowed(request, "Addons", "Review") and acl.action_allowed(request, "Personas", "Review"):
        return http.HttpResponseRedirect(reverse("editors.themes.home"))

    motd_editable = acl.action_allowed(request, "AddonReviewerMOTD", "Edit")
    durations = (
        ("new", _("New Add-ons (Under 5 days)")),
        ("med", _("Passable (5 to 10 days)")),
        ("old", _("Overdue (Over 10 days)")),
    )

    progress, percentage = _editor_progress()
    unlisted_progress, unlisted_percentage = _editor_progress(unlisted=True)
    reviews_max_display = getattr(settings, "EDITOR_REVIEWS_MAX_DISPLAY", 5)
    reviews_total = ActivityLog.objects.total_reviews()[:reviews_max_display]
    reviews_monthly = ActivityLog.objects.monthly_reviews()[:reviews_max_display]
    reviews_total_count = ActivityLog.objects.user_approve_reviews(request.user).count()
    reviews_monthly_count = ActivityLog.objects.current_month_user_approve_reviews(request.user).count()

    # Try to read user position from retrieved reviews.
    # If not available, query for it.
    reviews_total_position = ActivityLog.objects.user_position(
        reviews_total, request.user
    ) or ActivityLog.objects.total_reviews_user_position(request.user)

    reviews_monthly_position = ActivityLog.objects.user_position(
        reviews_monthly, request.user
    ) or ActivityLog.objects.monthly_reviews_user_position(request.user)

    data = context(
        request,
        reviews_total=reviews_total,
        reviews_monthly=reviews_monthly,
        reviews_total_count=reviews_total_count,
        reviews_monthly_count=reviews_monthly_count,
        reviews_total_position=reviews_total_position,
        reviews_monthly_position=reviews_monthly_position,
        new_editors=EventLog.new_editors(),
        eventlog=ActivityLog.objects.editor_events()[:6],
        progress=progress,
        unlisted_progress=unlisted_progress,
        percentage=percentage,
        unlisted_percentage=unlisted_percentage,
        durations=durations,
        reviews_max_display=reviews_max_display,
        motd_editable=motd_editable,
        queue_counts_total=queue_counts(admin_reviewer=True),
        unlisted_queue_counts_total=queue_counts(admin_reviewer=True, unlisted=True),
    )

    return render(request, "editors/home.html", data)
开发者ID:EnTeQuAk,项目名称:olympia,代码行数:51,代码来源:views.py

示例4: home

def home(request):
    durations = (('new', _('New Add-ons (Under 5 days)')),
                 ('med', _('Passable (5 to 10 days)')),
                 ('old', _('Overdue (Over 10 days)')))

    progress, percentage = _editor_progress()

    data = context(reviews_total=ActivityLog.objects.total_reviews()[:5],
                   reviews_monthly=ActivityLog.objects.monthly_reviews()[:5],
                   new_editors=EventLog.new_editors(),
                   eventlog=ActivityLog.objects.editor_events()[:6],
                   progress=progress, percentage=percentage,
                   durations=durations)

    return jingo.render(request, 'editors/home.html', data)
开发者ID:PinZhang,项目名称:zamboni,代码行数:15,代码来源:views.py

示例5: home

def home(request):
    durations = (('new', _('New Add-ons (Under 5 days)')),
                 ('med', _('Passable (5 to 10 days)')),
                 ('old', _('Overdue (Over 10 days)')))

    progress, percentage = _editor_progress()
    reviews_max_display = getattr(settings, 'EDITOR_REVIEWS_MAX_DISPLAY', 5)
    reviews_total = ActivityLog.objects.total_reviews()[:reviews_max_display]
    reviews_monthly = (
        ActivityLog.objects.monthly_reviews()[:reviews_max_display])
    reviews_total_count = ActivityLog.objects.total_reviews().count()
    reviews_monthly_count = ActivityLog.objects.total_reviews().count()

    # Try to read user position from retrieved reviews.
    # If not available, query for it.
    reviews_total_position = (
        ActivityLog.objects.user_position(reviews_total, request.user)
        or ActivityLog.objects.total_reviews_user_position(request.user))

    reviews_monthly_position = (
        ActivityLog.objects.user_position(reviews_monthly, request.user)
        or ActivityLog.objects.monthly_reviews_user_position(request.user))

    data = context(
        reviews_total=reviews_total,
        reviews_monthly=reviews_monthly,
        reviews_total_count=reviews_total_count,
        reviews_monthly_count=reviews_monthly_count,
        reviews_total_position=reviews_total_position,
        reviews_monthly_position=reviews_monthly_position,
        new_editors=EventLog.new_editors(),
        eventlog=ActivityLog.objects.editor_events()[:6],
        progress=progress,
        percentage=percentage,
        durations=durations,
        reviews_max_display=reviews_max_display)

    return jingo.render(request, 'editors/home.html', data)
开发者ID:aricha,项目名称:zamboni,代码行数:38,代码来源:views.py


注:本文中的editors.models.EventLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。