This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This app provides a ModelAdmin which you can subclass in order to allow your changelist view to be exported to CSV. This will add an “Export CSV” button to the top-right of the changelist. Clicking this button will export a CSV containing the same columns and headings as your changelist view. By default, up to 10,000 rows will be exported, though this can be changed easily.

Django > 1.3 is required, at which point the standard changelist_view() returns a TemplateResponse. This allows us to change the template used after the response is created, so that we can output CSV instead of the standard HTML view. Django <= 1.3 requires a previous version of this app in which the changelist_view code is duplicated and modified slightly to change the template and setup the response for download instead of display.

Note: if you alter ‘change_list_template’ on your ModelAdmin subclass, the “Export CSV” button will not appear. You will need to add it manually to your template or link to the correct url (admin:myapp_mymodel_export) by some other means.

Examples

Simple example:

# myapp/admin.py
from django.contrib import admin
from django_exportable_admin.admin import ExportableAdmin
from models import MyModel

class MyModelAdmin(ExportableAdmin):
    list_display = ('field1','field2','field3')
admin.site.register(MyModel, MyModelAdmin)

Complex example:

# myapp/admin.py
from django.contrib import admin
from django_exportable_admin.admin import ExportableAdmin
from models import MyModel

class MyModelAdmin(ExportableAdmin):
    list_display = ('field1','field2','calculated_field')

    # adjust the number of results
    export_queryset_limit = 100

    def calculated_field(self, obj):
        return u"%.3f" % obj.float_field / 33.7
    calculated_field.short_description = 'Arbitrary Title'
admin.site.register(MyModel, MyModelAdmin)
Release History

Release History

2.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-exportable-admin-2.2.tar.gz (2.5 kB) Copy SHA256 Checksum SHA256 Source Dec 5, 2011
django-exportable-admin-2.2.zip (3.3 kB) Copy SHA256 Checksum SHA256 Source Dec 5, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting