def site_wide_announcements(request):
    """Adds the site-wide announcements to the global context of templates."""
    ctx = {
        "site_wide_announcements":
        current_announcements_for_request(request, site_wide=True)
    }
    return ctx
Exemple #2
0
def announcement_list(request):
    """A basic view that wraps ``django.views.list_detail_object``
    and uses ``current_announcements_for_request`` to get the current
    announcements."""
    queryset = current_announcements_for_request(request)
    return list_detail.object_list(request, **{
        "queryset": queryset,
        "allow_empty": True
    })
Exemple #3
0
def announcement_list(request):
    """A basic view that wraps ``django.views.list_detail_object``
    and uses ``current_announcements_for_request`` to get the current
    announcements."""
    queryset = current_announcements_for_request(request)
    return list_detail.object_list(
        request, **{
            "queryset": queryset,
            "allow_empty": True
        })
Exemple #4
0
def site_wide_announcements(request):
    """Adds the site-wide announcements to the global context of templates."""
    ctx = {"site_wide_announcements": current_announcements_for_request(request, site_wide=True)}
    return ctx
Exemple #5
0
 def dispatch(self, request, *args, **kwargs):
     self.queryset = current_announcements_for_request(request)
     return super(AnnouncementList, self).dispatch(request, *args, **kwargs)