[django1.11] use FormatPresetSerializer as a PrimaryKeyRelatedField serializer#890
[django1.11] use FormatPresetSerializer as a PrimaryKeyRelatedField serializer#890micahscopes wants to merge 2 commits intolearningequality:django1.11from
Conversation
aronasorman
left a comment
There was a problem hiding this comment.
Some questions! And let's remove the pdb comments!
| user = self.context['request'].user | ||
| with transaction.atomic(): | ||
| for item in validated_data: | ||
| # import ipdb; ipdb.set_trace() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if request.method != 'POST': | ||
| return HttpResponseBadRequest("Only POST requests are allowed on this endpoint.") | ||
|
|
||
| # import ipdb; ipdb.set_trace() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| checksum, _, path = write_raw_content_to_storage(contents, ext=ext) | ||
| with default_storage.open(path, 'rb') as new_file: | ||
| return File.objects.create( | ||
| # import ipdb; ipdb.set_trace() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
|
|
||
| class FormatPresetSerializer(serializers.ModelSerializer): | ||
| class FormatPresetSerializer(serializers.PrimaryKeyRelatedField): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| id = serializers.CharField(required=False) | ||
| preset = FormatPresetSerializer(many=False) | ||
| preset = FormatPresetSerializer(many=False, read_only=True) | ||
| # preset = serializers.PrimaryKeyRelatedField(many=False, queryset=FormatPreset.objects.all()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
(do not merge) 😜
Description
This is an attempt to make file uploading and metadata editing work with Django 1.11 and DRF 3.8.
Issue Addressed (if applicable)
see #874
Before/After Screenshots (if applicable)
Now we get this new issue:

Steps to Test