netvis package¶
Submodules¶
netvis.admin module¶
netvis.apps module¶
netvis.models module¶
- class netvis.models.NetVisCache(id, app_name, model_name, updated_at, graph_data, graph_data_preview)¶
Bases:
django.db.models.base.Model
- exception DoesNotExist¶
Bases:
django.core.exceptions.ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- app_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)¶
- get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)¶
- graph_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- graph_data_preview¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- model_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- updated_at¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
netvis.tests module¶
netvis.urls module¶
netvis.utils module¶
- netvis.utils.add_node_types(base_graph)¶
takes a base graph (nodes and edges) and adds node and edge type arrays :param base_grape: A dict with node and edges arrays :return: A dict according to netvis graph data model
- netvis.utils.as_graph(instance)¶
serializes an object and its related (FK, M2M) objects as netvis-graph :param instance: An instance of a django model class :return: A dict with keys ‘nodes’ and ‘edges’
- netvis.utils.as_node(instance)¶
serializes an object as netvis-nodes :param instance: An instance of a django model class :return: A dict with keys ‘type’, ‘label’ and ‘id’
- netvis.utils.color_generator(number_of_colors=5)¶
generats some random Hex Color Codes taken from https://stackoverflow.com/questions/28999287/generate-random-colors-rgb :param number_of_colors: The number colors to generate :return: A list of Hex COlor Codes
- netvis.utils.model_to_dict(instance)¶
serializes a model.object to dict, including non editable fields as well as ManyToManyField fields
- netvis.utils.qs_as_graph(qs, limit=100)¶
serializes a django queryset as netvis-graph :param qs: A django queryset :param limit: A integer to limit the number of objects :return: A netvis graph
netvis.views module¶
- netvis.views.cashed_graph_data(request, app_name, model_name)¶
- netvis.views.graph_data(request, app_name, model_name, pk)¶
- netvis.views.qs_graph_data(request, app_name, model_name)¶