Skip to content

mark_changed needs better docs, perhaps a better API #46

@jvanasco

Description

@jvanasco

After several hours of debugging, I finally solved a SqlAlchemy issue:

  1. mark_changed has an undocumented keep_session kwarg, which defaults to False
  2. mark_changed is unaware of how the session was registered (i.e. what the user intended keep_session to be)

My first suggestion is to update the docs/readme to point this out.

My second suggestion is to extend the ZopeTransactionEvents object to have it's own join_transaction and mark_changed functions, which invoke the global ones with the configured keep_session or anything else.

Since register returns the configured extension, this would allow a developer to invoke ext.mark_changed(dbSession) and preserve the value of keep_session. I'd be happy to generate a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions