diff --git a/djangoldp_profile/models.py b/djangoldp_profile/models.py index b7fe595c648e28920d532d631493a08cb0dc8e29..7cba20f51c6850f3a87895c9e8c4289509dba986 100644 --- a/djangoldp_profile/models.py +++ b/djangoldp_profile/models.py @@ -4,6 +4,7 @@ from django.db.models.signals import post_save from django.dispatch import receiver from django.core.urlresolvers import reverse_lazy + class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) available = models.NullBooleanField(blank=True) @@ -13,6 +14,9 @@ class Profile(models.Model): phone = models.CharField(max_length=255, blank=True, null=True) website = models.URLField(blank=True) + def jabberID(self): + return self.user.chatProfile.jabberID + class Meta: auto_author = 'user' permissions = ( diff --git a/djangoldp_profile/urls.py b/djangoldp_profile/urls.py index c143d96138ce894eaf67ee7b4922454df5f87744..2774193f98827dfee9be22fd273dda2b6ca834ce 100644 --- a/djangoldp_profile/urls.py +++ b/djangoldp_profile/urls.py @@ -1,10 +1,12 @@ """djangoldp profile URL Configuration""" -from django.conf.urls import url, include +from django.conf.urls import url from djangoldp.permissions import AnonymousReadOnly from djangoldp.views import LDPViewSet from .models import Profile urlpatterns = [ - url(r'^members/', LDPViewSet.urls(model=Profile, permission_classes=[AnonymousReadOnly])), + url(r'^members/', LDPViewSet.urls(model=Profile, + fields=['jabberID', 'user', 'available', 'bio', 'city', 'country', 'phone', + 'website'], permission_classes=[AnonymousReadOnly])), ]