How to inject types for standalone zodbbrowser?

Bug #1404561 reported by Andreas Balogh on 2014-12-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB Browser
Undecided
Unassigned

Bug Description

I am using the standalone zodbbrowser 0.11.1 with a ZODB3 database. I can access the database fine but when I insert objects of unknown type into the ZODB the browser only displays:

Attributes
data: {u'account-1': <persistent broken __main__.Account instance '\x00\x00\x00\x00\x00\x00\x00\x01'>,
            u'account-2': <persistent broken __main__.Account instance '\x00\x00\x00\x00\x00\x00\x00\x01'>
}

I'd like to see a formatted printout from __repr__ (or __str__) instead. The short user guide on pypi at Help! Broken objects everywhere recommends to make sure your application objects are importable from the Python path. But I don't know how.

How do I make the Account class (from the tutorial):

class Account(Persistent):
    def __str__(self):
        ...

known to zodbbrowser in standalone mode so that the persistent broken type are replaced with a __str__ representation of the object instance?

NB: cross posted http://stackoverflow.com/questions/27573993/how-to-inject-types-for-standalone-zodbbrowser

Andreas Balogh (baloand) wrote :

I'veput this to github. Don't know how to delete the bug here...

Changed in zodbbrowser:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers