Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1837 closed defect (fixed)

flatpages has no __str__()

Reported by: wam-django-ticket@… Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Apparently the admin interface now uses str() rather than repr() to display values to the end user. The contrib application only has a repr method defined on the FlatPages object, so when viewing the list of flat pages, through the admin interface, we only see the class name, which is not particularly useful.

It seems like if you were calling str() on the object then if str was defined it would get used, but if not, then repr() would be used as a fall back.

Finally, it looks like this change has also bitten the django website itself the navigation links on the right hand side of

    * "Simple" generic views
          o django.views.generic.simple.direct_to_template
          o django.views.generic.simple.redirect_to
    * Date-based generic views
          o django.views.generic.date_based.archive_index
          o django.views.generic.date_based.archive_year
[snipped for brevity]

I'm filing this ticket under 'core' since it spans beyond just the admin interface (as evidenced by the above URL)

Change History (2)

comment:1 Changed 12 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2894]) Fixed #1837 -- Gave FlatPage a str

comment:2 Changed 12 years ago by Adrian Holovaty

BTW, the generic-views navigation is correct. I recently changed it so that the section headers include the entire path to the functions. That has nothing to do with FlatPage having a __str__().

Note: See TracTickets for help on using tickets.
Back to Top