bmuller / twistar

Twistar is an object-relational mapper (ORM) for Python that uses the Twisted library to provide asynchronous DB interaction.
http://findingscience.com/twistar
Other
132 stars 38 forks source link

afterInit is not called #30

Closed erikkaplun closed 11 years ago

erikkaplun commented 11 years ago

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.
erikkaplun commented 11 years ago

Fixed in pull request https://github.com/bmuller/twistar/pull/31

bmuller commented 11 years ago

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.