fluent_dashboard.items¶
Additional menu items.
The CmsModelList
class¶
The ReturnToSiteItem
class¶
-
class
fluent_dashboard.items.
ReturnToSiteItem
(title=None, url=None, **kwargs)¶ A “Return to site” button for the menu. It redirects the user back to the frontend pages.
By default, it attempts to find the current frontend URL that corresponds with the model that’s being edited in the admin ‘change’ page. If this is not possible, the default URL (
/
) will be used instead.The menu item has a custom
returntosite
CSS class to be distinguishable between the other menu items.-
get_edited_object
(request)¶ Return the object which is currently being edited. Returns
None
if the match could not be made.
-
get_object_by_natural_key
(app_label, model_name, object_id)¶ Return a model based on a natural key. This is a utility function for
get_edited_object()
.
-
init_with_context
(context)¶ Find the current URL based on the context. It uses
get_edited_object()
to find the model, and callsget_absolute_url()
to get the frontend URL.
-
title
= u'Return to site'¶ Set the default title
-
url
= '/'¶ Set the default URL
-