diff --git a/djangoldp_circle/locale/en/LC_MESSAGES/django.mo b/djangoldp_circle/locale/en/LC_MESSAGES/django.mo index 8a02d125ff49800db8841b2efc18bb09bf62bb5c..d9ad4e038722bf16e31252c3b9f0ad5bf25c14fd 100644 Binary files a/djangoldp_circle/locale/en/LC_MESSAGES/django.mo and b/djangoldp_circle/locale/en/LC_MESSAGES/django.mo differ diff --git a/djangoldp_circle/locale/en/LC_MESSAGES/django.po b/djangoldp_circle/locale/en/LC_MESSAGES/django.po index 42a3ebe084b42b9c64916ac88175a94e5609c655..ca51356ce8cd96395f1ee04f776e718162c10974 100644 --- a/djangoldp_circle/locale/en/LC_MESSAGES/django.po +++ b/djangoldp_circle/locale/en/LC_MESSAGES/django.po @@ -71,3 +71,19 @@ msgstr "accepted" #: templates/accessrequests/access_resolved.html:5 msgid "denied" msgstr "denied" + +#: models.py:26 +msgid "Public" +msgstr "Public" + +#: models.py:27 +msgid "Private" +msgstr "Private" + +#: models.py:28 +msgid "Archived" +msgstr "Archived" + +#: models.py:29 +msgid "Restricted" +msgstr "Restricted" diff --git a/djangoldp_circle/locale/es/LC_MESSAGES/django.mo b/djangoldp_circle/locale/es/LC_MESSAGES/django.mo index 71cbdf3e9d8d54be31066ec4ad8628bc2c1f2845..ad467db0e3d373b8cf36c2469856db0e63c8e92d 100644 Binary files a/djangoldp_circle/locale/es/LC_MESSAGES/django.mo and b/djangoldp_circle/locale/es/LC_MESSAGES/django.mo differ diff --git a/djangoldp_circle/locale/es/LC_MESSAGES/django.po b/djangoldp_circle/locale/es/LC_MESSAGES/django.po index cadfca2cad0a4dfa0b1348ec81330fa03b16e395..1c946bb8132904e0c20f0e78a00db6e45129430e 100644 --- a/djangoldp_circle/locale/es/LC_MESSAGES/django.po +++ b/djangoldp_circle/locale/es/LC_MESSAGES/django.po @@ -75,3 +75,19 @@ msgstr "" #: templates/accessrequests/access_resolved.html:5 msgid "denied" msgstr "" + +#: models.py:26 +msgid "Public" +msgstr "Público" + +#: models.py:27 +msgid "Private" +msgstr "Privado" + +#: models.py:28 +msgid "Archived" +msgstr "Archivado" + +#: models.py:29 +msgid "Restricted" +msgstr "Restringido" diff --git a/djangoldp_circle/locale/fr/LC_MESSAGES/django.mo b/djangoldp_circle/locale/fr/LC_MESSAGES/django.mo index d64274fa33edc1b70d9e82025418164008be24e9..a0e458dd50d1b2eabfdb80871b696478a9f650da 100644 Binary files a/djangoldp_circle/locale/fr/LC_MESSAGES/django.mo and b/djangoldp_circle/locale/fr/LC_MESSAGES/django.mo differ diff --git a/djangoldp_circle/locale/fr/LC_MESSAGES/django.po b/djangoldp_circle/locale/fr/LC_MESSAGES/django.po index b6ba1fdfbb276c1b79249a260611c46b41aeda78..4473832bf63c4310ce4157e0fc01ff67baaf7b80 100644 --- a/djangoldp_circle/locale/fr/LC_MESSAGES/django.po +++ b/djangoldp_circle/locale/fr/LC_MESSAGES/django.po @@ -71,3 +71,19 @@ msgstr "accepté" #: templates/accessrequests/access_resolved.html:5 msgid "denied" msgstr "refusé" + +#: models.py:26 +msgid "Public" +msgstr "Public" + +#: models.py:27 +msgid "Private" +msgstr "Privé" + +#: models.py:28 +msgid "Archived" +msgstr "Archivé" + +#: models.py:29 +msgid "Restricted" +msgstr "Restreint" diff --git a/djangoldp_circle/models.py b/djangoldp_circle/models.py index 1c7edf8ed69b7af544fc4b6f8be409da656903bd..f5467c968597d8496e68b5193c846cf227cb498f 100644 --- a/djangoldp_circle/models.py +++ b/djangoldp_circle/models.py @@ -86,6 +86,11 @@ class Circle(Model): def get_admins(self): return self.members.filter(is_admin=True) + @classmethod + def get_serializer_class(cls): + from djangoldp_circle.serializers import CircleModelSerializer + return CircleModelSerializer + class CircleMember(Model): circle = models.ForeignKey(Circle, on_delete=models.CASCADE, related_name='members') diff --git a/djangoldp_circle/serializers.py b/djangoldp_circle/serializers.py index 54e08e80f853d6d6736ef817aedb430c0b134fcf..102f33dc1b9f48719d12c7a28d793d81968894f2 100644 --- a/djangoldp_circle/serializers.py +++ b/djangoldp_circle/serializers.py @@ -1,8 +1,26 @@ +from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers -from djangoldp_circle.models import CircleAccessRequest +from djangoldp.serializers import LDPSerializer +from djangoldp_circle.models import Circle, CircleAccessRequest class CircleAccessRequestModelSerializer(serializers.ModelSerializer): class Meta: model = CircleAccessRequest fields = '__all__' + + +class CircleModelSerializer(LDPSerializer): + class Meta: + model = Circle + fields = '__all__' + + # _status = serializers.SerializerMethodField('get_status_transalted') + + def get_status_translated(self, obj): + return _(obj.status) + + def to_representation(self, instance): + rep = super().to_representation(instance) + rep['_status'] = self.get_status_translated(instance) + return rep