Create another serializer say BLContainerSerializer
and exclude fields there. Then use this in your BLcontainerMergedSerializer
. Hope this helps.
class BLContainerSerializer(serializers.ModelSerializer):
class Meta:
model = Container
exclude = ('field1', )
class BLcontainerMergedSerializer(serializers.ModelSerializer):
container = BLContainerSerializer()
class Meta:
model = BLcontainer
Related Contents:
- Django rest framework, use different serializers in the same ModelViewSet
- How to get Request.User in Django-Rest-Framework serializer?
- Django REST Framework: adding additional field to ModelSerializer
- How to disable admin-style browsable interface of django-rest-framework?
- Django REST framework: non-model serializer
- What are the differences between django-tastypie and djangorestframework? [closed]
- How to change field name in Django REST Framework
- Django: TemplateDoesNotExist (rest_framework/api.html)
- Django Rest Framework: Dynamically return subset of fields
- Django REST Framework custom fields validation
- Django Rest Framework with ChoiceField
- How do you filter a nested serializer in Django Rest Framework?
- Write only, read only fields in django rest framework
- RuntimeError: Model class django.contrib.sites.models.Site doesn’t declare an explicit app_label and isn’t in an application in INSTALLED_APPS
- Pass request context to serializer from Viewset in Django Rest Framework
- How to register users in Django REST framework?
- How do I create multiple model instances with Django Rest Framework?
- Django REST framework serializer without a model
- CSRF Failed: CSRF token missing or incorrect
- “Post Image data using POSTMAN”
- Aggregate (and other annotated) fields in Django Rest Framework serializers
- How to set current user to user field in Django Rest Framework?
- How Can I Disable Authentication in Django REST Framework
- Django Rest Framework: Disable field update after object is created
- Django test RequestFactory vs Client
- Django REST Framework combining routers from different apps
- Capture parameters in django-rest-framework
- generics vs viewset in django rest framework, how to prefer which one to use?
- SocketException: OS Error: Connection refused, errno = 111 in flutter using django backend
- How to make a PATCH request using DJANGO REST framework
- Is it possible to use FastAPI with Django?
- Django Rest Framework: Access item detail by slug instead of ID
- How can I test binary file uploading with django-rest-framework’s test client?
- How can I apply a filter to a nested resource in Django REST framework?
- How to programmatically call a Django Rest Framework view within another view?
- context in nested serializers django rest framework
- 405 POST method not allowed
- Turn off automatic pagination of Django Rest Framework ModelViewSet
- Is APITest with Query params different then just normal url?
- Custom error messages in Django Rest Framework serializer
- Django testing rest-framework: APIRequestFactory vs APIClient
- django rest framework – how do you flatten nested data?
- How to make a POST simple JSON using Django REST Framework? CSRF token missing or incorrect
- Difference between APIView class and viewsets class?
- How can I make a trailing slash optional on a Django Rest Framework SimpleRouter
- What’s the differences between has_object_permission and has_permission?
- Circular dependency in Django Rest Framework serializers
- How to access custom HTTP request headers on Django Rest Framework?
- Django Rest Framework update field
- This QueryDict instance is immutable