numberoverzero / declare Goto Github PK
View Code? Open in Web Editor NEWPython scaffolding for declarative resource modeling
License: MIT License
Python scaffolding for declarative resource modeling
License: MIT License
Instead of __meta__
use class Meta:
which is the more common style in existing libraries/frameworks.
While this will make Meta
a reserved key, it's a bit cleaner and in general shouldn't be a commonly used attribute name.
Since load and dump already take references to the context, bind should be able to provide a context that TypeDefinition.bind can inspect and use to return specialized load/dump functions.
Should see A's fields in B, unless B overwrites them.
import declare
Base = declare.ModelMetaclass("Base", (object,), {})
class A(Base):
a = declare.Field()
class B(A):
pass
print("A fields:")
print(A.__meta__['fields'])
print(A.__meta__['fields_by_model_name'])
print("B fields:")
print(B.__meta__['fields'])
print(B.__meta__['fields_by_model_name'])
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.