You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (JIRA)" <ji...@apache.org> on 2017/11/02 20:24:00 UTC

[jira] [Created] (AIRAVATA-2579) Django: improve Thrift serializer handling of nested models

Marcus Christie created AIRAVATA-2579:
-----------------------------------------

             Summary: Django: improve Thrift serializer handling of nested models
                 Key: AIRAVATA-2579
                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2579
             Project: Airavata
          Issue Type: Improvement
            Reporter: Marcus Christie
            Priority: Normal


Django REST Framework doesn't support nested `create`. In order to create a nested Thrift model instance (for example, an ApplicationInterfaceDescription with multiple inputs and outputs) we need to manually do the work convert the validated_date to Thrift model instances (see [this example|https://github.com/apache/airavata-django-portal/blame/master/django_airavata/apps/api/serializers.py#L167])

Possible approaches:
* create a new BaseSerializer for serializing Thrift models that knows how to handle creating Thrift instances and nested models
** could also introspect the Thrift model and remove the need to specify each Thrift field
* create a general dict2thrift utility. This could be a generally useful thing to have for multiple purposes.
** See also https://github.com/wayhome/thrift_json, but this only works with Python 2

cc [~eldhomathulla]




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)