Exemplo n.º 1
0
 def preferences(self, request, segments):
     """/addresses/<email>/preferences"""
     if len(segments) != 0:
         return NotFound(), []
     if self._address is None:
         return NotFound(), []
     child = Preferences(self._address.preferences,
                         'addresses/{0}'.format(self._address.email))
     return child, []
Exemplo n.º 2
0
 def preferences(self, request, segments):
     """/members/<id>/preferences"""
     if len(segments) != 0:
         return NotFound(), []
     if self._member is None:
         return NotFound(), []
     child = Preferences(self._member.preferences,
                         'members/{0}'.format(self._member.member_id.int))
     return child, []
Exemplo n.º 3
0
 def preferences(self, request, segments):
     """/addresses/<email>/preferences"""
     if len(segments) != 0:
         return BadRequest(), []
     if self._user is None:
         return NotFound(), []
     child = Preferences(self._user.preferences,
                         'users/{0}'.format(self._user.user_id.int))
     return child, []
Exemplo n.º 4
0
 def preferences(self, context, segments):
     """/users/<id>/preferences"""
     if len(segments) != 0:
         return BadRequest(), []
     if self._user is None:
         return NotFound(), []
     child = Preferences(
         self._user.preferences,
         'users/{}'.format(self.api.from_uuid(self._user.user_id)))
     return child, []
Exemplo n.º 5
0
 def preferences(self, context, segments):
     """/members/<id>/preferences"""
     if len(segments) != 0:
         return NotFound(), []
     if self._member is None:
         return NotFound(), []
     member_id = self.api.from_uuid(self._member_id)
     child = Preferences(self._member.preferences,
                         'members/{}'.format(member_id))
     return child, []