Delete View

class pyramid_views.views.edit.DeleteView(**kwargs)

View for deleting an object retrieved with self.get_object(), with a response rendered by template.

success_url = None

The URL to redirect to upon successful deletion.

model = None

The model of which an instance will be deleted.

query = None

Limit deletion to only objects provided by query. If you specify this then you can omit model.

get_query()

Return the Query that will be used to look up the object.

Note that this method is called by the default implementation of get_object and may not be called if get_object is overriden.

get_object(query=None)

Returns the object the view is displaying.

By default this requires self.query and a pk or slug argument in the URLconf, but subclasses can override this to return any object.

slug_field = u'slug'
get_slug_field()

Get the name of a slug field to be used to look up by slug.

slug_url_kwarg = u'slug'
pk_url_kwarg = u'pk'
template_name = None
content_type = None
get_context_data(**kwargs)
macro_names = None
get_macro_names()

Return a directory of macro names.

Values should be template paths, and keys will be used as the lookup key in the template. Eg. macros.<key>.<macro>.

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