Commit a3ab66ec by Tom Christie

Add 'to_many' flag in get_related_field

parent 9bbc1cc4
...@@ -304,6 +304,13 @@ class ModelSerializer(Serializer): ...@@ -304,6 +304,13 @@ class ModelSerializer(Serializer):
""" """
Return all the fields that should be serialized for the model. Return all the fields that should be serialized for the model.
""" """
# TODO: Modfiy this so that it's called on init, and drop
# serialize/obj/data arguments.
#
# We *could* provide a hook for dynamic fields, but
# it'd be nice if the default was to generate fields statically
# at the point of __init__
cls = self.opts.model cls = self.opts.model
opts = get_concrete_model(cls)._meta opts = get_concrete_model(cls)._meta
pk_field = opts.pk pk_field = opts.pk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment