Created
June 9, 2018 19:21
-
-
Save ikedumancas/906bdd5308d97478b81a4ce10a5f91e8 to your computer and use it in GitHub Desktop.
Django Admin: Change ModelAdmin method string representation with short_description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SampleModelAdmin(admin.ModelAdmin): | |
| def sample_method_you_want_to_display_in_admin_fields(self, obj): | |
| ... | |
| return something | |
| sample_method_you_want_to_display_in_admin_fields.short_description = "Text you want to Show as Label" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment