Comments (10)
Sure, or if they're generally useful and easy enough to customize they can be added to ckanext-scheming itself. That makes it easier to fix them when scheming needs to be refactored.
from ckanext-scheming.
ckan's validation lets you define these sub-schemas by specifying a dict of validators for all the sub-fields instead of a list of validators. scheming only supports the latter at the moment, but you could subclass the plugin to change that behaviour, or modify scheming to allow a dict in the validators sections to be passed through.
You'll also have to come up with a clever way to store these fields as extras, possibly in __before and __after validators.
I'm interested to see if you find a nice solution for this.
from ckanext-scheming.
@metaodi does your solution only work from the API or can you accept data from a form too?
from ckanext-scheming.
@wardi I have no GUI for the list of dicts, so I can't really test this right now. I currently still use my "ugly" solution, but I'll keep you posted if there is any progress in that regard.
from ckanext-scheming.
Here is a shot at solving a cheapo version of this problem (objects in list contain only primitives, good enough for us).
https://ckan4rdm.wordpress.com/2016/03/04/list-of-authors/#comment-3
from ckanext-scheming.
@hvwaldow very cool!
I was planning to merge relatively trivial ckanext-repeating code into ckanext-scheming. Are there any changes you'd like to see to either that would help ckanext-composite do its thing?
from ckanext-scheming.
Credits for this go to @espona.
Hard to tell. Actually composite
copies quite a bit of repeating
. I am using also other additions on top of scheming and repeating. Need to re-factor before I can come with with good suggestions. That is not happening now.
Generally I think scheming makes people write a lot of custom form_snippets, display_snippets and validators that are hidden away in obscure extensions (talking about my stuff now). Some sort of curated ckanext-scheming-extras
to collect those would be helpful.
from ckanext-scheming.
Sort of staging area: Dump code for custom fields there that works for you. Others can pillage there. Once patterns / heavy usage emerges, someone hopefully does a high-quality version to be pulled into ckanext-scheming
.
from ckanext-scheming.
@hvwaldow if you're willing to maintain it I'm happy to create the repo for you
from ckanext-scheming.
@wardi So I nicely talked me into some more work, yes? Generally positive. I'll try to start such a thing containing my little additions. I'll tell you when there is something to look at.
from ckanext-scheming.
Related Issues (20)
- Option to display help_text before the form input block HOT 2
- Option to display grouped metadata by relying on start_form_page
- CKAN - Custom plugin/theme error datastore using fluent presets
- Combination of Form Pages and repeating_subfields do not work properly in edit mode. HOT 2
- Formpages does not work when a required field is in the second page HOT 1
- Empty multiple_checkbox is not saved
- Handling many start_form_page sections
- Can't use choices_helper for a required field HOT 3
- Customizing group/about.html
- Validators ignored for fields with repeating subfields
- Applying multiple schemas not working as expected HOT 2
- Repeating subfield form snippet displays help text inconsistently HOT 2
- Rendered `select` elements on form do not have "dropdown" arrow HOT 1
- Missing in documentation HOT 1
- ckan.plugins.core.PluginNotFoundException: scheming_datasets HOT 2
- Install Error: Error processing line 1 HOT 3
- Groups/Organizations silently ignore `create_validators`
- Translations for label name and placeholder not working. HOT 4
- Other extra fields will be deleted after editing dataset
- Check_ckan_version() throwing error due to missing argument HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ckanext-scheming.