def get_page_queryset_from_path(path, preview=False, draft=False, site=None):
 if is_installed('django.contrib.admin'):
  admin_base = admin_reverse('index')
  if path.startswith(admin_base):
   match = ADMIN_PAGE_RE.search(path)
   if match:
    return Page.objects.filter(pk=match.group(1))
   else:
    return Page.objects.none()
 if (not site):
  site = Site.objects.get_current()
 if draft:
  pages = Page.objects.drafts().filter(site=site)
 elif preview:
  pages = Page.objects.public().filter(site=site)
 else:
  pages = Page.objects.public().published(site=site)
 if (not path):
  return pages.filter(is_home=True, site=site)[:1]
 return pages.filter(title_set__path=path).distinct()

def get_page_queryset_from_path ( path , preview = False , draft = False , site = None ) : if is_installed ( 'django.contrib.admin' ) : admin_base = admin_reverse ( 'index' ) if path . startswith ( admin_base ) : match = ADMIN_PAGE_RE . search ( path ) if match : return Page . objects . filter ( pk = match . group ( 1 ) ) else : return Page . objects . none ( ) if ( not site ) : site = Site . objects . get_current ( ) if draft : pages = Page . objects . drafts ( ) . filter ( site = site ) elif preview : pages = Page . objects . public ( ) . filter ( site = site ) else : pages = Page . objects . public ( ) . published ( site = site ) if ( not path ) : return pages . filter ( is_home = True , site = site ) [ : 1 ] return pages . filter ( title_set__path = path ) . distinct ( )
returns a queryset of pages corresponding to the path given .