[ckan-dev] Tag errors
Sean Hammond
sean.hammond at okfn.org
Fri Jul 13 10:20:09 UTC 2012
> Errors in tags seem to be non standard
>
> normal errors look like
>
> 'Field': 'something is bad'
>
> for tags we get something like
>
> 'Tags': {'name': [u'Tag ":" length is less than minimum 2', u'Tag ":" must
> be alphanumeric characters or symbols: -_.']}, {'name': [u'Tag ":" length
> is less than minimum 2', u'Tag ":" must be alphanumeric characters or
> symbols: -_.']}
Hmm, isn't this because a package's tags are validated recursively?
You're getting a list of dicts because you get one dict for each tag
that has errors.. e.g. in default_package_schema you have
'title': [if_empty_same_as("name"), unicode] for example, but for the tags you
have 'tags': default_tags_schema(), i.e. it's a schema within a schema.
I think you would get the dictionary-style errors for resources, extras
and relationships as well.
The example tag error dict you have above is really confusing though, I
can't work out what it's supposed to be telling me (which tags have bad
names? What are the bad names?)
More information about the ckan-dev
mailing list