项目作者: inonit

项目描述 :
Graphing Django
高级语言: Python
项目地址: git://github.com/inonit/django-chemtrails.git
创建时间: 2017-01-31T22:11:51Z
项目社区:https://github.com/inonit/django-chemtrails

开源协议:MIT License

下载


django-chemtrails

Code Health
Build Status
Coverage Status
Documentation Status

Graphing Django

Documentation available on Read the Docs!

BIG FAT WARNING

This is experimental software in a really, really early pre-alpha phase.
The API is guaranteed to change without any notice. Please don’t
use for anything whatsoever!

What’s all the fuzz about?

Who doesn’t love graphs, charts and visual data?

This project springs from another project I’m working on which involves
a rather complex permission system. As a solution I’m looking into
using a graph to help determine if a user has permissions to perform
some action on an object, based on the relationship between entities.

Meta data

Currently there is two kind of node types; MetaNodes and ModelNodes.
The MetaNodes contains no user data, but are meant to visualize the
structure of the database. Each node contains meta data such as
app_label, model_name and so on as well as relations to other
MetaNodes. They may also be connected to the actual ModelNodes by
flipping on a setting.

The image below displays all the MetaNodes for the Bookstore app
used to test and develop this library.

The Bookstore meta graph

Node data

ModelNodes on the other hand is more of a copy of a model instance.
It contains data from the the actual object, as well as relations to
other nodes.

The image below displays the ModelNodes for the Bookstore app.

The Bookstore graph

Give it a spin

As stated earlier, for now this project is not suitable for any usage,
except fooling around a bit. If you’d like to try it out follow the steps below.

  1. $ git clone https://github.com/inonit/django-chemtrails.git
  2. $ cd django-chemtrails
  3. django-chemtrails:$ docker-compose up -d
  4. django-chemtrails:$ python manage.py migrate
  5. django-chemtrails:$ python manage.py testgraph 2 # any number
  6. Hang tight, this might take a little while...
  7. Successfully created 2 bookstore graphs.
  8. Check them out in the Neo4j web console!

Open the Neo4j web console at http://localhost:7474
and enter a Cypher query to fetch everything.

  1. MATCH (n) RETURN n

To wipe out the entire Neo4j database, enter the following Cypher query.

  1. MATCH (n) DETACH DELETE n