{"version":"1.0","type":"rich","title":"DRF, Getters Setters, PolymorphicModel","description":"This example shows a Django REST Framework serializer that exposes a computed `driver` property on a polymorphic model, delegating to either the delivery or collection driver based on the model’s type. The `models.py` file defines `MyModel` with a `PolymorphicModel` base, using `@property` and `@setter` to route reads and writes to the correct foreign-key field. The `serializers.py` class `MyModelSerializer` subclasses `ModelSerializer` and declares `driver = UserSerializer()` to output the nested user object. The code demonstrates how to unify two underlying fields into a single API field without custom serializer logic.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-10404406?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}