Utils Generic

inyoka.utils.generic

Generic view classes.

copyright:
  1. 2011-2024 by the Inyoka Team, see AUTHORS for more details.

license:

BSD, see LICENSE for more details.

class inyoka.utils.generic.BaseDeleteView(*args, **kwargs)

Generic deletion view. Flashes a template message to confirm the deletion and issues the redirects.

form_valid(form)

If the form is valid, redirect to the supplied URL.

get(request, *args, **kwargs)
get_success_url()

Return the URL to redirect to after processing a valid form.

message = '{verbose_name} “{object_name}” was deleted successfully!'
post(request, *args, **kwargs)
redirect_url = None
template_name = None
class inyoka.utils.generic.BaseListView(**kwargs)
get_context_data(**kwargs)

Get the context for this view.

get_custom_pagination(queryset)
get_paginate_by(queryset)

Get the number of items to paginate by, or None for no pagination.

paginate_by = 25
prepare_context(context, queryset)
inyoka.utils.generic.CreateUpdateView(*init_args, **init_kwargs)

Helper function to combine UpdateView and CreateView. TODO: Make me a class based view…

class inyoka.utils.generic.CreateView(**kwargs)
create = True
class inyoka.utils.generic.DeleteView(*args, **kwargs)
class inyoka.utils.generic.EditMixin

Provides a flash message and success url

form_valid(form)
get_success_url()
get_urlgroup_name()
urlgroup_name = ''
class inyoka.utils.generic.FilterMixin
filtersets = []
get_queryset()
render_to_response(context, **kwargs)
class inyoka.utils.generic.ListView(**kwargs)
class inyoka.utils.generic.OrderedListView(**kwargs)
get(request, *args, **context)
order_by = ['id']
class inyoka.utils.generic.PermissionRequiredMixin
dispatch(request, *args, **kwargs)
handle_no_authentication()
login_required = True
raise_exception = True
class inyoka.utils.generic.SortableListView(**kwargs)
columns = ['id']
default_column = 'id'
get(request, *args, **context)
class inyoka.utils.generic.UpdateView(**kwargs)
create = False
get_object(queryset=None)

Returns the object the view is displaying.

inyoka.utils.generic.trigger_fix_errors_message(request)