-
-
Notifications
You must be signed in to change notification settings - Fork 506
Generic sitemap #1198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic sitemap #1198
Conversation
from django.urls import reverse | ||
from myapp.models import Offer | ||
|
||
class OfferSitemap(Sitemap): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean
class OfferSitemap(Sitemap): | |
class OfferSitemap(Sitemap[Offer]): |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right. I just updated this and the other test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a case with
class WrongOfferSitemap(Sitemap[Offer]):
def items() -> BadReturn: ...
def locations(arg: BadArg): ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I've added this
5ad2cae
to
195ad71
Compare
}, | ||
) | ||
|
||
class WrongOfferSitemap(Sitemap[Offer]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last question: what about GenericSiteMap
? Should we test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was unsure about this one. I don't know how people are generally using it.
Maybe I should add a case close to the documentation exemple to make sure everything pass ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and one more for an incorrect version
d5722e0
to
73782cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks for the review 🙌 ! |
I have made things!
Implement generic type for the
Sitemap
class and also add the get_latest_lastmod method stub (added in django 4.1)Related issues