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}
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.2.tar.gz
(24.2 kB
view details)
Built Distribution
File details
Details for the file django-csv-admin-1.0.2.tar.gz
.
File metadata
- Download URL: django-csv-admin-1.0.2.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc9d96c59eb1663351f19905efaa3b627aafc5ab2a4fb38b192eaa3c5024db2 |
|
MD5 | c2b4c7260cd70e18ddb1494b18191ab9 |
|
BLAKE2b-256 | 02b2b8050488e4a0b1f18f7db9003a6ede447d8e35653ca1413c9b40f84b5ead |
File details
Details for the file django_csv_admin-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: django_csv_admin-1.0.2-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8cb3fc54e5b0c886e6773b4ede57706d0e70851e083cec351a47aff9669078 |
|
MD5 | 195431b219f376b726d9208456215333 |
|
BLAKE2b-256 | ac8244417850e7af53876b4666901da40d73650564a4248e59b396c94093f07c |