def to_representation(self, obj):
        location = obj.location

        isowner = False
        if not self.context.get('user').is_anonymous():
            isowner = obj.creator == self.context.get('user')

        updator = None
        if obj.updator is not None:
            updator = {
                'id': obj.updator.id,
                'display_name': obj.updator.display_name
            }

        feature = {
            'id': obj.id,
            'properties': obj.properties,
            'display_field': self.get_display_field(obj),
            'meta': {
                'status': obj.status,
                'creator': {
                    'id': obj.creator.id,
                    'display_name': obj.creator.display_name
                },
                'updator': updator,
                'created_at': str(obj.created_at),
                'updated_at': str(obj.updated_at),
                'version': obj.version,
                'isowner': isowner,
                'num_media': obj.num_media,
                'num_comments': obj.num_comments
            },
            'location': {
                'id': location.id,
                'name': location.name,
                'description': location.description,
                'geometry': location.geometry.geojson
            }
        }

        if self.context.get('many'):
            cat = obj.category
            feature['meta']['category'] = {
                'id': cat.id,
                'name': cat.name,
                'description': cat.description,
                'symbol': cat.symbol.url if cat.symbol else None,
                'colour': cat.colour
            }

        else:
            category_serializer = CategorySerializer(
                obj.category, context=self.context)
            feature['meta']['category'] = category_serializer.data

            comment_serializer = CommentSerializer(
                obj.comments.filter(respondsto=None),
                many=True,
                context=self.context
            )
            feature['comments'] = comment_serializer.data

            review_serializer = CommentSerializer(
                obj.comments.filter(review_status='open'),
                many=True,
                context=self.context
            )
            feature['review_comments'] = review_serializer.data

            file_serializer = FileSerializer(
                obj.files_attached.all(),
                many=True,
                context=self.context
            )
            feature['media'] = file_serializer.data

        return feature
Return an iterable of the elements which are direct children of C{parent}
dataset/ETHPy150Open ExCiteS/geokey/geokey/contributions/serializers.py/ContributionSerializer.to_representation--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/domhelpers.py/findElementsWithAttributeShallow