Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions feincms/module/page/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# ------------------------------------------------------------------------

from django.db.models import Max
from django.db.models import get_model
from django.contrib.sitemaps import Sitemap

from feincms.module.page.models import Page

from feincms import settings

# ------------------------------------------------------------------------
class PageSitemap(Sitemap):
"""
The PageSitemap can be used to automatically generate sitemap.xml files
for submission to index engines. See http://www.sitemaps.org/ for details.
"""
def __init__(self, navigation_only=False, max_depth=0, changefreq=None, queryset=None, filter=None, extended_navigation=False, *args, **kwargs):
def __init__(self, navigation_only=False, max_depth=0, changefreq=None, queryset=None, filter=None, extended_navigation=False, page_model=settings.FEINCMS_DEFAULT_PAGE_MODEL, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be from feincms import settings instead -- the FeinCMS settings aren't added to django.conf.settings. Instead, values from django.conf.settings override the default values in feincms.default_settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, thanks, I remember now. Update pushed.

"""
The PageSitemap accepts the following parameters for customisation
of the resulting sitemap.xml output:
Expand Down Expand Up @@ -42,6 +42,7 @@ def __init__(self, navigation_only=False, max_depth=0, changefreq=None, queryset
if queryset is not None:
self.queryset = queryset
else:
Page = get_model(*page_model.split('.'))
self.queryset = Page.objects.active()

def items(self):
Expand Down