-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0224da8
Showing
17 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
######################## | ||
Authors and contributors | ||
######################## | ||
|
||
* Rémy Hubscher <[email protected]>, <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Changelog | ||
========= | ||
|
||
0.1 (unreleased) | ||
---------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
####### | ||
License | ||
####### | ||
|
||
Copyright (c) 2013 Rémy HUBSCHER <[email protected]> | ||
|
||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
recursive-include chartjs * | ||
global-exclude *.pyc | ||
include *.txt | ||
include VERSION README.rst CHANGELOG LICENSE INSTALL AUTHORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.PHONY: docs test clean | ||
|
||
bin/python: | ||
virtualenv . | ||
bin/python setup.py develop | ||
|
||
test: bin/python | ||
bin/pip install tox | ||
bin/tox | ||
|
||
clean: | ||
rm -rf bin .tox include/ lib/ man/ django_chartjs.egg-info/ build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
############### | ||
Django Chart.js | ||
############### | ||
|
||
Django Chart.js lets you manage charts in you Django application. | ||
|
||
Using a set of predefined Class Based Views your are able to get | ||
started after writting just your SQL query. | ||
|
||
* Authors: Rémy Hubscher and `contributors | ||
<https://github.com/novagile/django-chartjs/graphs/contributors>`_ | ||
* Licence: BSD | ||
* Compatibility: Django 1.5+, python2.7 up to python3.3 | ||
* Project URL: https://github.com/novagile/django-i18nurl | ||
|
||
|
||
Getting Started | ||
=============== | ||
|
||
Install django-chartjs:: | ||
|
||
pip install django-chartjs | ||
|
||
|
||
Add it to your ``INSTALLED_APPS`` settings:: | ||
|
||
INSTALLED_APPS = ( | ||
'...', | ||
'chartjs', | ||
) | ||
|
||
|
||
Using it | ||
======== | ||
|
||
Look at the demo project :D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1dev |
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
import json | ||
from django import http | ||
|
||
|
||
class JSONResponseMixin(object): | ||
def render_to_response(self, context): | ||
"Returns a JSON response containing 'context' as payload" | ||
return self.get_json_response(self.convert_context_to_json(context)) | ||
|
||
def get_json_response(self, content, **httpresponse_kwargs): | ||
"Construct an `HttpResponse` object." | ||
return http.HttpResponse(content, | ||
content_type='application/json', | ||
**httpresponse_kwargs) | ||
|
||
def convert_context_to_json(self, context): | ||
"Convert the context dictionary into a JSON object" | ||
# Note: This is *EXTREMELY* naive; in reality, you'll need | ||
# to do much more complex handling to ensure that arbitrary | ||
# objects -- such as Django model instances or querysets | ||
# -- can be serialized as JSON. | ||
return json.dumps(context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tools to build Line charts parameters.""" | ||
from .base import JSONResponseMixin | ||
|
||
|
||
class BaseLineChart(JSONResponseMixin): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from os.path import abspath, dirname, join | ||
from setuptools import find_packages, setup | ||
|
||
|
||
def read_relative_file(filename): | ||
"""Returns contents of the given file, whose path is supposed relative | ||
to this module.""" | ||
with open(join(dirname(abspath(__file__)), filename)) as f: | ||
return f.read() | ||
|
||
|
||
if __name__ == '__main__': # ``import setup`` doesn't trigger setup(). | ||
setup(name='django-chartjs', | ||
version=read_relative_file('VERSION').strip(), | ||
description="Django Chart.js ajax views", | ||
long_description=read_relative_file('README.rst'), | ||
classifiers=['Development Status :: 3 - Alpha', | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Natural Language :: English', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
], | ||
keywords='django chart chartjs ajax class based views', | ||
author='Rémy Hubscher', | ||
author_email='[email protected]', | ||
url='https://github.com/novagile/django-chartjs', | ||
license='BSD Licence', | ||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=[] # depends on Django | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
python setup.py develop | ||
(cd demo; python setup.py develop) | ||
demo test demoproject | ||
flake8 i18nurl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[tox] | ||
envlist = py27 | ||
|
||
[testenv] | ||
commands = | ||
./test.sh | ||
deps = | ||
Django | ||
flake8 | ||
django-nose | ||
coverage | ||
nose | ||
rednose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -x | ||
|
||
wget -O chartjs/static/js/Chart.min.js https://raw.github.com/nnnick/Chart.js/master/Chart.min.js |