You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was following the documentation, trying to integrate this into a new django-rest-framework-based project, but I ran into trouble trying to use ListOrItemField(serializers.URLField()). Namely, it never validates a list of URLs.
The documentation is correct when it comes to an item:
I haven't had time to implement a fix yet (trying to hit a deadline), but If you don't have time in the next couple days I should be able to loop back and figure out what's going wrong.
Note that that same data works fine for a ListField:
In [12]: dataOut[12]: {'name': u'John Smith', 'skills': [u'Python'], 'social_links': [u'http://chrp.com/johnsmith', u'http://myface.com/johnsmith']}
In [13]: classSkillsProfileSerializer(serializers.Serializer):
...: name=serializers.CharField()
...: skills=ListField(serializers.CharField(min_length=3))
...: social_links=ListField(serializers.URLField())
...:
In [14]: sps=SkillsProfileSerializer(data=data)
In [15]: assertsps.is_valid(), sps.errors
The text was updated successfully, but these errors were encountered:
I'm not sure I'll get to it that quick, but I'll try to.
The first think I'll be looking at is whether the issue in #20 is related. Over there, I wasn't properly passing options to the internal ListField of a ListOrItemField and so not all of the options took effect.
@sbuss How important is it for you that this be fixed for compatibility with rest-framework 2.X, as opposed to when I upgrade this for rest-framework 3.0 (hopefully soon)?
I was following the documentation, trying to integrate this into a new django-rest-framework-based project, but I ran into trouble trying to use
ListOrItemField(serializers.URLField())
. Namely, it never validates a list of URLs.The documentation is correct when it comes to an item:
But if you try to feed back in the serialized output of a list of URLs, it fails:
I haven't had time to implement a fix yet (trying to hit a deadline), but If you don't have time in the next couple days I should be able to loop back and figure out what's going wrong.
Note that that same data works fine for a
ListField
:The text was updated successfully, but these errors were encountered: