lorinkoz / django-js-choices Goto Github PK
View Code? Open in Web Editor NEWJavascript model field's choices handling for Django
License: MIT License
Javascript model field's choices handling for Django
License: MIT License
It's cool that this automatically resolves the choices names conflicts. But, if you add a new choice or a package with a choice that collides with yours then the short name will be removed without notice. I think will be useful to select what names you want to make available so in advance you always know what model's choices you are using.
Cut new version with the following changes:
rjsmin
and provide as extra package.I'd like the ability to add new sources of "choices" that are not from django models fields directly, but instead like some value,label
pairs used for some custom logic that are not on any models and wants to be synced to a javascript frontend; I think django_js_choices would be a good place to put such logic.
I would imagine it to be something like this:
from django_js_choices import register_source
# some variable with value,label keys
DOABLE_ACTIONS = [("nothing", "Do nothing"), ("go_2", "Advance 2 steps"), ...]
register_source("doable_actions", DOABLE_ACTIONS)
What do you think? I'd be down for filling a PR for it.
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.