Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
e044fa08
Commit
e044fa08
authored
Dec 04, 2012
by
Stephan Groß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #469 - RegexField <--> BrowsableAPI Bug
parent
3e3ede71
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
docs/topics/release-notes.md
+4
-0
rest_framework/fields.py
+1
-0
rest_framework/renderers.py
+3
-0
No files found.
docs/topics/release-notes.md
View file @
e044fa08
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
>
>
> — Eric S. Raymond, [The Cathedral and the Bazaar][cite].
> — Eric S. Raymond, [The Cathedral and the Bazaar][cite].
## Master
*
Bugfix: Fix
`RegexField`
to work with
`BrowsableAPIRenderer`
## 2.1.6
## 2.1.6
**Date**
: 23rd Nov 2012
**Date**
: 23rd Nov 2012
...
...
rest_framework/fields.py
View file @
e044fa08
...
@@ -817,6 +817,7 @@ class EmailField(CharField):
...
@@ -817,6 +817,7 @@ class EmailField(CharField):
class
RegexField
(
CharField
):
class
RegexField
(
CharField
):
type_name
=
'RegexField'
type_name
=
'RegexField'
form_field_class
=
forms
.
RegexField
def
__init__
(
self
,
regex
,
max_length
=
None
,
min_length
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
regex
,
max_length
=
None
,
min_length
=
None
,
*
args
,
**
kwargs
):
super
(
RegexField
,
self
)
.
__init__
(
max_length
,
min_length
,
*
args
,
**
kwargs
)
super
(
RegexField
,
self
)
.
__init__
(
max_length
,
min_length
,
*
args
,
**
kwargs
)
...
...
rest_framework/renderers.py
View file @
e044fa08
...
@@ -320,6 +320,9 @@ class BrowsableAPIRenderer(BaseRenderer):
...
@@ -320,6 +320,9 @@ class BrowsableAPIRenderer(BaseRenderer):
if
getattr
(
v
,
'choices'
,
None
)
is
not
None
:
if
getattr
(
v
,
'choices'
,
None
)
is
not
None
:
kwargs
[
'choices'
]
=
v
.
choices
kwargs
[
'choices'
]
=
v
.
choices
if
getattr
(
v
,
'regex'
,
None
)
is
not
None
:
kwargs
[
'regex'
]
=
v
.
regex
if
getattr
(
v
,
'widget'
,
None
):
if
getattr
(
v
,
'widget'
,
None
):
widget
=
copy
.
deepcopy
(
v
.
widget
)
widget
=
copy
.
deepcopy
(
v
.
widget
)
kwargs
[
'widget'
]
=
widget
kwargs
[
'widget'
]
=
widget
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment