# serializers.py
from rest_framework import serializers
from core.models.Space import Space
from core.models.AssetBundleRoom import AssetBundleRoom  # Import AssetBundleRoom

from core.serializers.AssetBundleRoomSerializer import AssetBundleRoomSerializer

class SpaceSerializerforadd(serializers.ModelSerializer):

    # assetBundleRoomId = AssetBundleRoomSerializer()  # Nested serializer for AssetBundleRoom
    assetBundleRoomId = serializers.PrimaryKeyRelatedField(queryset=AssetBundleRoom.objects.all())

    class Meta:
        model = Space
        fields = ['userId', 'assetBundleRoomId', 'name', 'description', 'capacity' ]




class SpaceSerializer(serializers.ModelSerializer):
    assetBundleRoomId = AssetBundleRoomSerializer()  # Nested serializer to include all fields from AssetBundleRoom

    class Meta:
        model = Space
        fields = '__all__'  # You can adjust which fields from Space to include if needed