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

primary_sponsorships refactor #395

Merged
merged 1 commit into from
Jan 6, 2024
Merged

Conversation

derekeder
Copy link
Member

@derekeder derekeder commented Jan 5, 2024

@derekeder derekeder temporarily deployed to chi-councilm-primary-sp-y4m8as January 5, 2024 22:03 Inactive
@derekeder derekeder changed the title rewrote primary_sponsorships attribute for person, using consistantly primary_sponsorships refactor Jan 5, 2024
.annotate(last_action=Max("actions__date"))
.order_by("-last_action")[:10]
)
context["sponsored_legislation"] = person.primary_sponsorships[:10]
Copy link
Member Author

Choose a reason for hiding this comment

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

django interprets [:10] as limit 10 on the queryset so we can pass in our limit when we call this attribute

@derekeder derekeder requested a review from fgregg January 5, 2024 22:11
@fgregg fgregg merged commit 96af9e1 into main Jan 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants