Easier to read, and avoids backslashes:

    Notice.objects.filter(
        directory__pootle_path__startswith=directory.pootle_path,
    ).select_related('directory')[:30]