Utilities¶
-
elasticgit.utils.
fqcn
(klass)[source]¶ Given a class give it’s fully qualified class name in dotted notation. The inverse of load_class
Parameters: klass (class) – >>> from elasticgit.utils import fqcn >>> from elasticgit.tests.base import TestPerson >>> fqcn(TestPerson) 'elasticgit.tests.base.TestPerson' >>>
-
elasticgit.utils.
introspect_properties
(model_class)[source]¶ Introspect a
elasticgit.models.Model
and retrieve a suitable mapping to use when indexing instances of the model in Elasticsearch.>>> from elasticgit.models import Model, TextField >>> >>> class TestModel(Model): ... field = TextField('A text field') ... >>> from elasticgit.utils import introspect_properties >>> >>> sorted(introspect_properties(TestModel).keys()) ['_version', 'field', 'uuid'] >>>