{"categories":[{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content"}],"enrichment":{"capability":"Provides polymorphic serializers for Django REST Framework that map inherited models created with django-polymorphic to their corresponding serializers, enabling type-aware serialization of model hierarchies.","skillfed_tags":["django-polymorphic","serialization","model-inheritance"],"use_cases":["API endpoints serving inherited model hierarchies where each subclass has distinct fields and serialization requirements","REST services that need to return mixed collections of related model types with type information for client routing","Building polymorphic model APIs where POST/PUT requests specify the resource type to determine which serializer and model to instantiate","Multi-tenant or plugin architectures where a base model is extended by different subclasses with type-specific logic"],"what_it_does":"django-rest-polymorphic bridges django-polymorphic model hierarchies with Django REST Framework's serialization system. It lets you define separate serializers for each model in an inheritance chain, then automatically routes serialization and deserialization through the correct serializer based on the model type. When you query a polymorphic model, the response includes a resource type field that identifies which subclass each object is, and POST/PUT requests use that same field to determine which serializer to apply during deserialization.\n\nThe package handles the common pattern of REST APIs that need to work with model inheritance: a base Project model with subclasses like ArtProject and ResearchProject, each with their own fields and serialization rules. Instead of flattening the hierarchy into a single serializer, django-rest-polymorphic lets you preserve the structure and handle each type appropriately.","worth_installing":"Yes, if you are using django-polymorphic and need REST API serialization. The package is actively maintained, has low install friction, carries a permissive MIT License, and solves a real gap in Django REST Framework's handling of model inheritance. Verify compatibility with your specific Django and Python versions before adopting."},"id":"django-rest-polymorphic","links":{"html":"https://skillfed.io/packages/django-rest-polymorphic","md":"https://skillfed.io/packages/django-rest-polymorphic.md","pypi":"https://pypi.org/project/django-rest-polymorphic/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2022-07-17","license_spdx":null,"license_treatment":"permissive","name":"django-rest-polymorphic","python_support":"unspecified","summary":"Polymorphic serializers for Django REST Framework."},"popularity":{"monthly_downloads":1223149,"position":4198,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.1.10"}
