Created
March 31, 2023 03:43
-
-
Save rg3915/9b220c2cbdfa3cdd16940e656b4b0f64 to your computer and use it in GitHub Desktop.
get_fields_verbose_names return field names of models field name model
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
def get_fields_verbose_names(self): | |
return [{'name': field.verbose_name, 'value': getattr(self, field.name)} for field in self._meta.fields] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment