def get_request(self):
    """
    Retrieves the request from the current model instance.
    This value is used to access session information from the model.

    :rtype: Request
    :return: The retrieve request from the current model instance.
    """

    # in case the current model contains the scope map defined the request
    # is retrieved from there, otherwise the "normal" request variable
    # is used for the retrieval
    if hasattr(self, "_scope"): request = self._scope.get("request", self.request)
    else: request = self.request
    return request