Function | get_list_or_404 |
Use filter() to return a list of objects, or raise an Http404 exception if the list is empty. |
Function | get_object_or_404 |
Use get() to return an object, or raise an Http404 exception if the object does not exist. |
Function | redirect |
Return an HttpResponseRedirect to the appropriate URL for the arguments passed. |
Function | render |
Return an HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments. |
Function | _get_queryset |
No summary |
Function | resolve_url |
Return a URL appropriate for the arguments passed. |
Use filter() to return a list of objects, or raise an Http404 exception if the list is empty.
klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in the filter() query.
Use get() to return an object, or raise an Http404 exception if the object does not exist.
klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in the get() query.
Like with QuerySet.get(), MultipleObjectsReturned is raised if more than one object is found.
Return an HttpResponseRedirect to the appropriate URL for the arguments passed.
The arguments could be:
- A model: the model's
get_absolute_url()
function will be called.- A view name, possibly with arguments:
urls.reverse()
will be used to reverse-resolve the name.- A URL, which will be used as-is for the redirect location.
Issues a temporary redirect by default; pass permanent=True to issue a permanent redirect.
get()
method (for
get_object_or_404) or a filter()
method (for get_list_or_404) might do
the job.Return a URL appropriate for the arguments passed.
The arguments could be:
- A model: the model's
get_absolute_url()
function will be called.- A view name, possibly with arguments:
urls.reverse()
will be used to reverse-resolve the name.- A URL, which will be returned as-is.