def model_query_scope_is_project(context, model):
    """Determine if a model should be scoped to a project.

    :param context: The context to check for admin and advsvc rights.
    :param model: The model to check the project_id of.
    :returns: True if the context is not admin and not advsvc and the model
        has a project_id. False otherwise.
    """
    return (not context.is_admin and hasattr(model, 'project_id')) and (not
        context.is_advsvc and hasattr(model, 'project_id'))
