Port to new django version - not yet fully working
- location field makes problems
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
from rest_framework import serializers
|
||||
from models import EventParticipation
|
||||
|
||||
|
||||
from .models import EventParticipation, Event
|
||||
|
||||
|
||||
class ParticipationSerializer(serializers.ModelSerializer):
|
||||
event = serializers.PrimaryKeyRelatedField( many=False, read_only = False )
|
||||
user = serializers.Field( source='get_username' )
|
||||
status = serializers.CharField( source='status', required=False )
|
||||
|
||||
event = serializers.PrimaryKeyRelatedField(many=False, read_only=False, queryset=Event.objects.all())
|
||||
user = serializers.Field(source='get_username')
|
||||
status = serializers.CharField(source='status', required=False)
|
||||
|
||||
def get_identity(self, data):
|
||||
""" This hook is required for bulk update. """
|
||||
try:
|
||||
@@ -19,6 +17,3 @@ class ParticipationSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = EventParticipation
|
||||
fields = ('event', 'user', 'status', 'comment')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user