Exception Value:
cannot concatenate 'str' and 'NoneType' objects
class BrandSitemap(Sitemap):
def items(self):
return Page.objects.filter(parent__title=u'Бренды').values(
'short_url', 'publish_date')
def location(self, obj):
return '/brand/' + obj['short_url']
def lastmod(self, obj):
return obj['publish_date']
how to clean up obj['short_url'] in end of the url all the numbers? for example: before:agent-provocateur-1 after: agent-provocateur
def location(self, obj): return '/brand/' + str(obj['short_url'])