Skip to content

Commit

Permalink
🔥Rename pk kwarg to accept_pk
Browse files Browse the repository at this point in the history
fixes #17
  • Loading branch information
yezyilomo committed Sep 6, 2019
1 parent ed1f5e6 commit 7bbd9b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drf_pretty_update/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class _WritableField(object):
pass

def BaseNestedFieldSerializerFactory(*args,
pk=False,
accept_pk=False,
create_ops=[ADD, CREATE],
update_ops=[ADD, CREATE, REMOVE, UPDATE],
serializer_class=None,
**kwargs):
BaseClass = _ReplaceableField if pk else _WritableField
BaseClass = _ReplaceableField if accept_pk else _WritableField

if not set(create_ops).issubset(set(CREATE_SUPPORTED_OPERATIONS)):
msg = (
Expand Down Expand Up @@ -172,7 +172,7 @@ def validate_data_based_nested(self, data):
return parent_serializer.validated_data

def to_internal_value(self, data):
if pk:
if accept_pk:
return self.validate_pk_based_nested(data)
return self.validate_data_based_nested(data)

Expand Down

0 comments on commit 7bbd9b6

Please sign in to comment.