[ckan-dev] Creating resources via API and via UI

Ian Ward ian at excess.org
Fri Mar 27 12:02:26 UTC 2015


The confusing thing here is the "name" field is labelled "URL" in the
dataset form. That value is usually generated from the "title" field
by javascript in the form.

Try setting the title field as well and that will be shown instead of
the "name"/"URL".

On Fri, Mar 27, 2015 at 7:43 AM, Niall Beard
<niall.beard at manchester.ac.uk> wrote:
> Hi guys,
>
> I've ran into a little issue and I'm not sure if it's a bug in CKAN or if
> the problem exists between chair and keyboard (so to speak).
>
> Basically when I create a resource via the API, the name is constrained to
> being lowercase and with no spaces (e.g. this-_is-valid). If I create this
> using the UI, the name can be set to anything (e.g. This is Valid). In the
> UI its the name attribute that is being displayed on the read page; so I end
> up with a horrible lowercase string on names of API created resources and
> nice ones on UI created resources.
> e.g.
> Bad (API created):
> http://freya.cs.man.ac.uk:5000/dataset/genome3d-disopred_ffpred_mempack/resource/0302b216-fb4c-4917-966f-cb413c92edb0
>
> Good (UI created):
> http://freya.cs.man.ac.uk:5000/dataset/ui-uploaded/resource/81892533-76bb-43e0-b3cc-17caa9fae8c2
>
> The error returned when trying to add a human readable name is:
>  "name": ["Must be purely lowercase alphanumeric (ascii) characters and
> these symbols: -_"]}}
>
>
> Should that check in the API for lowercaseyness exist, or are we using the
> API wrong?
>
>
> Niall Beard
> Scientific Web Technologist,
> myGrid Team,
> University of Manchester
>
> _______________________________________________
> 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