GithubHelp home page GithubHelp logo

Support list of dicts about ckanext-scheming HOT 10 OPEN

ckan avatar ckan commented on June 10, 2024
Support list of dicts

from ckanext-scheming.

Comments (10)

wardi avatar wardi commented on June 10, 2024 1

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.

wardi avatar wardi commented on June 10, 2024

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.

wardi avatar wardi commented on June 10, 2024

@metaodi does your solution only work from the API or can you accept data from a form too?

from ckanext-scheming.

metaodi avatar metaodi commented on June 10, 2024

@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.

hvwaldow avatar hvwaldow commented on June 10, 2024

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.

wardi avatar wardi commented on June 10, 2024

@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.

hvwaldow avatar hvwaldow commented on June 10, 2024

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.

hvwaldow avatar hvwaldow commented on June 10, 2024

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.

wardi avatar wardi commented on June 10, 2024

@hvwaldow if you're willing to maintain it I'm happy to create the repo for you

from ckanext-scheming.

hvwaldow avatar hvwaldow commented on June 10, 2024

@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)

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.