2019-10-18 07:05:45 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
from orgs.utils import tmp_to_root_org
|
2022-09-26 02:43:18 +00:00
|
|
|
from common.drf.serializers import BulkSerializerMixin
|
2019-10-18 07:05:45 +00:00
|
|
|
from ..models import FavoriteAsset
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ['FavoriteAssetSerializer']
|
|
|
|
|
|
|
|
|
|
|
|
class FavoriteAssetSerializer(BulkSerializerMixin, serializers.ModelSerializer):
|
|
|
|
user = serializers.HiddenField(
|
|
|
|
default=serializers.CurrentUserDefault()
|
|
|
|
)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = FavoriteAsset
|
|
|
|
fields = ['user', 'asset']
|