mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
add permission keys to rest framework field object
This commit is contained in:
parent
e82ee91078
commit
c5b4be701a
|
@ -278,7 +278,8 @@ class Field(object):
|
||||||
def __init__(self, read_only=False, write_only=False,
|
def __init__(self, read_only=False, write_only=False,
|
||||||
required=None, default=empty, initial=empty, source=None,
|
required=None, default=empty, initial=empty, source=None,
|
||||||
label=None, help_text=None, style=None,
|
label=None, help_text=None, style=None,
|
||||||
error_messages=None, validators=None, allow_null=False):
|
error_messages=None, validators=None, allow_null=False,
|
||||||
|
permission=0, read_permission=0, write_permission=0):
|
||||||
self._creation_counter = Field._creation_counter
|
self._creation_counter = Field._creation_counter
|
||||||
Field._creation_counter += 1
|
Field._creation_counter += 1
|
||||||
|
|
||||||
|
@ -302,6 +303,9 @@ class Field(object):
|
||||||
self.help_text = help_text
|
self.help_text = help_text
|
||||||
self.style = {} if style is None else style
|
self.style = {} if style is None else style
|
||||||
self.allow_null = allow_null
|
self.allow_null = allow_null
|
||||||
|
self.permission = permission
|
||||||
|
self.read_permission = read_permission
|
||||||
|
self.write_permission = write_permission
|
||||||
|
|
||||||
if self.default_empty_html is not empty:
|
if self.default_empty_html is not empty:
|
||||||
if default is not empty:
|
if default is not empty:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user