tool_shed.webapp.model package

tool_shed.webapp.model.now()

Return a new datetime representing UTC day and time.

class tool_shed.webapp.model.Base(**kwargs)[source]

Bases: object

registry = <sqlalchemy.orm.decl_api.registry object>
metadata = MetaData()
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class tool_shed.webapp.model.APIKeys(**kwargs)[source]

Bases: Base

id
create_time
user_id
key
user
deleted
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('api_keys', MetaData(), Column('id', Integer(), table=<api_keys>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<api_keys>, default=ColumnDefault(<function datetime.utcnow>)), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<api_keys>), Column('key', TrimmedString(length=32), table=<api_keys>), Column('deleted', Boolean(), table=<api_keys>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.User(email=None, password=None)[source]

Bases: Base, Dictifiable

id
create_time
update_time
username
active_repositories
galaxy_sessions
api_keys
reset_tokens
groups
dict_collection_visible_keys = ['id', 'username']
dict_element_visible_keys = ['id', 'username']
bootstrap_admin_user = False
roles
non_private_roles
__init__(email=None, password=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

email
password
external
deleted
purged
new_repo_alert
all_roles()[source]
check_password(cleartext)[source]

Check if ‘cleartext’ matches ‘self.password’ when hashed.

get_disk_usage(nice_size=False)[source]
property nice_total_disk_usage
set_disk_usage(bytes)[source]
property total_disk_usage
set_password_cleartext(cleartext)[source]
set_random_password(length=16)[source]

Sets user password to a random string of the given length. :return: void

table = Table('galaxy_user', MetaData(), Column('id', Integer(), table=<galaxy_user>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<galaxy_user>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<galaxy_user>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('email', TrimmedString(length=255), table=<galaxy_user>, nullable=False), Column('username', String(length=255), table=<galaxy_user>), Column('password', TrimmedString(length=40), table=<galaxy_user>, nullable=False), Column('external', Boolean(), table=<galaxy_user>, default=ColumnDefault(False)), Column('new_repo_alert', Boolean(), table=<galaxy_user>, default=ColumnDefault(False)), Column('deleted', Boolean(), table=<galaxy_user>, default=ColumnDefault(False)), Column('purged', Boolean(), table=<galaxy_user>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.PasswordResetToken(user, token=None)[source]

Bases: Base

user_id
__init__(user, token=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

token
user
expiration_time
table = Table('password_reset_token', MetaData(), Column('token', String(length=32), table=<password_reset_token>, primary_key=True, nullable=False), Column('expiration_time', DateTime(), table=<password_reset_token>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<password_reset_token>), schema=None)
class tool_shed.webapp.model.Group(name=None)[source]

Bases: Base, Dictifiable

id
create_time
update_time
roles
users
dict_collection_visible_keys = ['id', 'name']
dict_element_visible_keys = ['id', 'name']
__init__(name=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name
deleted
table = Table('galaxy_group', MetaData(), Column('id', Integer(), table=<galaxy_group>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<galaxy_group>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<galaxy_group>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('name', String(length=255), table=<galaxy_group>), Column('deleted', Boolean(), table=<galaxy_group>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.Role(name=None, description=None, type='system', deleted=False)[source]

Bases: Base, Dictifiable

id
create_time
update_time
repositories
groups
users
dict_collection_visible_keys = ['id', 'name']
dict_element_visible_keys = ['id', 'name', 'description', 'type']
private_id = None
types = <galaxy.util.bunch.Bunch object>
__init__(name=None, description=None, type='system', deleted=False)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name
description
type
deleted
property is_repository_admin_role
table = Table('role', MetaData(), Column('id', Integer(), table=<role>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<role>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<role>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('name', String(length=255), table=<role>), Column('description', TEXT(), table=<role>), Column('type', String(length=40), table=<role>), Column('deleted', Boolean(), table=<role>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.UserGroupAssociation(user, group)[source]

Bases: Base

id
user_id
group_id
create_time
update_time
__init__(user, group)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user
group
table = Table('user_group_association', MetaData(), Column('id', Integer(), table=<user_group_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_group_association>), Column('group_id', Integer(), ForeignKey('galaxy_group.id'), table=<user_group_association>), Column('create_time', DateTime(), table=<user_group_association>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<user_group_association>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), schema=None)
class tool_shed.webapp.model.UserRoleAssociation(user, role)[source]

Bases: Base

id
user_id
role_id
create_time
update_time
__init__(user, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user
role
table = Table('user_role_association', MetaData(), Column('id', Integer(), table=<user_role_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_role_association>), Column('role_id', Integer(), ForeignKey('role.id'), table=<user_role_association>), Column('create_time', DateTime(), table=<user_role_association>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<user_role_association>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), schema=None)
class tool_shed.webapp.model.GroupRoleAssociation(group, role)[source]

Bases: Base

id
group_id
role_id
create_time
update_time
__init__(group, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

group
role
table = Table('group_role_association', MetaData(), Column('id', Integer(), table=<group_role_association>, primary_key=True, nullable=False), Column('group_id', Integer(), ForeignKey('galaxy_group.id'), table=<group_role_association>), Column('role_id', Integer(), ForeignKey('role.id'), table=<group_role_association>), Column('create_time', DateTime(), table=<group_role_association>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<group_role_association>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), schema=None)
class tool_shed.webapp.model.RepositoryRoleAssociation(repository, role)[source]

Bases: Base

id
repository_id
role_id
create_time
update_time
__init__(repository, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

repository
role
table = Table('repository_role_association', MetaData(), Column('id', Integer(), table=<repository_role_association>, primary_key=True, nullable=False), Column('repository_id', Integer(), ForeignKey('repository.id'), table=<repository_role_association>), Column('role_id', Integer(), ForeignKey('role.id'), table=<repository_role_association>), Column('create_time', DateTime(), table=<repository_role_association>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<repository_role_association>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), schema=None)
class tool_shed.webapp.model.GalaxySession(is_valid=False, **kwd)[source]

Bases: Base

id
create_time
update_time
user_id
remote_host
remote_addr
referer
session_key
prev_session_id
user
__init__(is_valid=False, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

is_valid
last_action
table = Table('galaxy_session', MetaData(), Column('id', Integer(), table=<galaxy_session>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<galaxy_session>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<galaxy_session>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<galaxy_session>), Column('remote_host', String(length=255), table=<galaxy_session>), Column('remote_addr', String(length=255), table=<galaxy_session>), Column('referer', TEXT(), table=<galaxy_session>), Column('session_key', TrimmedString(length=255), table=<galaxy_session>), Column('is_valid', Boolean(), table=<galaxy_session>, default=ColumnDefault(False)), Column('prev_session_id', Integer(), table=<galaxy_session>), Column('last_action', DateTime(), table=<galaxy_session>), schema=None)
class tool_shed.webapp.model.Repository(private=False, times_downloaded=0, deprecated=False, **kwd)[source]

Bases: Base, Dictifiable

id
create_time
update_time
type
remote_repository_url
homepage_url
description
long_description
user_id
deleted
email_alerts
categories
ratings
user
downloadable_revisions
metadata_revisions
roles
dict_collection_visible_keys = ['id', 'name', 'type', 'remote_repository_url', 'homepage_url', 'description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated', 'create_time', 'update_time']
dict_element_visible_keys = ['id', 'name', 'type', 'remote_repository_url', 'homepage_url', 'description', 'long_description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated', 'create_time', 'update_time']
file_states = <galaxy.util.bunch.Bunch object>
__init__(private=False, times_downloaded=0, deprecated=False, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

private
times_downloaded
deprecated
name
property hg_repo
property admin_role
allow_push()[source]
can_change_type()[source]
can_change_type_to(app, new_type_label)[source]
get_changesets_for_setting_metadata(app)[source]
get_repository_dependencies(app, changeset, toolshed_url)[source]
get_type_class(app)[source]
get_tool_dependencies(app, changeset_revision)[source]
installable_revisions(app, sort_revisions=True)[source]
is_new()[source]
repo_path(app=None)[source]
revision()[source]
set_allow_push(usernames, remove_auth='')[source]
tip()[source]
to_dict(view='collection', value_mapper=None)[source]

Return item dictionary.

table = Table('repository', MetaData(), Column('id', Integer(), table=<repository>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<repository>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<repository>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('name', TrimmedString(length=255), table=<repository>), Column('type', TrimmedString(length=255), table=<repository>), Column('remote_repository_url', TrimmedString(length=255), table=<repository>), Column('homepage_url', TrimmedString(length=255), table=<repository>), Column('description', TEXT(), table=<repository>), Column('long_description', TEXT(), table=<repository>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<repository>), Column('private', Boolean(), table=<repository>, default=ColumnDefault(False)), Column('deleted', Boolean(), table=<repository>, default=ColumnDefault(False)), Column('email_alerts', MutableJSONType(), table=<repository>), Column('times_downloaded', Integer(), table=<repository>), Column('deprecated', Boolean(), table=<repository>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.ItemRatingAssociation(id=None, user=None, item=None, rating=0, comment='')[source]

Bases: object

__init__(id=None, user=None, item=None, rating=0, comment='')[source]
set_item(item)[source]

Set association’s item.

class tool_shed.webapp.model.RepositoryRatingAssociation(**kwargs)[source]

Bases: Base, ItemRatingAssociation

id
create_time
update_time
repository_id
user_id
rating
comment
repository
user
set_item(repository)[source]

Set association’s item.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('repository_rating_association', MetaData(), Column('id', Integer(), table=<repository_rating_association>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<repository_rating_association>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<repository_rating_association>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('repository_id', Integer(), ForeignKey('repository.id'), table=<repository_rating_association>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<repository_rating_association>), Column('rating', Integer(), table=<repository_rating_association>), Column('comment', TEXT(), table=<repository_rating_association>), schema=None)
class tool_shed.webapp.model.Category(deleted=False, **kwd)[source]

Bases: Base, Dictifiable

id
create_time
update_time
name
description
repositories
dict_collection_visible_keys = ['id', 'name', 'description', 'deleted']
dict_element_visible_keys = ['id', 'name', 'description', 'deleted']
__init__(deleted=False, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

deleted
table = Table('category', MetaData(), Column('id', Integer(), table=<category>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<category>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<category>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('name', TrimmedString(length=255), table=<category>), Column('description', TEXT(), table=<category>), Column('deleted', Boolean(), table=<category>, default=ColumnDefault(False)), schema=None)
class tool_shed.webapp.model.RepositoryCategoryAssociation(repository=None, category=None)[source]

Bases: Base

id
repository_id
category_id
__init__(repository=None, category=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

repository
table = Table('repository_category_association', MetaData(), Column('id', Integer(), table=<repository_category_association>, primary_key=True, nullable=False), Column('repository_id', Integer(), ForeignKey('repository.id'), table=<repository_category_association>), Column('category_id', Integer(), ForeignKey('category.id'), table=<repository_category_association>), schema=None)
category
class tool_shed.webapp.model.Tag(**kwargs)[source]

Bases: Base

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('tag', MetaData(), Column('id', Integer(), table=<tag>, primary_key=True, nullable=False), Column('type', Integer(), table=<tag>), Column('parent_id', Integer(), ForeignKey('tag.id'), table=<tag>), Column('name', TrimmedString(length=255), table=<tag>), schema=None)
id
type
parent_id
name
children
parent
class tool_shed.webapp.model.RepositoryMetadata(id=None, repository_id=None, numeric_revision=None, changeset_revision=None, metadata=None, tool_versions=None, malicious=False, downloadable=False, missing_test_components=None, tools_functionally_correct=False, test_install_error=False, has_repository_dependencies=False, includes_datatypes=False, includes_tools=False, includes_tool_dependencies=False, includes_workflows=False)[source]

Bases: Dictifiable

create_time
repository
update_time
table = Table('repository_metadata', MetaData(), Column('id', Integer(), table=<repository_metadata>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<repository_metadata>, default=ColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<repository_metadata>, onupdate=ColumnDefault(<function datetime.utcnow>), default=ColumnDefault(<function datetime.utcnow>)), Column('repository_id', Integer(), ForeignKey('repository.id'), table=<repository_metadata>), Column('changeset_revision', TrimmedString(length=255), table=<repository_metadata>), Column('numeric_revision', Integer(), table=<repository_metadata>), Column('metadata', MutableJSONType(), table=<repository_metadata>), Column('tool_versions', MutableJSONType(), table=<repository_metadata>), Column('malicious', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('downloadable', Boolean(), table=<repository_metadata>, default=ColumnDefault(True)), Column('missing_test_components', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('has_repository_dependencies', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('includes_datatypes', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('includes_tools', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('includes_tool_dependencies', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), Column('includes_workflows', Boolean(), table=<repository_metadata>, default=ColumnDefault(False)), schema=None)
dict_collection_visible_keys = ['id', 'repository_id', 'numeric_revision', 'changeset_revision', 'malicious', 'downloadable', 'missing_test_components', 'has_repository_dependencies', 'includes_datatypes', 'includes_tools', 'includes_tool_dependencies', 'includes_tools_for_display_in_tool_panel', 'includes_workflows']
dict_element_visible_keys = ['id', 'repository_id', 'numeric_revision', 'changeset_revision', 'malicious', 'downloadable', 'missing_test_components', 'has_repository_dependencies', 'includes_datatypes', 'includes_tools', 'includes_tool_dependencies', 'includes_tools_for_display_in_tool_panel', 'includes_workflows', 'repository_dependencies']
__init__(id=None, repository_id=None, numeric_revision=None, changeset_revision=None, metadata=None, tool_versions=None, malicious=False, downloadable=False, missing_test_components=None, tools_functionally_correct=False, test_install_error=False, has_repository_dependencies=False, includes_datatypes=False, includes_tools=False, includes_tool_dependencies=False, includes_workflows=False)
id
repository_id
numeric_revision
changeset_revision
metadata
tool_versions
malicious
downloadable
missing_test_components
has_repository_dependencies
includes_datatypes
includes_tools
includes_tool_dependencies
includes_workflows
property includes_tools_for_display_in_tool_panel
property repository_dependencies
tool_shed.webapp.model.sort_by_attr(seq, attr)[source]

Sort the sequence of objects by object’s attribute Arguments: seq - the list or any sequence (including immutable one) of objects to sort. attr - the name of attribute to sort by

Subpackages

Submodules

tool_shed.webapp.model.mapping module

Details of how the data model objects are mapped onto the relational database are encapsulated here.

class tool_shed.webapp.model.mapping.ToolShedModelMapping(model_modules, engine)[source]

Bases: SharedModelMapping

security_agent: CommunityRBACAgent
shed_counter: ShedCounter
create_tables: bool
tool_shed.webapp.model.mapping.init(url: str, engine_options: Optional[Dict[str, Any]] = None, create_tables: bool = False) ToolShedModelMapping[source]

Connect mappings to the database