Add indexes on created/modified for timestamped models (#891)#921
Add indexes on created/modified for timestamped models (#891)#921vjpixel wants to merge 1 commit into
Conversation
Every ModelAdmin orders by -created, and blog models use get_latest_by='modified'. Declaring these as Meta.indexes lets makemigrations produce standard AddIndex operations without touching the django-extensions TimeStampedModel inheritance. Also adds a composite (exhibit_type, -created) index on Exhibit to cover filter+order patterns in users profile views. Closes #891 https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
Self-reviewVerdict: ✅ Declares Choices documented:
Verified:
Unique: No duplicate PR. Generated by Claude Code |
|
Voltando aqui depois do comentário do @pablodiegoss em #891 — abri uma alternativa em #951 (draft) que segue a sugestão dele: remove a herança de
Suíte verde (233 testes), Se #951 fizer sentido, fechamos esse aqui. |
Declare
Meta.indexeson all 8TimeStampedModel-inheriting models (Sound,Marker,Object,Artwork,Exhibit,Post,PostImage,Clipping) somakemigrationsproduces standardAddIndexoperations on-createdand-modified. Adds a composite(exhibit_type, -created)index onExhibitfor the filter+order pattern in user profile views. No changes to thedjango-extensionsinheritance.Closes #891
https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
Generated by Claude Code