1616class StaticSitemap (BaseSitemap ):
1717 """A sitemap for static routes that includes all other dynamic sitemaps."""
1818
19- def changefreq (self , item ):
20- """Return the change frequency for a static route item."""
19+ def changefreq (self , item ) -> str :
20+ """Return the change frequency for a static route item.
21+
22+ Args:
23+ item: Dictionary containing static route information.
24+
25+ Returns:
26+ str: Change frequency value for the sitemap entry.
27+
28+ """
2129 return item ["changefreq" ]
2230
23- def location (self , item ):
24- """Return the URL path for a static route item."""
31+ def location (self , item ) -> str :
32+ """Return the URL path for a static route item.
33+
34+ Args:
35+ item: Dictionary containing static route information.
36+
37+ Returns:
38+ str: The URL path for the static route.
39+
40+ """
2541 return item ["path" ]
2642
27- def items (self ):
28- """Return list of static routes for sitemap generation."""
43+ def items (self ) -> tuple [dict , ...]:
44+ """Return static routes for sitemap generation.
45+
46+ Returns:
47+ tuple: Tuple of dictionaries containing static route configurations.
48+
49+ """
2950 return BaseSitemap .STATIC_ROUTES
3051
31- def lastmod (self , item ):
32- """Return the last modification date for a static route item."""
52+ def lastmod (self , item : dict ) -> datetime :
53+ """Return the last modification date for a static route item.
54+
55+ Args:
56+ item: Dictionary containing static route information.
57+
58+ Returns:
59+ datetime: Last modification timestamp based on the most recently updated
60+ object of the corresponding model, or current time if no model mapping exists.
61+
62+ """
3363 path_to_model = {
3464 "/chapters" : Chapter ,
3565 "/committees" : Committee ,
@@ -41,11 +71,19 @@ def lastmod(self, item):
4171 }
4272
4373 return (
44- model .objects .aggregate (latest = Max ("updated_at" ))["latest" ]
74+ model .objects .aggregate (latest = Max ("updated_at" ))["latest" ] # type: ignore[attr-defined]
4575 if (model := path_to_model .get (item ["path" ]))
4676 else datetime .now (UTC )
4777 )
4878
49- def priority (self , item ):
50- """Return the priority score for a static route item."""
79+ def priority (self , item : dict ) -> float :
80+ """Return the priority score for a static route item.
81+
82+ Args:
83+ item: Dictionary containing static route information.
84+
85+ Returns:
86+ float: Priority value for the sitemap entry (0.0 to 1.0).
87+
88+ """
5189 return item ["priority" ]
0 commit comments