I have a model for a project in which I have to use Django and DRF. So I'm making a different file which takes all the objects from my model instances and provide a serializing. But in case of django 1.9 I'm not able to use Model.serializer
from rest_framework import serializers
from slack.models import WebhookTransaction
from slack.message import Message
class WebhookTransactionSerializer(serializers.ModelSerializer)
class Meta:
model = WebhookTransaction
fields = '_all_'
class MessageSerializer(serializers.ModelSerializer)
class Meta:
model = Message
fields = '_all_'
After running the server it's giving me this error
File "/Users/sid/webhook10/tutorial/slack/serializer.py", line 8
class MessageSerializer(serializers.ModelSerializer)
^
SyntaxError: invalid syntax
As wmorrell mentioned in the comment,
Add semi-colon after your serializers class definations, and indent the code following it, as follows