Context processors¶
-
adminlinks.context_processors.fix_admin_popups(request)[source]¶ Should you desire it, you can force the entire admin to behave as if it were in a popup. This may be useful if you’re exposing the entire thing as a frontend-edited site.
It forces all of the admin to believe that the request included _popup=1 (or pop=1 for the changelist in Django_ < 1.6) and thus hides the header, breadcrumbs etc.
It also keeps track of whether or not it was really requested via a popup, by populating the context with
is_really_popup, and it also detects whether the view is supposed to respond by closing a modal window on success by puttingwill_autocloseinto the context.Changed in version 0.8.1: Previously the function
adminlinks.context_processors.force_admin_popups()used this name.Note
If there is no user, or the user is not authenticated, the context will never contain any of the documented keys.
-
adminlinks.context_processors.force_admin_popups(request)[source]¶ Should you desire it, you can force the entire admin to behave as if it were in a popup. This may be useful if you’re exposing the entire thing as a frontend-edited site.
It forces all of the admin to believe that the request included _popup=1 (or pop=1 for the changelist in Django_ < 1.6) and thus hides the header, breadcrumbs etc.
It also keeps track of whether or not it was really requested via a popup, by populating the context with
is_really_popup, and it also detects whether the view is supposed to respond by closing a modal window on success by puttingwill_autocloseinto the context.New in version 0.8.1: Previously this was known as
adminlinks.context_processors.fix_admin_popups(), even though it didn’t really fix anything.Note
If there is no user, or the user is not authenticated, the context will never contain any of the documented keys.
-
adminlinks.context_processors.patch_admin_context(request, valid, invalid)[source]¶ If there is no user, or the user is not authenticated, the context will never contain
valid.If the
AdminSitein use isn’t the defaultdjango.contrib.admin.site, it will also fail (being unable to reverse the default admin), which is hopefully fine, because you should probably handle things yourself, you magical person.New in version 0.8.1: Hoisted functionality required for
adminlinks.context_processors.force_admin_popups()andadminlinks.context_processors.fix_admin_popups()into a separate function, which tests whether to apply the context.Returns: validorinvalidparameter.Return type: dictionary.