Giter Site home page Giter Site logo

django-adaptors's Introduction

Django-adaptors is a tool which allow you to transform easily a CSV/XML file into a python object or a django model instance.
It is based on a django-style declarative model.

More information available on read the doc:
http://django-adaptors.readthedocs.org/

Release notes
-------------

0.2.5:

- add DecimalField
- lxml dependency optional

django-adaptors's People

Contributors

adamrt avatar andrewingram avatar anthony-tresontani avatar artofhuman avatar codeinthehole avatar debugduckdesign avatar djm 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-adaptors's Issues

Give the project away?

Hi,

I've noticed this project is not maintained anymore, besides forking and creating a django-adaptors-2 on PyPI what do you think about giving the project away to the community? We could create a organization, include you and other potential new contributors.

Thanks for your consideration.

Regex validation in XMLCharField

Can you add the ability to validate using a regex, eg::
XMLCharField(path='/some/path', regex='^Z[0,2]')

This is more flexible that offering choices.

Please make python3-compatible release

I'm running the git-master version with django 1.8/python3 without problems for some time.
It would be nice to have a version 0.26 with the python3 patches included.
Thanks a lot!

nullable field does not accept None as default

in the fields.py the method get_prep_value contains the following code:

...
        if not value and self.null and self.default is not None:
            value = self.default
        else:
            value = self.to_python(value)

...

this generates an exception in the following scenario:

  • the field is a DateField
  • the field is marked as null=True and has default=None

but I would expect it to not generate any exception: I simply desire to have a datefield which is null if not specified in the csv file. at the moment I patched the code as follows:

        if not value and self.null:
            value = self.default
        else:
            value = self.to_python(value)

which behaves as I expect. I thought you may desire to have it in your code, as I didn't find any other way to specify that a DateField can be optional in the csv file.

error occured when define exclude = ['name1','name2']

as i understand the exclude should be a list. but when i define the exclude = ['name1','name2'], error occurs as follows:
append() takes exactly one argument (2 given)
Exception Location: ...../lib/python2.7/site-packages/adaptor/model.py in get_exclusion_fields, line 312
i think the code should be changed to :
if hasattr(cls, "Meta") and hasattr(cls.Meta, "exclude"):
list_exclusion.extend(cls.Meta.exclude)

if the foreinkey can be NULL, how to use DjangoModelField ?

i think the docuement should be updated. DjangoModelField not mentidoned at the doc, bu instead of ForeignKey.
if a foreinkey definition can be NULL, how to deal with this secnario ?
maybe DjanogModelField.to_python() can be changed.

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.