def get_users_and_groups(self): ur = v1.canonical_resource_for('user') users_bundles = self._get_list_for_resource(ur) gr = v1.canonical_resource_for('group') groups_bundles = self._get_list_for_resource(gr) return dict(users=users_bundles, groups=groups_bundles)
def get_detail(self, pk): tr = v1.canonical_resource_for('face') try: face = tr.cached_obj_get(pk=pk) except Face.DoesNotExist: raise Http404 bundle = tr.full_dehydrate(tr.build_bundle(obj=face)) data = bundle.data return data
def get_detail(self, pk): tr = v1.canonical_resource_for('tweet') try: tweet = tr.cached_obj_get(pk=pk) except Tweet.DoesNotExist: raise Http404 bundle = tr.full_dehydrate(tr.build_bundle(obj=tweet)) data = bundle.data return data
def get_detail(self, pk): tr = v1.canonical_resource_for('stat') try: predict = tr.cached_obj_get(pk=pk) except Stat.DoesNotExist: raise Http404 bundle = tr.full_dehydrate(tr.build_bundle(obj=stat)) data = bundle.data return data
def get_polls(self): tr = v1.canonical_resource_for('poll') return tr.id