notional icon indicating copy to clipboard operation
notional copied to clipboard

Late binding of session to custom ORM pages is broken.

Open jheddings opened this issue 3 years ago • 1 comments

Currently, sessions must be bound to a ConnectedPage prior to defining custom types.

CustomPage = connected_page()

def Animal(CustomPage):
    # ORM properties

def main():
    notion = notional.connect(auth=auth_token)
    CustomPage.bind(notion)

    # at this point, the session in Animal is None

jheddings avatar Oct 26 '21 15:10 jheddings

More specifically, to support late binding each subclass must bind to the session rather than the base class. Ideally, once the base class is bound, all subclasses should inherit the session.

jheddings avatar Oct 27 '21 05:10 jheddings