We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error - if document._dynamic: AttributeError: 'collections.OrderedDict' object has no attribute '_dynamic'
class Conversation(DynamicDocument): poll_name = fields.StringField(required=True) poll_votes = fields.IntField(required=True)
class PollSerializer(serializers.DynamicDocumentSerializer): class Meta: model = Conversation fields = 'all'
class PollView(APIView): permission_classes = [permissions.AllowAny]
def get(self, request): serializer = PollSerializer(Conversation.objects.all(), many=True) response = {"polls": serializer.data} return Response(response, status=status.HTTP_200_OK) def post(self, request, format=None): data = request.data tag = data.pop("varun") serializer = PollSerializer(data=data) if serializer.is_valid(): poll = Conversation(**data) print("varun") poll.save() response = serializer.data return Response(response, status=status.HTTP_200_OK) return Response(serializer.data, status=status.HTTP_200_OK)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Error - if document._dynamic: AttributeError: 'collections.OrderedDict' object has no attribute '_dynamic'
class Conversation(DynamicDocument):
poll_name = fields.StringField(required=True)
poll_votes = fields.IntField(required=True)
class PollSerializer(serializers.DynamicDocumentSerializer):
class Meta:
model = Conversation
fields = 'all'
class PollView(APIView):
permission_classes = [permissions.AllowAny]
The text was updated successfully, but these errors were encountered: