예제 #1
0
파일: view.py 프로젝트: Pierrestef/pootle
def get_view_units_dir(request, translation_project, dir_path):
    if dir_path:
        pootle_path = translation_project.pootle_path + dir_path
        units_query = Unit.objects.filter(store__pootle_path__startswith=pootle_path)
    else:
        units_query = Unit.objects.filter(store__translation_project=translation_project)
    return get_view_units(request, units_query)
예제 #2
0
def get_view_units_dir(request, translation_project, dir_path):
    if not check_permission("view", request):
        raise PermissionDenied(_("You do not have rights to access this translation project."))
    units_query = translation_project.units
    if dir_path:
        pootle_path = translation_project.pootle_path + dir_path
        units_query = units_query.filter(store__pootle_path__startswith=pootle_path)
    return get_view_units(request, units_query)
예제 #3
0
파일: view.py 프로젝트: julen/pootle
def get_view_units_dir(request, translation_project, dir_path):
    if not check_permission("view", request):
        raise PermissionDenied(
            _("You do not have rights to access this translation project."))
    units_query = translation_project.units
    if dir_path:
        pootle_path = translation_project.pootle_path + dir_path
        units_query = units_query.filter(
            store__pootle_path__startswith=pootle_path)
    return get_view_units(request, units_query)