code: def get(self, pk=None, **filters):
          
          LOG.debug(u'Querying (GET) %s by pk=%s and filters=%s', self.model_class.__name__, repr(pk), filters)
          query = self.model_class.objects.filter(**filters)
          if pk is None:
              obj = query.get()
          else:
              if (isinstance(pk, basestring) and pk.isdigit()) or isinstance(pk, numbers.Number):
                  obj = query.get(pk=pk)
              elif 'slug' in self.model_class._meta.get_all_field_names():
                  obj = query.get(slug=pk)
              else:
                  # pk is not a number and model has no slug. So, object don't exists.
                  raise self.model_class.DoesNotExist()
  
          perm = build_permission_name(self.model_class, 'view')
          if not self.user.has_perm(perm, obj=obj):
              raise PermissionDenied(u'User %s has no permission %s for object %s' % (self.user, perm, obj))
          return obj
docs: Retrieve an object instance. If a single argument is supplied, object is queried by
          primary key, else filter queries will be applyed.
          If more than one object was found raise MultipleObjectsReturned.
          If no object found, raise DoesNotExist.
          Raise PermissionDenied if user has no permission 'view' on object.
  
          See https://docs.djangoproject.com/en/dev/ref/models/querysets/#get for more details