Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Allow optional field ordering #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion taggit_serializer/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class TagListSerializerField(serializers.Field):
' form must be valid json.'),
'not_a_str': _('All list items must be of string type.')
}
order_by = None

def __init__(self, **kwargs):
order_by = kwargs.pop("order_by", None)
pretty_print = kwargs.pop("pretty_print", True)

style = kwargs.pop("style", {})
Expand All @@ -51,6 +51,7 @@ def __init__(self, **kwargs):

super(TagListSerializerField, self).__init__(**kwargs)

self.order_by = order_by
self.pretty_print = pretty_print

def to_internal_value(self, value):
Expand Down