當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。