Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small Features to csvimport #17

Merged
merged 5 commits into from
Jun 24, 2013
Merged

Small Features to csvimport #17

merged 5 commits into from
Jun 24, 2013

Conversation

cwood
Copy link
Contributor

@cwood cwood commented Jan 29, 2013

Hey,

  • added a couple features to the csv import. I added django signals to the app, to allow the model to custom format a row. So if its some row that the app cant figure out we can transform it if we know what it is.
  • added appconf to allow the app to be more customizable. Right now I am just using it to manually select which models I am allowing to import from a CSV. But can be used for other settings. If they do not choose it will return to the default behavior.
  • I also removed the except all clause. And added it to spcifically to database problems. This way if the user creates a handler and it fails it should return back a relative message. Rather than passing on and not inserting the data.

There is some minor clean up I did. Sorry. Hopefully I didnt hurt blame to much.

Thanks for writing this! Saved me a bunch of time having to make this!

Use the django signals to allow models to transform a row of information from a
csv to what they need. An example being converting a date to a date time object
and saving it.
@edcrewe edcrewe merged commit 49e2c96 into edcrewe:master Jun 24, 2013
@edcrewe
Copy link
Owner

edcrewe commented Jun 24, 2013

Hi,

I am not that keen on adding the django-appconf dependency when it isn't strictly necessary.
But I guess I can remove it again in the future if it bugs me too much :-)

But clearly the pre-import signals to clean up bad data are pretty useful, and thanks for cleaning up
some code. So I have merged this and fixed the tests for overflow errors when given too big numbers.

Thanks,
Ed

@cwood
Copy link
Contributor Author

cwood commented Jun 24, 2013

Cool thanks a bunch Ed.

I was using django appconf since its a nice and clean way to deal with django settings and it seems like a lot of apps are using it. No worries if you don't want too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants