Fix OrderedModelManager warnings in Sponsorship models (#2743)
Overview
This PR resolves the warning (ordered_model.W003) for both SponsorshipBenefit and SponsorshipPackage models. These models subclass OrderedModel but were previously using managers that did not inherit from OrderedModelManager.
Changes Made
- Updated
SponsorshipPackageto useOrderedModelManager.from_queryset(SponsorshipPackageQuerySet)() - Updated
SponsorshipBenefitto useOrderedModelManager.from_queryset(SponsorshipBenefitQuerySet)() - Added necessary import for
OrderedModelManager
Why This Fixes the Warning
Using .as_manager() does not ensure that the resulting manager inherits from OrderedModelManager, even if the queryset does. Using .from_queryset() ensures the manager inherits from OrderedModelManager while preserving custom queryset functionality.
Fixes #2743
hi @JacobCoffee and @ewdurbin, just wanted to follow up on this PR (#2743) when you get a chance. This is my FIRST open-source contribution and I’d love any feedback or direction if anything needs to be changed. TYIA!!