13 lines
316 B
Python
13 lines
316 B
Python
|
from rest_framework import serializers
|
||
|
|
||
|
from authentication.models import ToolshedUser
|
||
|
|
||
|
|
||
|
class OwnerSerializer(serializers.ReadOnlyField):
|
||
|
class Meta:
|
||
|
model = ToolshedUser
|
||
|
fields = ['username', 'domain']
|
||
|
|
||
|
def to_representation(self, value):
|
||
|
return value.username + '@' + value.domain
|