[ckan-dev] Tag errors

Toby Dacre toby.okfn at gmail.com
Fri Jul 13 11:10:09 UTC 2012


On 13 July 2012 11:20, Sean Hammond <sean.hammond at okfn.org> wrote:

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

Just been working on this stuff

in the example the I have created to tags which are both : as it is an
illegal char
 so tag ":" is the problem tag - but yes it is confusing

additionally the error summary only gets the first error for a field even
if more than one is present which I'm not sure is the correct behaviour

the data hub doesn't seem to show errors on the actual form fields like
demo does and the old genshi template seems to flatten the error better
than the demo was but I'm fixing this.

I'm not sure if we should just ignore the error summary and generate the
summary from the actual errors

Toby


> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120713/b4b1bc2d/attachment-0001.html>


More information about the ckan-dev mailing list