Ejemplo n.º 1
0
 def handle(self, *args, **options):
     sitemap = generate_sitemap(
         with_portal_links=not options.get('without_portal_links'),
         with_menu_portal=not options.get('without_menu_portal'),
         with_sections=not options.get('without_sections'),
         with_menu_section=not options.get('without_menu_section'),
         with_contents=not options.get('without_contents'))
     fich = file(path.join(settings.MEDIA_ROOT, 'sitemap.xml'), 'w')
     fich.write(sitemap)
     fich.close()
Ejemplo n.º 2
0
def sitemap(request, with_portal_links, with_menu_portal,
                     with_sections, with_menu_section, with_contents):
    params = {}
    params['with_portal_links'] = true_by_default(with_portal_links)
    params['with_menu_portal'] = true_by_default(with_menu_portal)
    params['with_sections'] = true_by_default(with_sections)
    params['with_menu_section'] = false_by_default(with_menu_section)
    params['with_contents'] = false_by_default(with_contents)
    sitemap = generate_sitemap(**params)
    return HttpResponse(sitemap, mimetype="text/xml")
Ejemplo n.º 3
0
def sitemap(request, with_portal_links, with_menu_portal, with_sections,
            with_menu_section, with_contents):
    params = {}
    params['with_portal_links'] = true_by_default(with_portal_links)
    params['with_menu_portal'] = true_by_default(with_menu_portal)
    params['with_sections'] = true_by_default(with_sections)
    params['with_menu_section'] = false_by_default(with_menu_section)
    params['with_contents'] = false_by_default(with_contents)
    sitemap = generate_sitemap(**params)
    return HttpResponse(sitemap, mimetype="text/xml")
Ejemplo n.º 4
0
 def handle(self, *args, **options):
     sitemap = generate_sitemap(
         with_portal_links=not options.get("without_portal_links"),
         with_menu_portal=not options.get("without_menu_portal"),
         with_sections=not options.get("without_sections"),
         with_menu_section=not options.get("without_menu_section"),
         with_contents=not options.get("without_contents"),
     )
     fich = file(path.join(settings.MEDIA_ROOT, "sitemap.xml"), "w")
     fich.write(sitemap)
     fich.close()