InstanceGrokkers don't work without a hack

Bug #610488 reported by Martijn Faassen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
Status tracked in 1.3
1.3
Opinion
Undecided
Martijn Faassen

Bug Description

When using InstanceGrokkers to grok instances in modules, in some cases the martian.util.locally_defined function will fail for instances which *are* locally defined, causing instances not to be grokked.

The way to fix this is to place the following hackish thing in the __init__ of the instance's class (*not* in a base class):

self.__grok_module__ = martian.util.caller_module()

We should investigate changing martian somehow so that this is not needed anymore. Possibly we can poke __grok_module__ into the instance during Grok time.

Revision history for this message
Christian Klinger (cklinger) wrote :

Any Idea how to fix this in general?

Changed in grok:
assignee: nobody → Martijn Faassen (faassen)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.