dr.botzo/dr_botzo/dispatch/serializers.py
Brian S. Stephan 0641e1c062 dispatch: port to django REST framework
this moves the dispatcher functionality that used to be in the old
ircbot directly to django REST framework, which is more robust and
allows for cooler stuff down the road. this still retains the ability to
have the bot privmsg, that still happens over the XML-RPC interface,
this is just a more convenient frontend to that
2015-06-18 23:57:43 -05:00

18 lines
385 B
Python

"""Serializers for the dispatcher API objects."""
from rest_framework import serializers
from dispatch.models import Dispatcher
class DispatcherSerializer(serializers.ModelSerializer):
class Meta:
model = Dispatcher
fields = ('id', 'key', 'type', 'destination')
class DispatchMessageSerializer(serializers.Serializer):
message = serializers.CharField()