allura.model.session

class allura.model.session.ArtifactSessionExtension(session)
after_flush(obj=None)

Update artifact references, and add/update this artifact to solr

class allura.model.session.BatchIndexer(session)

Tracks needed search index operations over the life of a ming.odm.session.ThreadLocalODMSession session, and performs them in a batch when flush() is called.

classmethod flush()

Creates indexing tasks for cached adds and deletes, and resets the caches.

Warning

This method is NOT called automatically when the parent session is flushed. It MUST be called explicitly.

update_index(objects_deleted, arefs_added)

Caches adds and deletes for handling later. Called after each flush of the parent session.

Parameters:
  • objects_deletedallura.model.artifact.Artifact instances that were deleted in the flush.

  • arefs_addedallura.model.artifact.ArtifactReference instances for all Artifact instances that were added or modified in the flush.

class allura.model.session.ExplicitFlushOnlySessionExtension(session)

Used to avoid auto-flushing objects after merely creating them.

Only save them when we really want to by calling flush(obj) or setting obj.explicit_flush = True

before_flush(obj=None)

Before the session is flushed for obj

If obj is None it means all the objects in the UnitOfWork which can be retrieved by iterating over ODMSession.uow

class allura.model.session.IndexerSessionExtension(session)
after_flush(obj=None)

After the session is flushed for obj

If obj is None it means all the objects in the UnitOfWork which can be retrieved by iterating over ODMSession.uow

class allura.model.session.ManagedSessionExtension(session)
after_flush(obj=None)

After the session is flushed for obj

If obj is None it means all the objects in the UnitOfWork which can be retrieved by iterating over ODMSession.uow

before_flush(obj=None)

Before the session is flushed for obj

If obj is None it means all the objects in the UnitOfWork which can be retrieved by iterating over ODMSession.uow

allura.model.session.substitute_extensions(session, extensions=None)

Temporarily replace the extensions on a ming.odm.session.ThreadLocalODMSession session.