From 76df4659ab3e0fd1b548a2f16567580786ad1654 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Larchev=C3=AAque?= Date: Fri, 10 Jun 2011 10:48:34 -0400 Subject: [PATCH 1/1] 0.1dev release auf.django.export --- .gitignore | 4 + CHANGES | 7 ++ README | 7 ++ auf/__init__.py | 5 + auf/__init__.pyc | Bin 0 -> 294 bytes auf/django/__init__.py | 5 + auf/django/export/admin.py | 108 ++++++++++++++++++++ auf/django/export/locale/fr/LC_MESSAGES/django.mo | Bin 0 -> 456 bytes auf/django/export/locale/fr/LC_MESSAGES/django.po | 27 +++++ auf/django/export/models.py | 3 + .../export/templates/admin/export/change_list.html | 13 +++ auf/django/export/tests.py | 23 +++++ auf/django/export/views.py | 1 + aufdjangoexport/__init__.py | 1 + setup.cfg | 3 + setup.py | 27 +++++ 16 files changed, 234 insertions(+) create mode 100644 .gitignore create mode 100644 CHANGES create mode 100644 README create mode 100644 auf/__init__.py create mode 100644 auf/__init__.pyc create mode 100644 auf/django/__init__.py create mode 100755 auf/django/export/__init__.py create mode 100644 auf/django/export/admin.py create mode 100644 auf/django/export/locale/fr/LC_MESSAGES/django.mo create mode 100644 auf/django/export/locale/fr/LC_MESSAGES/django.po create mode 100755 auf/django/export/models.py create mode 100644 auf/django/export/templates/admin/export/change_list.html create mode 100755 auf/django/export/tests.py create mode 100755 auf/django/export/views.py create mode 100644 aufdjangoexport/__init__.py create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..499a075 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +*egg-info +build +dist diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..940bd55 --- /dev/null +++ b/CHANGES @@ -0,0 +1,7 @@ +auf.django.export +================= + +0.1 +--- + +* Module creation, provide link to export as CSV in django admin (changelist_view) diff --git a/README b/README new file mode 100644 index 0000000..3f82968 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +# Sample admin.py + +from auf.django.export.admin import ExportAdmin + +class DossierAdmin(ExportAdmin,): + # optional, by default loop on all one2one related objects (stop at 1 depth level) + csv_fields = ('name', 'country__name', ) diff --git a/auf/__init__.py b/auf/__init__.py new file mode 100644 index 0000000..35cf25b --- /dev/null +++ b/auf/__init__.py @@ -0,0 +1,5 @@ +try: + __import__('pkg_resources').declare_namespace(__name__) +except: + # bootstrapping + pass diff --git a/auf/__init__.pyc b/auf/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bfd785274452df58548277268e759edd204a1e6 GIT binary patch literal 294 zcmYL@O-ckY5QVF{@rQv~xSA6Py>OBXhi!tRwN>6UEnM|}J@njv9^B+^Kjp;F$ zkId>-Ijiiv(R~_8ry=YEWhGNxPkVZwNk8PYqr!iGTFlDtY}_VAA2m$vXh{}>1pzv_UrjMJ^HdxhsYUnjvOOxq*9F7$UX9OU|G+&pCI2@T1!?zk>E*WfzDy`qgq%|W3N67i8&m;d=5n3q5p!N4Q85e@y?V>D)Vz)J(E=CUlf zQJRwBGziGp3mIv%(DQ?yHy9*rGU=jKW^0}aNCjU~5_sd$w2Isgf?kndD4lif&=1-E zQ|^Uh_mwn4;v1hU3~R*3T&@b9%NCixaa{`2nWjT%?tN93SD}H)xmx5hqonzg8#^x6 ininusdRbB;SKDLRskg|k?8vU$vaQ{ig(gC7XZ;HUIC@n8 literal 0 HcmV?d00001 diff --git a/auf/django/export/locale/fr/LC_MESSAGES/django.po b/auf/django/export/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..2154981 --- /dev/null +++ b/auf/django/export/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,27 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-06-10 14:33+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" + +#: templates/admin/export/change_list.html:8 +msgid "Export CSV" +msgstr "Exporter en CSV" + +#: templates/admin/export/change_list.html:10 +#, python-format +msgid "Add %(name)s" +msgstr "" diff --git a/auf/django/export/models.py b/auf/django/export/models.py new file mode 100755 index 0000000..71a8362 --- /dev/null +++ b/auf/django/export/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/auf/django/export/templates/admin/export/change_list.html b/auf/django/export/templates/admin/export/change_list.html new file mode 100644 index 0000000..02f9703 --- /dev/null +++ b/auf/django/export/templates/admin/export/change_list.html @@ -0,0 +1,13 @@ +{% extends "admin/change_list.html" %} + +{% load i18n %} + +{% block object-tools %} + +{% endblock %} diff --git a/auf/django/export/tests.py b/auf/django/export/tests.py new file mode 100755 index 0000000..2247054 --- /dev/null +++ b/auf/django/export/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/auf/django/export/views.py b/auf/django/export/views.py new file mode 100755 index 0000000..60f00ef --- /dev/null +++ b/auf/django/export/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/aufdjangoexport/__init__.py b/aufdjangoexport/__init__.py new file mode 100644 index 0000000..792d600 --- /dev/null +++ b/aufdjangoexport/__init__.py @@ -0,0 +1 @@ +# diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..01bb954 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[egg_info] +tag_build = dev +tag_svn_revision = true diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d998de4 --- /dev/null +++ b/setup.py @@ -0,0 +1,27 @@ +from setuptools import setup, find_packages +import sys, os + +name = 'auf.django.export' +version = '0.1' + +setup(name=name, + version=version, + description="Provide easy way to export as CSV in Django Admin", + long_description="""\ +""", + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='', + author='Olivier Larchev\xc3\xaaque', + author_email='olivier.larcheveque@auf.org', + url='', + license='GPL', + packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), + include_package_data=True, + zip_safe=False, + install_requires=[ + # -*- Extra requirements: -*- + ], + entry_points=""" + # -*- Entry points: -*- + """, + ) -- 1.7.10.4