13 lines
438 B
Python
13 lines
438 B
Python
|
from rest_framework import serializers
|
||
|
from event.models import Event
|
||
|
from django.contrib.auth import get_user_model
|
||
|
|
||
|
|
||
|
class EventSerializer(serializers.HyperlinkedModelSerializer):
|
||
|
created_by = serializers.ReadOnlyField(source='created_by.username')
|
||
|
|
||
|
class Meta:
|
||
|
model = Event
|
||
|
fields = ('url', 'id', 'title', 'slug', 'created_by', 'creation_date',
|
||
|
'description', 'begining_date', 'ending_date')
|