swh.lister.core.models module

class swh.lister.core.models.ABCSQLMeta(name, bases, namespace, **kwargs)[source]

Bases: abc.ABCMeta, sqlalchemy.ext.declarative.api.DeclarativeMeta

class swh.lister.core.models.ModelBase(**kw)[source]

Bases: sqlalchemy.ext.declarative.api.Base

a common repository

uid = <swh.lister.core.abstractattribute.AbstractAttribute object>
name = Column(None, String(), table=None)
full_name = Column(None, String(), table=None)
html_url = Column(None, String(), table=None)
origin_url = Column(None, String(), table=None)
origin_type = Column(None, String(), table=None)
last_seen = Column(None, DateTime(), table=None, nullable=False)
task_id = Column(None, Integer(), table=None)
class swh.lister.core.models.IndexingModelBase(**kw)[source]

Bases: swh.lister.core.models.ModelBase

indexable = <swh.lister.core.abstractattribute.AbstractAttribute object>
swh.lister.core.models.initialize(db_engine, drop_tables=False, **kwargs)[source]

Default database initialization function for a lister.

Typically called from the lister’s initialization hook.

Parameters
  • models (list) – list of SQLAlchemy tables/models to drop/create.

  • () (db_engine) – the SQLAlchemy DB engine.

  • drop_tables (bool) – if True, tables will be dropped before (re)creating them.