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
Showing
21 changed files
with
749 additions
and
225 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,31 @@ | ||
Copyright (c) {{copyright_year}} by {{company}} and its contributors | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms of the software as well | ||
as documentation, 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. | ||
|
||
* The names of the contributors may not be used to endorse or | ||
promote products derived from this software without specific | ||
prior written permission. | ||
|
||
THIS SOFTWARE AND DOCUMENTATION 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 AND DOCUMENTATION, 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,64 @@ | ||
{%extends 'WEB-README.rst.jj2' %} | ||
|
||
{%block header %} | ||
Tested Django Versions | ||
======================== | ||
|
||
.. image:: https://img.shields.io/badge/django-1.9-green.svg | ||
:target: http://travis-ci.org/pyexcel/django-excel | ||
|
||
.. image:: https://img.shields.io/badge/django-1.8.2-green.svg | ||
:target: http://travis-ci.org/pyexcel/django-excel | ||
|
||
.. image:: https://img.shields.io/badge/django-1.7.8-green.svg | ||
:target: http://travis-ci.org/pyexcel/django-excel | ||
{%endblock%} | ||
|
||
{%block setup%} | ||
Setup | ||
====== | ||
|
||
You will need to update your *settings.py*: | ||
|
||
.. code-block:: python | ||
FILE_UPLOAD_HANDLERS = ("django_excel.ExcelMemoryFileUploadHandler", | ||
"django_excel.TemporaryExcelFileUploadHandler") | ||
{%endblock%} | ||
|
||
|
||
{% block usage %} | ||
Usage | ||
========= | ||
Here is the example viewing function codes: | ||
|
||
.. code-block:: python | ||
from django.shortcuts import render_to_response | ||
from django.http import HttpResponseBadRequest | ||
from django import forms | ||
from django.template import RequestContext | ||
import django_excel as excel | ||
class UploadFileForm(forms.Form): | ||
file = forms.FileField() | ||
def upload(request): | ||
if request.method == "POST": | ||
form = UploadFileForm(request.POST, request.FILES) | ||
if form.is_valid(): | ||
filehandle = request.FILES['file'] | ||
return excel.make_response(filehandle.get_sheet(), "csv") | ||
else: | ||
return HttpResponseBadRequest() | ||
else: | ||
form = UploadFileForm() | ||
return render_to_response('upload_form.html', | ||
{'form': form}, | ||
context_instance=RequestContext(request)) | ||
def download(request): | ||
sheet = excel.pe.Sheet([[1, 2],[3, 4]]) | ||
return excel.make_response(sheet, "csv") | ||
{% endblock %} |
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 @@ | ||
{% extends 'docs/source/conf.py.jj2' %} |
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
{% for dependency in dependencies: %} | ||
{{dependency}} | ||
{% endfor %} |
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 @@ | ||
{% extends 'setup.py.jj2' %} | ||
{%block extras %} | ||
{%endblock %} | ||
{%block additional_keywords%} | ||
'API', | ||
'Django' | ||
{%endblock%} | ||
|
||
{%block additional_classifers%} | ||
'Development Status :: 3 - Alpha', | ||
'Environment :: Web Environment', | ||
'Topic :: Internet :: WWW/HTTP', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Framework :: Django :: 1.7', | ||
'Framework :: Django :: 1.8', | ||
'Framework :: Django :: 1.9', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5' | ||
{%endblock%} |
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 @@ | ||
{% extends 'tests/requirements.txt.jj2' %} | ||
{%block extras %} | ||
lxml | ||
pyexcel-ods3>=0.1.0 | ||
pyexcel-xls>=0.1.0 | ||
pyexcel-xlsx>=0.1.0 | ||
{%endblock%} |
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,25 @@ | ||
{% extends "travis.yml.jj2" %} | ||
{%block test_other_environments%} | ||
- DJANGO_VERSION=1.7.8 | ||
- DJANGO_VERSION=1.8.2 | ||
- DJANGO_VERSION=1.9 | ||
{%endblock%} | ||
|
||
{%block exclusion_matrix%} | ||
matrix: | ||
exclude: | ||
- python: 3.3 | ||
env: DJANGO_VERSION=1.9 | ||
- python: 3.5 | ||
env: DJANGO_VERSION=1.7.8 | ||
- python: 3.5 | ||
env: DJANGO_VERSION=1.8.2 | ||
{%endblock%} | ||
|
||
{%block test_other_python_versions%} - 3.3 | ||
- 3.4 | ||
- 3.5 | ||
{%endblock%} | ||
|
||
{% block custom_install %} - pip install Django==$DJANGO_VERSION | ||
{% endblock%} |
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
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
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
include requirements.txt | ||
include VERSION | ||
include README.rst |
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
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,17 @@ | ||
from os import path, system | ||
|
||
config_dir = 'commons/config' | ||
template_dir = 'commons/templates' | ||
|
||
if not path.exists("commons"): | ||
system("git clone https://github.com/pyexcel/pyexcel-commons.git commons") | ||
|
||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t README.rst -o README.rst -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t setup.py -o setup.py -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t docs/source/conf.py -o doc/source/conf.py -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t travis.yml -o .travis.yml -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td .moban.d -t requirements.txt -o requirements.txt -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates -t LICENSE.jj2 -o LICENSE -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t tests/requirements.txt -o tests/requirements.txt -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t MANIFEST.in.jj2 -o MANIFEST.in -c moban.yaml") | ||
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t docs/source/index.rst.jj2 -o doc/source/index.rst -c moban.yaml") |
Oops, something went wrong.