Skip to content

Commit

Permalink
[Fixes #11494] Implement relations between resources - tests and improvs
Browse files Browse the repository at this point in the history
  • Loading branch information
etj committed Oct 9, 2023
1 parent 6b0fc0a commit 9379e9b
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 236 deletions.
6 changes: 5 additions & 1 deletion geonode/base/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from slugify import slugify
from urllib.parse import urljoin
import json
import warnings

from django.db.models import Q
from django.conf import settings
Expand Down Expand Up @@ -787,6 +788,9 @@ class Meta:


class SimpleResourceSerializer(DynamicModelSerializer):
warnings.warn('SimpleResourceSerializer is deprecated',
DeprecationWarning,
stacklevel=2)

class Meta:
name = "linked_resources"
Expand All @@ -796,7 +800,7 @@ class Meta:
def to_representation(self, instance: LinkedResource):
return {
"pk": instance.pk,
"title": f"{'>>> ' if instance.is_target else '<<< '} {instance.title}",
"title": f"{'>>>' if instance.is_target else '<<<'} {instance.title}",
"resource_type": instance.resource_type,
"detail_url": instance.detail_url,
"thumbnail_url": instance.thumbnail_url,
Expand Down
Loading

0 comments on commit 9379e9b

Please sign in to comment.