[ckan-dev] Custom fields that are arrays or objects with fields
Ian Ward
ian at excess.org
Thu Oct 30 16:34:43 UTC 2014
No, that looks like a bug. Submit an issue on the -scheming github
repo if you like and we can keep the noise on ckan-dev down :-)
Ian
On Thu, Oct 30, 2014 at 12:21 PM, Renato Guevara
<guevara.renato at gmail.com> wrote:
> Ian,
>
> Thank you again! I tried installing the plugin using the following command:
>
> pip install -e
> "git+https://github.com/open-data/ckanext-scheming.git#egg=ckanext-scheming"
>
> but I receive the following error:
>
> Obtaining ckanext-scheming from
> git+https://github.com/open-data/ckanext-scheming.git#egg=ckanext-scheming
> Cloning https://github.com/open-data/ckanext-scheming.git to
> ./ckanext-scheming
> Running setup.py
> (path:/usr/lib/ckan/default/src/ckanext-scheming/setup.py) egg_info for
> package ckanext-scheming
>
> error: Namespace package problem: ckanext is a namespace package, but
> its
> __init__.py does not call declare_namespace()! Please fix it.
> (See the setuptools manual under "Namespace Packages" for details.)
> "
> Complete output from command python setup.py egg_info:
> running egg_info
>
> creating ckanext_scheming.egg-info
>
> writing ckanext_scheming.egg-info/PKG-INFO
>
> writing namespace_packages to
> ckanext_scheming.egg-info/namespace_packages.txt
>
> writing top-level names to ckanext_scheming.egg-info/top_level.txt
>
> writing dependency_links to ckanext_scheming.egg-info/dependency_links.txt
>
> writing entry points to ckanext_scheming.egg-info/entry_points.txt
>
> writing manifest file 'ckanext_scheming.egg-info/SOURCES.txt'
>
> warning: manifest_maker: standard file '-c' not found
>
>
>
> error: Namespace package problem: ckanext is a namespace package, but its
>
> __init__.py does not call declare_namespace()! Please fix it.
>
> (See the setuptools manual under "Namespace Packages" for details.)
>
> "
> Have you see this before?
>
> On Thu, Oct 30, 2014 at 11:31 AM, Ian Ward <ian at excess.org> wrote:
>>
>> On Thu, Oct 30, 2014 at 11:13 AM, Renato Guevara
>> <guevara.renato at gmail.com> wrote:
>> > Ian,
>> >
>> > Thank you for your response. I'm looking through both ckanext-scheming
>> > and
>> > ckanext-fluent, but I'm a bit confused on how you use them. I get the
>> > concept of how ckanext-scheming is used to define your own json schema.
>> > So,
>> > when you use the ckanext-fluent plugin, how do you modify
>> > ckanext-scheming
>> > to use fluent? In addition to that, I see that ckanext-scheming
>> > implements
>>
>> You add the fluent plugin and include the fluent validators and
>> template snippets where you wan them in your scheming schema.
>>
>> > the IDatasetForm class, but doesn't implement the
>> > package_create/modify/show
>> > functions required. Does that mean that it is added by the user? I'm a
>> > bit
>> > fuzzy on that. Would you be able to help me run through the steps.
>>
>> Yes, to use ckanext-scheming you would add it (scheming_datasets) to
>> your plugins in your ini file. The scheming_datasets plugin implements
>> the validate method of the IDatasetForm interface which covers all the
>> create/modify/show cases.
>>
>> > For example, before I knew about this plugin, I had written the
>> > following
>> > plugin to add my customized fields.
>> [...]
>>
>> The idea of scheming is to allow this kind of plugin to be written as
>> mostly configuration instead of python code. So it's just another way
>> of writing the plugin you already have.
>>
>> > I wanted to add another field called "queryLanguage" which is
>> > essentially a
>> > list of options. So, I can have something like
>> >
>> > queryLanguage: ["sql", "sparql"].
>> >
>> > This is what drove me to ask the question. Do I use this plugin in
>> > conjunction with ckanext-scheming?
>>
>> No, for scheming you would need to change the way your plugin is
>> written (and use the latest ckan master version)
>>
>> The reason I wrote fluent as a separate extension, and plan to write
>> the repeating extension the same way is so that people can reuse those
>> new field types even in plugins that *don't* use scheming. You just
>> need to add the validators to your schema, update your form to submit
>> data the right way, and update your display template to display it the
>> way you want.
>>
>> When I have something usable for this purpose I'll reply to this
>> thread. For now the simplest thing to do for the list field you want
>> to add is to store it as a delimited string. It's possible to convert
>> from that to the new field type transparently with a show validator if
>> you choose to switch later.
>>
>> Ian
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
More information about the ckan-dev
mailing list