Giter Site home page Giter Site logo

django-dataexporter's Introduction

django-dataexporter

Latest Version CI Status Coverage Status Documentation Status

django-dataexporter is a extensible helper to export Django QuerySets and other data to CSV and Excel.

Features

  • Exporter class to generate CSV and Excel files out of QuerySets and other iterables.
  • Factory to generate Django ModelAdmin actions to trigger an export out of Django's famous admin interface.

Requirements

django-dataexporter supports Python 3 only and requires at least Django 2. In addition, the Python package openpyxl needs to be installed.

Prepare for development

A Python 3.6 interpreter is required in addition to poetry.

$ poetry install

Now you're ready to run the tests:

$ poetry run pytest

Resources

django-dataexporter's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mrtnbckr

django-dataexporter's Issues

When using exporter more than once only last action is visible

When using exporter more than once in the same admin only last action is added - e.g.

 actions = [
        export_csv_action_factory(
            fields=export_fields, header='CSV', label='Export surveys as CSV'),
        export_excel_action_factory(
            fields=export_fields, header='XLSX', label='Export surveys as XLSX'),
        'make_published', 'make_unpublished',
    ]

Reason is the way how get_actions work:

self.get_actions(request)
OrderedDict([('delete_selected', (<function delete_selected at 0x105a068c8>, 'delete_selected', 'Ausgewählte %(verbose_name_plural)s löschen')), ('export_view', (<function export_action_factory.<locals>.export_view at 0x107a940d0>, 'export_view', 'Export surveys as XLSX')), ('make_published', (<function ArticleAdmin.make_published at 0x107a941e0>, 'make_published', 'Ausgewählte Artikel als veröffentlicht markieren')), ('make_unpublished', (<function ArticleAdmin.make_unpublished at 0x107a94268>, 'make_unpublished', 'Ausgewählte Artikel als nicht veröffentlicht markieren'))])

The export function is always called export_view.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.