Django

Code

Ticket #1837 (closed: fixed)

Opened 3 years ago

Last modified 3 years ago

flatpages has no __str__()

Reported by: wam-django-ticket@wamber.net Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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)

Attachments

Change History

05/11/06 09:38:28 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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

05/11/06 09:39:23 changed by adrian

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__().


Add/Change #1837 (flatpages has no __str__())




Change Properties
Action