alexei / python-adapters Goto Github PK
View Code? Open in Web Editor NEWAdapters allow converting data from one structure to another
Home Page: https://pypi.python.org/pypi/python-adapters
License: BSD 3-Clause "New" or "Revised" License
Adapters allow converting data from one structure to another
Home Page: https://pypi.python.org/pypi/python-adapters
License: BSD 3-Clause "New" or "Revised" License
i.e. if editable=False, won't update existing instance
The point is to not have to wonder whether the source object is a dict or an object when accessing the atrribute.
It should default to *
so it doesn't break existing code.
Might be confusing as is i.e. one might think it refers to an actual (ORM) model
The BaseField's get_attribute method is reliant on the data provided to the field and so, in the case of all the fields except AdapterMethodField(where get_attribute is overridden), we can get into some nasty issues, for example:
if the data is etree type(from lxml), when we put a CharField() on our custom Adapter, the get_attribute method will think that isinstance(obj, collections.Iterable) is True and such, will try to int(attr) which in our case is a string, <field_name> and it will crash silently(the get_attribute will return undefined because the exception is caught and in the end it will prompt the error message down the line as " Required value not found for field <field_name>
. Provide a default value. " which is confusing).
I.e. a field having omitempty=True
would not be set on the destination object
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.