Skip to content

Commit

Permalink
trying to implement returning partial objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ohi-711 committed Nov 30, 2023
1 parent d2aaa31 commit e7e3994
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/api/views/objects/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

from .base import BaseProvider
from .... import models
from ....models import Organization
from ....templatetags.gravatar_tags import gravatar_url


class Serializer(serializers.ModelSerializer):
'''gravatar_url = serializers.SerializerMethodField(read_only=True)'''
gravatar_url = serializers.SerializerMethodField(read_only=True)
links = serializers.SlugRelatedField(
slug_field="url", many=True, queryset=models.OrganizationURL.objects.all()
)
Expand All @@ -20,9 +22,9 @@ class Meta:
model = models.Organization
fields = "__all__"

''' @staticmethod
@staticmethod
def get_gravatar_url(obj: Organization):
return gravatar_url(obj.organization)'''
return gravatar_url(obj.organization)


class SupervisorOrExec(permissions.BasePermission):
Expand Down

0 comments on commit e7e3994

Please sign in to comment.