Skip to content

synw/django-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django R

Toolkit to use Rethinkdb in Django. Features:

  • Interface to explore the Rethinkdb data
  • Helpers for basic operations

This module was made to give an easy access to the Rethinkdb functionalities inside of the Django environment. We are not trying to replace the classic Django orm nor the builtin Rethinkdb admin interface. It is just a set of tools to ease the use of Rethinkdb in Django.

Install

pip install rethinkdb geojson jsonschema djangoajax six python-dateutil
pip install git+https://github.com/dmpayton/reqon.git
pip install git+https://github.com/synw/django-R.git

Installed apps:

'django_ajax',
'djR',

Urls: url('^r/', include('djR.urls')),

Optional settings

# default: 'localhost'
RETHINKDB_HOST = ip_here
# default: 28015
RETHINKDB_PORT = 28500
# default: None
R_DEFAULT_DB = "mydb"
# default: True
R_VERBOSE = False

Usage

Go to /r/ as superuser and start to explore the data.

Run a query:

from rethinkdb import r
from djR.r_producers import R

q = r.db('mydb').table('mytable').limit(10)
results = R.run_query(q)

Run a query from json:

from djR.r_producers import R

q = {"$db":"mydb", "$table":"mytable", "$query":[["$limit":10]]}
results = R.run_json(q)

Check the Reqon doc for the json query format specifications.

Screenshot

Data explorer screenshot

Todo

  • Merge django-changefeed into here
  • Add more query options: index, order, pluck, filters, etc..

Thanks

About

Rethinkdb toolkit for Django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published