Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1837 closed defect (fixed)

flatpages has no __str__()

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

Description

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
http://www.djangoproject.com/documentation/generic_views/
shows:

    * "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 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by Adrian Holovaty, 18 years ago

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