Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy.web.base package¶
Submodules¶
galaxy.web.base.controller module¶
Contains functionality needed in every web interface
-
class
galaxy.web.base.controller.
BaseController
(app)[source]¶ Bases:
object
Base class for Galaxy web application controllers.
-
get_class
(class_name)[source]¶ Returns the class object that a string denotes. Without this method, we’d have to do eval(<class_name>).
-
get_object
(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]¶ Convenience method to get a model object with the specified checks.
-
encode_all_ids
(trans, rval, recursive=False)[source]¶ Encodes all integer values in the dict rval whose keys are ‘id’ or end with ‘_id’
It might be useful to turn this in to a decorator
-
-
galaxy.web.base.controller.
Root
¶
-
class
galaxy.web.base.controller.
BaseUIController
(app)[source]¶
-
class
galaxy.web.base.controller.
BaseAPIController
(app)[source]¶ Bases:
galaxy.web.base.controller.BaseController
-
get_object
(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]¶
-
-
class
galaxy.web.base.controller.
JSAppLauncher
(app)[source]¶ Bases:
galaxy.web.base.controller.BaseUIController
A controller that launches JavaScript web applications.
-
JS_APP_MAKO_FILEPATH
= '/js-app.mako'¶ path to js app template
-
DEFAULT_ENTRY_FN
= 'app'¶ window-scoped js function to call to start the app (will be passed options, bootstrapped)
-
USER_BOOTSTRAP_KEYS
= ('id', 'email', 'username', 'is_admin', 'tags_used', 'total_disk_usage', 'nice_total_disk_usage', 'quota_percent', 'preferences')¶ keys used when serializing current user for bootstrapped data
-
client
(trans, **kwd)[source]¶ Endpoint for clientside routes. This ships the primary SPA client.
Should not be used with url_for – see (https://github.com/galaxyproject/galaxy/issues/1878) for why.
-
template
(trans, app_name, entry_fn='app', options=None, bootstrapped_data=None, masthead=True, **additional_options)[source]¶ Render and return the single page mako template that starts the app.
app_name (string): the first portion of the webpack bundle to as the app. entry_fn (string): the name of the window-scope function that starts the
app. Defaults to ‘app’.- bootstrapped_data (dict): (optional) update containing any more data
- the app may need.
- masthead (boolean): (optional, default=True) include masthead elements in
- the initial page dom.
additional_options (kwargs): update to the options sent to the app.
-
-
class
galaxy.web.base.controller.
Datatype
(extension, dtype, type_extension, mimetype, display_in_upload)[source]¶ Bases:
object
Used for storing in-memory list of datatypes currently in the datatypes registry.
-
class
galaxy.web.base.controller.
CreatesApiKeysMixin
[source]¶ Bases:
object
Mixing centralizing logic for creating API keys for user objects.
Deprecated - please use api_keys.ApiKeyManager for new development.
-
class
galaxy.web.base.controller.
SharableItemSecurityMixin
[source]¶ Bases:
object
Mixin for handling security for sharable items.
-
class
galaxy.web.base.controller.
UsesLibraryMixinItems
[source]¶ Bases:
galaxy.web.base.controller.SharableItemSecurityMixin
-
get_library_dataset_dataset_association
(trans, id, check_ownership=False, check_accessible=True)[source]¶
-
-
class
galaxy.web.base.controller.
UsesVisualizationMixin
[source]¶ Bases:
galaxy.web.base.controller.UsesLibraryMixinItems
Mixin for controllers that use Visualization objects.
-
get_visualization
(trans, id, check_ownership=True, check_accessible=False)[source]¶ Get a Visualization from the database by id, verifying ownership.
-
get_visualizations_by_user
(trans, user, order_by=None, query_only=False)[source]¶ Return query or query results of visualizations filtered by a user.
Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.
Return query or query results for visualizations shared with the given user.
Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.
-
get_published_visualizations
(trans, exclude_user=None, order_by=None, query_only=False)[source]¶ Return query or query results for published visualizations optionally excluding the user in exclude_user.
Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.
-
get_visualization_summary_dict
(visualization)[source]¶ Return a set of summary attributes for a visualization in dictionary form. NOTE: that encoding ids isn’t done here should happen at the caller level.
-
get_visualization_dict
(visualization)[source]¶ Return a set of detailed attributes for a visualization in dictionary form. The visualization’s latest_revision is returned in its own sub-dictionary. NOTE: that encoding ids isn’t done here should happen at the caller level.
-
get_visualization_revision_dict
(revision)[source]¶ Return a set of detailed attributes for a visualization in dictionary form. NOTE: that encoding ids isn’t done here should happen at the caller level.
-
import_visualization
(trans, id, user=None)[source]¶ Copy the visualization with the given id and associate the copy with the given user (defaults to trans.user).
Raises ItemAccessibilityException if user is not passed and the current user is anonymous, and if the visualization is not importable. Raises ItemDeletionException if the visualization has been deleted.
-
create_visualization
(trans, type, title='Untitled Visualization', slug=None, dbkey=None, annotation=None, config={}, save=True)[source]¶ Create visualiation and first revision.
-
add_visualization_revision
(trans, visualization, config, title, dbkey)[source]¶ Adds a new VisualizationRevision to the given visualization with the given parameters and set its parent visualization’s latest_revision to the new revision.
-
save_visualization
(trans, config, type, id=None, title=None, dbkey=None, slug=None, annotation=None)[source]¶
-
get_visualization_config
(trans, visualization)[source]¶ Returns a visualization’s configuration. Only works for trackster visualizations right now.
-
-
class
galaxy.web.base.controller.
UsesStoredWorkflowMixin
[source]¶ Bases:
galaxy.web.base.controller.SharableItemSecurityMixin
,galaxy.model.item_attrs.UsesAnnotations
Mixin for controllers that use StoredWorkflow objects.
-
class
galaxy.web.base.controller.
UsesFormDefinitionsMixin
[source]¶ Bases:
object
Mixin for controllers that use Galaxy form objects.
-
class
galaxy.web.base.controller.
SharableMixin
[source]¶ Bases:
object
Mixin for a controller that manages an item that can be shared.
-
manager
= None¶
-
serializer
= None¶
-
create_item_slug
(sa_session, item)[source]¶ Create/set item slug. Slug is unique among user’s importable items for item’s class. Returns true if item’s slug was set/changed; false otherwise.
Handle sharing an item with a particular user.
-
-
class
galaxy.web.base.controller.
UsesTagsMixin
[source]¶ Bases:
galaxy.web.base.controller.SharableItemSecurityMixin
Return a list of distinct ‘user_tname:user_value’ strings that the given user has used.
user defaults to trans.user. Returns an empty list if no user is given and trans.user is anonymous.
-
class
galaxy.web.base.controller.
UsesExtendedMetadataMixin
[source]¶ Bases:
galaxy.web.base.controller.SharableItemSecurityMixin
Mixin for getting and setting item extended metadata.
-
get_item_extended_metadata_obj
(trans, item)[source]¶ Given an item object (such as a LibraryDatasetDatasetAssociation), find the object of the associated extended metadata
-
Bases:
exceptions.Exception
Deprecated: BaseController used to be available under the name Root