Skip to content
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

Syndication Feed items do not need to be Model instances #1444

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

bigfootjon
Copy link
Contributor

I have made things!

I relaxed the bound in the TypeVar on Feed items as this type does not necessarily need to be a Model instance:

items() is, a method that returns a list of objects that should be included in the feed as elements. Although this example returns NewsItem objects using Django’s object-relational mapper, items() doesn’t have to return model instances. Although you get a few bits of functionality “for free” by using Django models, items() can return any type of object you want.

(ref: https://docs.djangoproject.com/en/4.2/ref/contrib/syndication/#a-simple-example)

Related issues

N/A

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Thanks!

@intgr intgr changed the title Mark Feed Items as not needing to be Model instances Syndication Feed items do not need to be Model instances Apr 26, 2023
@intgr intgr merged commit 4ab0159 into typeddjango:master Apr 26, 2023
@bigfootjon bigfootjon deleted the feed-bound branch May 21, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants