def get_collection(self, request):
        """
        Encapsulates collection name.
        """
        try:
            # If no owner is specified in the request, we use the default from settings for now
            # moving forward, we'll want to remove this fallback and require that the owner is specified
            # from the owner uuid, we're looking up the internal identifier from the corresponding profile
            #pdb.set_trace()
            database = None
            if (request and "datastore_owner__uuid" in request.GET):
                profile, created = Profile.objects.get_or_create(uuid = request.GET["datastore_owner__uuid"])
                database = profile.getDBName()
            return db[database][self._meta.collection] if database is not None else None
        except __HOLE__:
            raise ImproperlyConfigured("Define a collection in your resource.")
dataset/ETHPy150Open HumanDynamics/openPDS/openpds/tastypie_mongodb/resources.py/MongoDBResource.get_collection