Git Product home page Git Product logo

dictalchemy's People

Contributors

danielholmstrom avatar klinkin 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dictalchemy's Issues

'dict' object has no attribute 'iteritems'

When using the .asdict() function in python v3.X the following error is encountered. 'dict' object has no attribute 'iteritems'

Fix is to update Line for (rel_key, orig_args) in follow.iteritems(): with for (rel_key, orig_args) in follow.item(): untils.py on line 120.

This fix is only applicable for python v3, another package should probably be created to maintain v2 support if required.

fromdict: primary key check should be after exclude check

The test for primary keys update is now done as first test. So even if the primary key fields are in the exclude list, an exception is raised. To circumvent, one needs to set allow_pk to True as well as put the primary key fields in the exclude list. Especially in the case of multi-column primary keys, this is error-prone. If one forgets (or makes a typo in) one primary key field in the exclude list, the allow_pk=True setting will allow an update. IMHO it would be more sensible to first check the exclude list and only if a field survives that, do the primary key check. In that case, allow_pk can be left False so mistakes in the exclude list are still caught.

This now fails while IMHO it should succeed:

h = Named('a name')
h.fromdict({'id': 12345}, exclude=['id'])

This currently succeeds:

h = Named('a name')
h.fromdict({'id': 12345}, allow_pk=True, exclude=['id'])

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.