Giter VIP home page Giter VIP logo

django-simple-import's People

Contributors

bufke avatar cordavis avatar matthiaswh avatar saulshanabrook avatar seanhayes avatar smcoll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-simple-import's Issues

set_field_from_cell

For one of the columns in an xlsx file, only one value for the whole column imported. Here's what was happening in the majority of cases:

On line 299 of simple_import/views.py, there is a check to see if the value of the cell is in the database_values list. In my case, here's what was checking as False:

# from debugger pane:
cell = u'AL'
database_values = ('AL', 'AK', 'AS', ...)
verbose_values = ('Alabama', 'Alaska', 'American Samoa', ...)

The cell value was unicode, but the database values were not, so the cell in database_values == False. Same would have been true of verbose_values. FWIW, these choices are from localflavor: https://github.com/django/django-localflavor/blob/master/localflavor/us/us_states.py

My first thought is to coerce cell, the values in database_values, and the values in verbose_values all to unicode before making the check. Any thoughts on that?

django==1.6.8
django-simple-import==1.19

Deal with choices lookups

For example if the user see's "Monday" but the database is "M" the import won't work.

choices  = ['M', 'Monday'] ,etc

Object not saved after calling set_method_from_cell()

set_method_from_cell() was moved after new_object.save() for good reason in 32a6c5d. This breaks methods like set_password() that do not save the object themselves. My original fix was to put new_object.save() inside of set_method_from_cell(), but this wastefully hits the database for each field instead of once per objects.

The best place for a second save() call after calling the methods is probably in do_import() on line 369: https://github.com/burke-software/django-simple-import/blob/master/simple_import/views.py#L369. Looking there, though, why is there a second loop of set_field_from_cell() starting at line 370? Can I remove it? I don't see what it accomplishes since new_object is never saved afterwards.

"Column match with this Column name and Import setting already exists."

After a failed import (column match), subsequent attempts fail with the error "Column match with this Column name and Import setting already exists" on several fields. i'm not sure yet which fields they pertain to, as they all look like this:

<ul class="errorlist">
    <li>__all__
        <ul class="errorlist">
            <li>Column match with this Column name and Import setting already exists.</li>
        </ul>
    </li>
</ul>

Can't import Google Drive ods files

Basically the fault is a lack of decent python ods libraries.

Google Drive ods just doesn't work at all.
Libreoffice ods files sometimes show extra blank columns which breaks things. Could possibly work around this.

If anyone knows of a functional ods python library please let me know.

Allow providing defaults for required fields having no column match

i have multiple spreadsheets to import for one model. Each spreadsheet represents a different data source, and my model has a "source" attribute (which in this case is an FK) which needs to be set to a default value for the whole import. As it is, i can't import the file as-is without getting a "Source is required but has no match" error. i can modify the spreadsheet to get around this, but it's not ideal. It would be great if i could set the default for that field, even though there's no column in the spreadsheet.

Extraneous Files in PyPI Package

The current PyPI package has a ton of extraneous files included in the static folder that get collected when running ./manage.py collectstatic. As far as I can tell, they don't need to be included in the package at all, but especially not in the static folder. Can these be moved somewhere else?

collectstatic

Some string-formatted values are importing as decimal values

In an xlsx file, i have a column of string values, such as "66", "783 Foo". On import into a CharField, it seems that any value that can be interpreted as a decimal is converted to one, like "66.0", while other values like "783 Foo" remain as-is. The desired result is that the data is not reformatted that way.

Deal with duplicate headers

If one reuses the same header twice in a import, unexpected things happen.

Either simple import should allow working with duplicate headers or it should show a validation error.

include base template

A base template could be included that the other templates inherit from. This way, a user could override the base template without having to necessarily override the other four templates, when integrating with their markup. i'm happy to provide a pull request for this; just let me know if there are any preferences/conventions to consider.

admin usage

When I try an upload via the admin interface I keep receiving the error

"Column 'user_id' cannot be null"

Should this auto-populate from the user id of my login?

thanks!

migration broken for Django 1.7

KeyError: u"Migration simple_import.0001_initial dependencies reference nonexistent parent node (u'contenttypes', u'0002_remove_content_type_name')"

Migration "0002_remove_content_type_name" wasn't introduced until Django 1.8, so i believe the fix will be to depend on "0001_initial" instead.

Using Django 1.7.8.

just one update-key to choose

Hi,

Not sure it is a bug...

When trying to update my model which have unique_together = ('filed_1', 'filed_2', 'field_3' , 'field_4', 'field_5',) I have only one field to choose which in this model is impossible.

Any thoughts ?

Cheers,

Jakub

Error having to do with newlines in CSVs

Error at /simple_import/match_columns/3/
new-line character seen in unquoted field - do you need to open the file in universal-newline mode?

django==1.6.8
django-simple-import==1.19

PR incoming... first i'm gonna see if i can isolate the offending newline and make a test, if it doesn't take too long.

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.