Skip to main content

Simple app which includes ModelAdmin class for importing/exporting model data to csv file

Project description

This app includes model admin class for csv exporting and importing.

For installation just add ‘csv_admin’ to your INSTALLED_APPS

For usage add in admin.py file:

from csv_admin.admin import CSVExportAdmin


class MyAdmin(CSVExportAdmin):
    date_field = 'created_at'
    export_select_related = ['related_field_name']

    def _get_sum(self):
        sum = 1 + 2
        return sum

    def get_additional_fields(self) -> list:
        return ['sum']

    def get_additional_fields_params(self) -> dict:
        return {'sum': self._get_sum}

CHANGELOG:

1.0.5: Fixed custom url issues

1.0.6: Fixed duplicating of date_field

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-csv-admin-1.0.6.tar.gz (24.4 kB view hashes)

Uploaded Source

Built Distribution

django_csv_admin-1.0.6-py3-none-any.whl (26.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page