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
18 lines
385 B
Python
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()
|