Changes between Initial Version and Version 1 of Ticket #31434


Ignore:
Timestamp:
Apr 7, 2020, 3:22:15 PM (5 years ago)
Author:
Mariusz Felisiak
Comment:

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 don't agree. The current implementation is the result of consensus reached on the mailing list and IMO is useful in most of cases. You can refresh a discussion on DevelopersMailingList if you don't agree.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31434

    • Property Resolutionwontfix
    • Property Status assignedclosed
    • Property Type UncategorizedNew feature
  • Ticket #31434 – Description

    initial v1  
    1 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?
     1The 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?
    22This is an example of what it could output.
    33
    4 ----
    5 
     4{{{
    65<QuerySet [
    76<Question: (<django.db.models.fields.AutoField: id>, <django.db.models.fields.CharField: question_text>, <django.db.models.fields.DateTimeField: pub_date>) object (1)>  ]>
     7}}}
    88
    9 ----
    10 
Back to Top