commit/galaxy-central: carlfeberhard: Managers: cleanup and removal of my awesome ascii art
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f9199d6aca6e/ Changeset: f9199d6aca6e User: carlfeberhard Date: 2015-01-23 18:09:42+00:00 Summary: Managers: cleanup and removal of my awesome ascii art Affected #: 11 files diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/annotatable.py --- a/lib/galaxy/managers/annotatable.py +++ b/lib/galaxy/managers/annotatable.py @@ -6,14 +6,13 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class AnnotatableManagerInterface( object ): + #: class of AnnotationAssociation (e.g. HistoryAnnotationAssociation) annotation_assoc = None # TODO: most of this seems to be covered by item_attrs.UsesAnnotations -# ============================================================================= class AnnotatableSerializer( object ): def add_serializers( self ): @@ -31,7 +30,6 @@ return returned -# ============================================================================= class AnnotatableDeserializer( object ): def add_deserializers( self ): diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/base.py --- a/lib/galaxy/managers/base.py +++ b/lib/galaxy/managers/base.py @@ -33,12 +33,11 @@ from galaxy import model from galaxy.model import tool_shed_install - import logging log = logging.getLogger( __name__ ) -# ============================================================================= +# ==== accessors from base/controller.py def security_check( trans, item, check_ownership=False, check_accessible=False ): """ Security checks for an item: checks if (a) user owns item or (b) item @@ -166,8 +165,6 @@ """ return ( self.model_class.create_time, ) - # NOTE: at this layer, all ids are expected to be decoded and in int form - # ------------------------------------------------------------------------- get/read/query def query( self, trans, eagerloads=True, filters=None, order_by=None, limit=None, offset=None, **kwargs ): """ Return a basic query from model_class, filters, order_by, and limit and offset. @@ -246,7 +243,6 @@ query = query.offset( offset ) return query - # ......................................................................... common queries def one( self, trans, **kwargs ): """ Sends kwargs to build the query and returns one and only one model. @@ -280,8 +276,7 @@ except exceptions.ObjectNotFound: return None - # TODO: get? - + #NOTE: at this layer, all ids are expected to be decoded and in int form def by_id( self, trans, id, **kwargs ): """ Gets a model by primary id. @@ -341,7 +336,6 @@ in_order.append( item_dict[ id ] ) return in_order - # ------------------------------------------------------------------------- create def create( self, trans, flush=True, *args, **kwargs ): """ Generically create a new model. @@ -359,7 +353,6 @@ """ raise exceptions.NotImplemented( 'Abstract method' ) - # ------------------------------------------------------------------------- update def update( self, trans, item, new_values, flush=True, **kwargs ): """ Given a dictionary of new values, update `item` and return it. @@ -391,13 +384,12 @@ foreign_key = getattr( associated_model_class, foreign_key_name ) return trans.sa_session.query( associated_model_class ).filter( foreign_key == item ) - # ------------------------------------------------------------------------- delete # a rename of sql DELETE to differentiate from the Galaxy notion of mark_as_deleted # def destroy( self, trans, item, **kwargs ): # return item -# ============================================================================= SERIALIZERS/to_dict,from_dict +# ==== SERIALIZERS/to_dict,from_dict class ModelSerializingError( exceptions.InternalServerError ): """Thrown when request model values can't be serialized""" pass @@ -410,7 +402,6 @@ pass -# ----------------------------------------------------------------------------- class ModelSerializer( object ): """ Turns models into JSONable dicts. @@ -447,7 +438,6 @@ self.views = {} self.default_view = None - # ......................................................................... serializing def add_serializers( self ): """ Register a map of attribute keys -> serializing functions that will serialize @@ -482,7 +472,7 @@ # TODO:?? point of change but not really necessary? return getattr( item, key ) - # ......................................................................... serializers for common galaxy objects + # serializers for common galaxy objects def serialize_date( self, trans, item, key ): """ Serialize a date attribute of `item`. @@ -497,8 +487,7 @@ id = getattr( item, key ) return self.app.security.encode_id( id ) if id is not None else None - # ......................................................................... serializing to a view - # where a view is a predefied list of keys to serialize + # serializing to a view where a view is a predefied list of keys to serialize def serialize_to_view( self, trans, item, view=None, keys=None, default_view=None ): """ Use a predefined list of keys (the string `view`) and any additional keys @@ -539,7 +528,6 @@ return self.views[ view ][:] -# ----------------------------------------------------------------------------- class ModelDeserializer( object ): """ An object that converts an incoming serialized dict into values that can be @@ -548,6 +536,8 @@ #: the class used to create this deserializer's generically accessible model_manager model_manager_class = None + #TODO:?? a larger question is: which should be first? Deserialize then validate - or - validate then deserialize? + def __init__( self, app ): """ Set up deserializers and validator. @@ -626,8 +616,6 @@ return self.default_deserializer( trans, item, key, val ) -# ----------------------------------------------------------------------------- -# TODO:?? a larger question is: which should be first? Deserialize then validate - or - validate then deserialize? class ModelValidator( object ): """ An object that inspects a dictionary (generally meant to be a set of @@ -703,9 +691,7 @@ # pass -# ============================================================================= -# Mixins (here for now) -# ============================================================================= +# ==== Security Mixins class AccessibleModelInterface( object ): """ A security interface to check if a User can read/view an item's. @@ -764,7 +750,6 @@ # return filter( lambda item: self.is_accessible( trans, item, user ), items ) -# ============================================================================= class OwnableModelInterface( object ): """ A security interface to check if a User is an item's owner. @@ -820,7 +805,7 @@ return self.list_owned( trans, user, **kwargs ) -# ----------------------------------------------------------------------------- +# ---- Deletable and Purgable models class DeletableModelInterface( object ): """ A mixin/interface for a model that is deletable (i.e. has a 'deleted' attr). @@ -878,7 +863,6 @@ return item.deleted -# ----------------------------------------------------------------------------- class PurgableModelInterface( DeletableModelInterface ): """ A manager interface/mixin for a resource that allows deleting and purging where diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/datasets.py --- a/lib/galaxy/managers/datasets.py +++ b/lib/galaxy/managers/datasets.py @@ -11,12 +11,10 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class DatasetManager( base.ModelManager, base.AccessibleModelInterface, base.PurgableModelInterface ): """ Manipulate datasets: the components contained in DatasetAssociations/DatasetInstances/HDAs/LDDAs """ - model_class = model.Dataset foreign_key_name = 'dataset' @@ -27,7 +25,6 @@ # need for admin test self.user_manager = users.UserManager( app ) - # ......................................................................... create def create( self, trans, flush=True, **kwargs ): """ Create and return a new Dataset object. @@ -47,7 +44,6 @@ # """ # pass - # ......................................................................... add to dataset association #def to_hda( self, trans, dataset, history, **kwargs ): # """ # Create an hda from this dataset. @@ -60,7 +56,6 @@ # """ # pass - # ......................................................................... delete #TODO: this may be more conv. somewhere else #TODO: how to allow admin bypass? def error_unless_dataset_purge_allowed( self, trans, item, msg=None ): @@ -85,7 +80,7 @@ self.app.model.context.flush() return dataset - # ......................................................................... accessibility + # .... accessibility # datasets can implement the accessible interface, but accessibility is checked in an entirely different way # than those resources that have a user attribute (histories, pages, etc.) def is_accessible( self, trans, dataset, user ): @@ -105,7 +100,7 @@ roles = user.all_roles() if user else [] return self.app.security_agent.can_access_dataset( roles, dataset ) -#TODO: these need work + #TODO: these need work def _access_permission( self, trans, dataset, user=None, role=None ): """ Return most recent DatasetPermissions for the dataset and user. @@ -168,7 +163,7 @@ # """ # pass - # ......................................................................... manage/modify + # .... manage/modify #def has_manage_permission( self, trans, dataset, user ): # """ # """ @@ -187,10 +182,9 @@ #TODO: implement above for groups #TODO: datatypes? - # ......................................................................... data, object_store + # .... data, object_store -# ----------------------------------------------------------------------------- class DatasetSerializer( base.ModelSerializer, base.PurgableModelSerializer ): def __init__( self, app ): @@ -227,7 +221,6 @@ }) -# ----------------------------------------------------------------------------- class DatasetDeserializer( base.ModelDeserializer, base.PurgableModelDeserializer ): model_manager_class = DatasetManager @@ -236,9 +229,12 @@ base.PurgableModelDeserializer.add_deserializers( self ) -# ============================================================================= + class DatasetAssociationManager( base.ModelManager, base.AccessibleModelInterface, base.PurgableModelInterface ): """ + DatasetAssociation/DatasetInstances are intended to be working + proxies to a Dataset, associated with either a library or a + user/history (HistoryDatasetAssociation). """ # DA's were meant to be proxies - but were never fully implemented as them # Instead, a dataset association HAS a dataset but contains metadata specific to a library (lda) or user (hda) @@ -269,7 +265,6 @@ # pass -# ----------------------------------------------------------------------------- class DatasetAssociationSerializer( base.ModelSerializer, base.PurgableModelSerializer ): def add_serializers( self ): @@ -277,7 +272,6 @@ base.PurgableModelSerializer.add_serializers( self ) -# ----------------------------------------------------------------------------- class DatasetAssociationDeserializer( base.ModelDeserializer, base.PurgableModelDeserializer ): def add_deserializers( self ): diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/hdas.py --- a/lib/galaxy/managers/hdas.py +++ b/lib/galaxy/managers/hdas.py @@ -24,10 +24,9 @@ import logging log = logging.getLogger( __name__ ) -# ============================================================================= + class HDAManager( datasets.DatasetAssociationManager, base.OwnableModelInterface, taggable.TaggableManagerInterface, annotatable.AnnotatableManagerInterface ): - #TODO: move what makes sense into DatasetManager """ Interface/service object for interacting with HDAs. """ @@ -37,6 +36,7 @@ tag_assoc = model.HistoryDatasetAssociationTagAssociation annotation_assoc = model.HistoryDatasetAssociationAnnotationAssociation + #TODO: move what makes sense into DatasetManager #TODO: which of these are common with LDDAs and can be pushed down into DatasetAssociationManager? def __init__( self, app ): @@ -46,7 +46,7 @@ super( HDAManager, self ).__init__( app ) self.user_manager = users.UserManager( app ) - # ......................................................................... security and permissions + # .... security and permissions def is_accessible( self, trans, hda, user ): """ Override to allow owners (those that own the associated history). @@ -67,7 +67,7 @@ return True return history.user == user - # ......................................................................... create and copy + # .... create and copy def create( self, trans, history=None, dataset=None, flush=True, **kwargs ): """ Create a new hda optionally passing in it's history and dataset. @@ -177,7 +177,7 @@ raise exceptions.Conflict( "Please wait until this dataset finishes uploading" ) return hda - # ......................................................................... via history + # .... via history #def by_history_id( self, trans, history_id, filters=None, **kwargs ): # history_id_filter = self.model_class.history_id == history_id # filters = self._munge_filters( history_id_filter, filters ) @@ -186,16 +186,16 @@ #def by_history( self, trans, history, filters=None, **kwargs ): # return history.datasets - # ......................................................................... associated -#TODO: is this needed? Can't you use the hda.creating_job attribute? When is this None? + # .... associated def creating_job( self, trans, hda ): + #TODO: is this needed? Can't you use the hda.creating_job attribute? When is this None? job = None for job_output_assoc in hda.creating_job_associations: job = job_output_assoc.job break return job - # ......................................................................... serialization + # .... serialization def get_display_apps( self, trans, hda ): """ Return dictionary containing new-style display app urls. @@ -307,7 +307,6 @@ return False -# ============================================================================= class HDASerializer( datasets.DatasetAssociationSerializer, taggable.TaggableSerializer, annotatable.AnnotatableSerializer ): #TODO: inherit from datasets.DatasetAssociationSerializer @@ -454,7 +453,7 @@ Override to add metadata as flattened keys on the serialized HDA. """ # if 'metadata' isn't removed from keys here serialize will retrieve the un-serializable MetadataCollection -#TODO: remove these when metadata is sub-object + #TODO: remove these when metadata is sub-object KEYS_HANDLED_SEPARATELY = ( 'metadata', ) left_to_handle = self.pluck_from_list( keys, KEYS_HANDLED_SEPARATELY ) serialized = super( HDASerializer, self ).serialize( trans, hda, keys ) @@ -537,7 +536,7 @@ """ Return the `file_name` of the HDA if the config exposes it, None otherwise. """ -#TODO: allow admin + #TODO: allow admin if self.app.config.expose_dataset_path: try: return hda.file_name @@ -568,7 +567,6 @@ return urls -# ============================================================================= class HDADeserializer( datasets.DatasetAssociationDeserializer, taggable.TaggableDeserializer, annotatable.AnnotatableDeserializer ): """ diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/histories.py --- a/lib/galaxy/managers/histories.py +++ b/lib/galaxy/managers/histories.py @@ -12,12 +12,10 @@ from galaxy.managers import sharable from galaxy.managers.collections_util import dictify_dataset_collection_instance - import logging log = logging.getLogger( __name__ ) -# ============================================================================= class HistoryManager( sharable.SharableModelManager, base.PurgableModelInterface ): model_class = model.History @@ -28,7 +26,7 @@ annotation_assoc = model.HistoryAnnotationAssociation rating_assoc = model.HistoryRatingAssociation - #TODO: incorporate imp/exp (or link to) + #TODO: incorporate imp/exp (or alias to) def __init__( self, app, *args, **kwargs ): super( HistoryManager, self ).__init__( app, *args, **kwargs ) @@ -41,17 +39,7 @@ """ return history.copy( target_user=user, **kwargs ) - def most_recent( self, trans, user, **kwargs ): - """ - Return the most recently update history for the user. - """ -#TODO: normalize this - if not user: - return None if trans.history.deleted else trans.history - desc_update_time = self.model_class.table.c.update_time - return self._query_by_user( trans, user, order_by=desc_update_time, limit=1, **kwargs ).first() - - # ......................................................................... sharable + # .... sharable # overriding to handle anonymous users' current histories in both cases def by_user( self, trans, user, **kwargs ): """ @@ -74,7 +62,18 @@ return True return super( HistoryManager, self ).is_owner( trans, history, user ) - # ......................................................................... purgable + #TODO: possibly to sharable + def most_recent( self, trans, user, **kwargs ): + """ + Return the most recently update history for the user. + """ + #TODO: normalize this return value + if not user: + return None if trans.history.deleted else trans.history + desc_update_time = self.model_class.table.c.update_time + return self._query_by_user( trans, user, order_by=desc_update_time, limit=1, **kwargs ).first() + + # .... purgable def purge( self, trans, history, flush=True, **kwargs ): """ Purge this history and all HDAs, Collections, and Datasets inside this history. @@ -89,10 +88,7 @@ # Now mark the history as purged super( HistoryManager, self ).purge( trans, history, flush=flush, **kwargs ) - # ......................................................................... contents - - - # ......................................................................... current + # .... current def get_current( self, trans ): """ Return the current history. @@ -112,7 +108,7 @@ """ return self.set_current( trans, self.by_id( trans, history_id ) ) - # ......................................................................... serialization + # .... serialization #TODO: move to serializer (i.e. history with contents attr) def _get_history_data( self, trans, history ): """ @@ -237,7 +233,6 @@ return state -## ============================================================================= class HistorySerializer( sharable.SharableModelSerializer, base.PurgableModelSerializer ): """ Interface/service object for serializing histories into dictionaries. @@ -337,7 +332,6 @@ security=self.app.security, parent=dataset_collection_instance.history, view="element" ) -# ============================================================================= class HistoryDeserializer( sharable.SharableModelDeserializer, base.PurgableModelDeserializer ): """ Interface/service object for validating and deserializing dictionaries into histories. diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/pages.py --- a/lib/galaxy/managers/pages.py +++ b/lib/galaxy/managers/pages.py @@ -13,7 +13,6 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class PageManager( sharable.SharableModelManager ): """ """ @@ -37,7 +36,6 @@ pass -# ============================================================================= class PageSerializer( sharable.SharableModelSerializer ): """ Interface/service object for serializing pages into dictionaries. @@ -66,7 +64,6 @@ }) -# ============================================================================= class PageDeserializer( sharable.SharableModelDeserializer ): """ Interface/service object for validating and deserializing dictionaries diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/ratable.py --- a/lib/galaxy/managers/ratable.py +++ b/lib/galaxy/managers/ratable.py @@ -9,31 +9,31 @@ log = logging.getLogger( __name__ ) -# ============================================================================= +#TODO: stub class RatableManagerInterface( object ): + #: class of RatingAssociation (e.g. HistoryRatingAssociation) rating_assoc = None #TODO: most of this seems to be covered by item_attrs.UsesItemRatings -# ============================================================================= class RatableSerializer( object ): + pass - def add_serializers( self ): - self.serializers[ 'user_rating' ] = self.serialize_user_rating - self.serializers[ 'community_rating' ] = self.serialize_community_rating + #def add_serializers( self ): + # self.serializers[ 'user_rating' ] = self.serialize_user_rating + # self.serializers[ 'community_rating' ] = self.serialize_community_rating - def serialize_user_rating( self, trans, item, key ): - """ - """ - pass + #def serialize_user_rating( self, trans, item, key ): + # """ + # """ + # pass - def serialize_community_rating( self, trans, item, key ): - """ - """ - pass + #def serialize_community_rating( self, trans, item, key ): + # """ + # """ + # pass -# ============================================================================= class RatableDeserializer( object ): def add_deserializers( self ): diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/sharable.py --- a/lib/galaxy/managers/sharable.py +++ b/lib/galaxy/managers/sharable.py @@ -24,13 +24,12 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class SharableModelManager( base.ModelManager, base.OwnableModelInterface, base.AccessibleModelInterface, taggable.TaggableManagerInterface, annotatable.AnnotatableManagerInterface, ratable.RatableManagerInterface ): # e.g. histories, pages, stored workflows, visualizations - # base.DeleteableModelInterface? + # base.DeleteableModelInterface? (all four are deletable) - # the model used for UserShareAssociations with this model + #: the model used for UserShareAssociations with this model user_share_model = None #: the single character abbreviation used in username_and_slug: e.g. 'h' for histories: u/user/h/slug @@ -41,7 +40,7 @@ # user manager is needed to check access/ownership/admin self.user_manager = users.UserManager( app ) - # ......................................................................... has a user + # .... has a user def _query_by_user( self, trans, user, filters=None, **kwargs ): """ Return query for all items (of model_class type) associated with the given @@ -59,7 +58,7 @@ query = self._query_by_user( trans, user, **kwargs ) return self.list( trans, query=query, **kwargs ) - # ......................................................................... owned model interface + # .... owned model interface def is_owner( self, trans, item, user ): """ Return true if this sharable belongs to `user` (or `user` is an admin). @@ -72,7 +71,7 @@ return True return item.user == user - # ......................................................................... accessible interface + # .... accessible interface def is_accessible( self, trans, item, user ): """ If the item is importable, is owned by `user`, or (the valid) `user` @@ -89,7 +88,7 @@ return True return False - # ......................................................................... importable + # .... importable def make_importable( self, trans, item, flush=True ): """ Makes item accessible--viewable and importable--and sets item's slug. @@ -131,7 +130,7 @@ # query = self._query_importable( trans, user, **kwargs ) # return self.list( trans, query=query, **kwargs ) - # ......................................................................... published + # .... published def publish( self, trans, item, flush=True ): """ Set both the importable and published flags on `item` to True. @@ -168,7 +167,7 @@ # query = self._query_published( trans, user, **kwargs ) # return self.list( trans, query=query, **kwargs ) - # ......................................................................... user sharing + # .... user sharing # sharing is often done via a 3rd table btwn a User and an item -> a <Item>UserShareAssociation def get_share_assocs( self, trans, item, user=None ): """ @@ -236,7 +235,7 @@ # query = self._query_shared_with( trans, user, **kwargs ) # return self.list( trans, query=query, **kwargs ) - # ......................................................................... slugs + # .... slugs # slugs are human readable strings often used to link to sharable resources (replacing ids) #TODO: as validator, deserializer, etc. (maybe another object entirely?) def set_slug( self, trans, item, new_slug, flush=True ): @@ -331,7 +330,7 @@ # """ # pass - # ......................................................................... display + # .... display #def display_by_username_and_slug( self, trans, username, slug ): # """ Display item by username and slug. """ @@ -341,7 +340,6 @@ # """ Handle item sharing. """ -# ============================================================================= class SharableModelSerializer( base.ModelSerializer, taggable.TaggableSerializer, annotatable.AnnotatableSerializer, ratable.RatableSerializer ): #TODO: stub @@ -379,10 +377,8 @@ # return url -# ============================================================================= class SharableModelDeserializer( base.ModelDeserializer, taggable.TaggableDeserializer, annotatable.AnnotatableDeserializer, ratable.RatableDeserializer ): -#TODO: stub def add_deserializers( self ): super( SharableModelDeserializer, self ).add_deserializers() diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/taggable.py --- a/lib/galaxy/managers/taggable.py +++ b/lib/galaxy/managers/taggable.py @@ -9,14 +9,13 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class TaggableManagerInterface( object ): + #: class of TagAssociation (e.g. HistoryTagAssociation) tag_assoc = None #TODO: most of this can be done by delegating to the TagManager? -# ============================================================================= class TaggableSerializer( object ): def add_serializers( self ): @@ -38,7 +37,6 @@ return tags_str_list -# ============================================================================= class TaggableDeserializer( object ): def add_deserializers( self ): @@ -60,6 +58,6 @@ tag_handler.apply_item_tags( user, item, unicode( new_tags_str.encode( 'utf-8' ), 'utf-8' ) ) #trans.sa_session.flush() -#TODO:!! does the creation of new_tags_list mean there are now more and more unused tag rows in the db? + #TODO:!! does the creation of new_tags_list mean there are now more and more unused tag rows in the db? return item.tags diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/users.py --- a/lib/galaxy/managers/users.py +++ b/lib/galaxy/managers/users.py @@ -12,12 +12,10 @@ from galaxy.managers import base from galaxy.managers import api_keys - import logging log = logging.getLogger( __name__ ) -# ============================================================================= class UserManager( base.ModelManager ): model_class = model.User foreign_key_name = 'user' @@ -77,7 +75,7 @@ if self.by_email( trans, email ) is not None: raise exceptions.Conflict( 'Email must be unique', email=email ) - # ------------------------------------------------------------------------- filters + # ---- filters def by_email( self, trans, email, filters=None, **kwargs ): """ Find a user by their email. @@ -97,7 +95,7 @@ order_by = order_by or ( model.User.email, ) return super( UserManager, self ).list( trans, filters=filters, order_by=order_by, **kwargs ) - # ------------------------------------------------------------------------- admin + # ---- admin def is_admin( self, trans, user ): """ Return True if this user is an admin. @@ -129,7 +127,7 @@ raise exceptions.AdminRequiredException( msg, **kwargs ) return user - # ------------------------------------------------------------------------- anonymous + # ---- anonymous def is_anonymous( self, user ): """ Return True if `user` is anonymous. @@ -146,7 +144,7 @@ raise exceptions.AuthenticationFailed( msg, **kwargs ) return user - # ------------------------------------------------------------------------- current + # ---- current def is_current_user( self, trans, user ): """ Return True if this user is the trans' current user. @@ -166,7 +164,7 @@ """ return self.is_admin( trans, trans.user ) - # ------------------------------------------------------------------------- ? + # ---- User-created notes/metadata on other models #def tags( self, trans, user, **kwargs ): # """ # Return all tags created by this user. @@ -179,7 +177,7 @@ # """ # pass - # ------------------------------------------------------------------------- api keys + # ---- api keys def create_api_key( self, trans, user ): """ Create and return an API key for `user`. @@ -215,7 +213,7 @@ return existing return self.create_api_key( self, trans, user ) - # ------------------------------------------------------------------------- roles + # ---- roles def private_role( self, trans, user ): """ Return the security agent's private role for `user`. @@ -224,7 +222,6 @@ return self.app.security_agent.get_private_user_role( user ) -# ============================================================================= class UserSerializer( base.ModelSerializer ): def __init__( self ): diff -r a059e05442354478bfa551621718afbc18cc6263 -r f9199d6aca6eeca511d1895f3265831e1e01714d lib/galaxy/managers/visualizations.py --- a/lib/galaxy/managers/visualizations.py +++ b/lib/galaxy/managers/visualizations.py @@ -12,11 +12,13 @@ log = logging.getLogger( __name__ ) -# ============================================================================= class VisualizationManager( sharable.SharableModelManager ): """ + Handle operations outside and between visualizations and other models. """ + # TODO: revisions + model_class = model.Visualization foreign_key_name = 'visualization' user_share_model = model.VisualizationUserShareAssociation @@ -30,15 +32,12 @@ """ super( VisualizationManager, self ).__init__( app, *args, **kwargs ) - def copy( self, trans, visualization, user, **kwargs ): - """ - """ - pass + #def copy( self, trans, visualization, user, **kwargs ): + # """ + # """ + # pass - # TODO: revisions - -# ============================================================================= class VisualizationSerializer( sharable.SharableModelSerializer ): """ Interface/service object for serializing visualizations into dictionaries. @@ -67,7 +66,6 @@ }) -# ============================================================================= class VisualizationDeserializer( sharable.SharableModelDeserializer ): """ Interface/service object for validating and deserializing Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org