This commit is contained in:
Egyed Zoltán 2015-01-26 14:38:08 +00:00
commit e01ca3f645
3 changed files with 11 additions and 1 deletions

View File

@ -253,6 +253,12 @@ The name of a URL parameter that may be used to override the default `Accept` he
Default: `'format'`
#### SHOW_FORM
Show the form in the BrowsableAPIRenderer.
Default: `True`
---
## Date and time formatting

View File

@ -510,8 +510,11 @@ class BrowsableAPIRenderer(BaseRenderer):
def show_form_for_method(self, view, method, request, obj):
"""
Returns True if a form should be shown for this method.
Returns True if a form should be shown for this method, or can be show at all.
"""
if not api_settings.SHOW_FORM:
return False
if method not in view.allowed_methods:
return # Not a valid method

View File

@ -92,6 +92,7 @@ DEFAULTS = {
'FORM_CONTENTTYPE_OVERRIDE': '_content_type',
'URL_ACCEPT_OVERRIDE': 'accept',
'URL_FORMAT_OVERRIDE': 'format',
'SHOW_FORM': True,
'FORMAT_SUFFIX_KWARG': 'format',
'URL_FIELD_NAME': 'url',