Skip to content

The type for location in the class Sitemap is wrong. #1000

@adambirds

Description

@adambirds

def location(self, item: Model) -> str: ...

The item shouldn't just be Model. As you can see it can also just be a string too if creating a sitemap of pages that aren't in models:

class StaticViewSitemap(Sitemap):
    priority = 1
    changefreq = "always"

    def items(self) -> List[str]:
        return ["home", "about", "contact", "recommendations", "privacy-policy", "blog"]

    def location(self, item: str) -> str:
        return reverse(item)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions