tardis.apps.search package
Subpackages
Submodules
tardis.apps.search.api module
RESTful API for MyTardis search. Implemented with Tastypie.
- class tardis.apps.search.api.AdvanceSearchAppResource(api_name=None)
Bases:
Resource- class Meta
Bases:
object- always_return_data = True
- authentication = <tardis.tardis_portal.api.MyTardisAuthentication object>
- list_allowed_methods = ['post']
- object_class
alias of
SearchObject
- resource_name = 'advance-search'
- serializer = <tardis.apps.search.api.PrettyJSONSerializer object>
- base_fields = {'hits': <tastypie.fields.ApiField object>, 'resource_uri': <tastypie.fields.CharField object>}
- declared_fields = {'hits': <tastypie.fields.ApiField object>}
- detail_uri_kwargs(bundle_or_obj)
Given a
Bundleor an object (typically aModelinstance), it returns the extra kwargs needed to generate a detail URI.By default, it uses this resource’s
detail_uri_namein order to create the URI.
- get_object_list(request)
A hook to allow making returning the list of available objects.
This needs to be implemented at the user level.
ModelResourceincludes a full working version specific to Django’sModels.
- obj_create(bundle, **kwargs)
Creates a new object based on the provided data.
This needs to be implemented at the user level.
ModelResourceincludes a full working version specific to Django’sModels.
- obj_get_list(bundle, **kwargs)
Fetches the list of objects available on the resource.
This needs to be implemented at the user level.
ModelResourceincludes a full working version specific to Django’sModels.
- class tardis.apps.search.api.PrettyJSONSerializer(formats=None, content_types=None, datetime_formatting=None)
Bases:
Serializer- json_indent = 2
- to_json(data, options=None)
Given some Python data, produces JSON output.
- class tardis.apps.search.api.SearchAppResource(api_name=None)
Bases:
ResourceTastypie resource for simple-search
- class Meta
Bases:
object- always_return_data = True
- authentication = <tardis.tardis_portal.api.MyTardisAuthentication object>
- list_allowed_methods = ['get']
- object_class
alias of
SearchObject
- resource_name = 'simple-search'
- serializer = <tardis.apps.search.api.PrettyJSONSerializer object>
- base_fields = {'hits': <tastypie.fields.ApiField object>, 'resource_uri': <tastypie.fields.CharField object>}
- declared_fields = {'hits': <tastypie.fields.ApiField object>}
- detail_uri_kwargs(bundle_or_obj)
Given a
Bundleor an object (typically aModelinstance), it returns the extra kwargs needed to generate a detail URI.By default, it uses this resource’s
detail_uri_namein order to create the URI.
- get_object_list(request)
A hook to allow making returning the list of available objects.
This needs to be implemented at the user level.
ModelResourceincludes a full working version specific to Django’sModels.
- log_search_event(request, query_text, result_dict)
- obj_get_list(bundle, **kwargs)
Fetches the list of objects available on the resource.
This needs to be implemented at the user level.
ModelResourceincludes a full working version specific to Django’sModels.
- tardis.apps.search.api.simple_search_public_data(query_text)
tardis.apps.search.apps module
- class tardis.apps.search.apps.SearchConfig(app_name, app_module)
Bases:
AbstractTardisAppConfig- name = 'tardis.apps.search'
- verbose_name = 'Search'
tardis.apps.search.documents module
- class tardis.apps.search.documents.DataFileDocument(related_instance_to_ignore=None, **kwargs)
Bases:
DocType- class Index
Bases:
object- name = 'datafile'
- settings = {'number_of_replicas': 0, 'number_of_shards': 1}
- django = {'model': <class 'tardis.tardis_portal.models.datafile.DataF...}
- get_queryset()
Return the queryset that should be indexed by this doc type.
- parallel_bulk(actions, **kwargs)
- prepare_experiments(instance)
- class tardis.apps.search.documents.DatasetDocument(related_instance_to_ignore=None, **kwargs)
Bases:
DocType- class Index
Bases:
object- name = 'dataset'
- settings = {'number_of_replicas': 0, 'number_of_shards': 1}
- django = {'model': <class 'tardis.tardis_portal.models.dataset.Datase...}
- parallel_bulk(actions, **kwargs)
- class tardis.apps.search.documents.ExperimentDocument(related_instance_to_ignore=None, **kwargs)
Bases:
DocType- class Django
Bases:
object- model
alias of
Experiment
- class Index
Bases:
object- name = 'experiments'
- settings = {'number_of_replicas': 0, 'number_of_shards': 1}
- django = {'model': <class 'tardis.tardis_portal.models.experiment.Exp...}
- parallel_bulk(actions, **kwargs)
tardis.apps.search.urls module
tardis.apps.search.views module
views relevant to search
- class tardis.apps.search.views.SearchView(**kwargs)
Bases:
TemplateView- template_name = 'search.html'