#31434: Enhancement in the default __str__() function.
-------------------------------------+-------------------------------------
Reporter: Chinmoy | Owner: Chinmoy
Type: | Status: assigned
Uncategorized |
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The default ** __str__() ** function provides a rather impractical output
and almost every time the developer has to change it to get the summary of
the model. I suggest a more elaborate default __str__() function which
outputs the field names with their datatypes(A skeletal schema).Maybe it
could also print the complete data with the field name and their values?
This is an example of what it could output.
----
<QuerySet [
<Question: (<django.db.models.fields.AutoField: id>,
<django.db.models.fields.CharField: question_text>,
<django.db.models.fields.DateTimeField: pub_date>) object (1)> ]>
----
--
Ticket URL: <https://code.djangoproject.com/ticket/31434>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.f8eea9b3181e46415b2c48dd970293e0%40djangoproject.com.