Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gdoermann/django-csvmap
A mapping protocol for uploading csv files and mapping the data to forms/models
https://github.com/gdoermann/django-csvmap
Last synced: about 2 months ago
JSON representation
A mapping protocol for uploading csv files and mapping the data to forms/models
- Host: GitHub
- URL: https://github.com/gdoermann/django-csvmap
- Owner: gdoermann
- Created: 2010-09-03T06:32:36.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-08T06:28:01.000Z (about 14 years ago)
- Last Synced: 2023-03-11T05:35:12.013Z (almost 2 years ago)
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
A CSV Mapping object for easy csv import and export into and out of django. You specify formats and the models to import
into and it will automatically handle the imports, exports, errors, etc. You can directly pump information into models
or use forms to validate and save the data.The idea is as follows:
Form: Create a django form with the labels as the csv headers.
MapOption: Pass in the model and the form to create an option for csv parsing.
MapForm: Takes in a set of map options it will compare the csv against. This is the form that actually uploads the csv file, checks if the csv file meets a MapOption, and then validates the csv against the FormYou get a Formset back from the MapForm that you can then use in your app or spit back to the user for extra editing or fixing of invalid fields.
You can pass in a required set of fields that must be in the csv header, or it will parse it from the Form.fields that are required.This is a working product, but still may have a few bugs. It is well tested on my app, but I haven't created examples and tests to go with them yet.