bmuller/twistar

afterInit is not called

Closed this issue · 2 comments

twistar.util.createInstances is the only place where it's called which means Model() does not invoke afterInit. This is in implicit violation of what the docstring of DBObject.__init__ says:

def __init__(self, **kwargs):
    """
    Constructor.  DO NOT OVERWRITE.  Use the L{DBObject.afterInit} method.

Fixed in pull request #31

In 1ccbf5e I added some more clarifying text for afterInit. The idea was that method should be called immediately after an object was instantiated as the result of a DB query - not that it would be called as the direct result of every object construction.