[ckan-dev] what is the Missing class used for?

Dave Caraway dave at fogmine.com
Sat Sep 7 05:41:05 UTC 2013


Figured it out, I think. The Missing class is used for ignore_missing,
ignore_empty and other validator functions defined in
ckan.lib.navl.validators. Note that these should not be confused with
validators defined in the formencode library, which is also used for HTML
form validation.





On Fri, Sep 6, 2013 at 5:26 PM, Dave Caraway <dave at fogmine.com> wrote:

> Hi everyone,
>
> Can anyone explain where instances of the Missing class (an exception) in
> ckan.lib.navl.dictization_functions.py should be propagated to? Right now
> they are going uncaught, resulting in a server error for me. Wondering if I
> should just catch them and add a message to the error object.
>
> code snippet from ckan.lib.navl.dictization_functions.py:
>
> class Missing(object):
>     def __unicode__(self):
>         raise Invalid(_('Missing value'))
>     def __str__(self):
>         raise Invalid(_('Missing value'))
>     def __int__(self):
>         raise Invalid(_('Missing value'))
>     def __complex__(self):
>         raise Invalid(_('Missing value'))
>     def __long__(self):
>         raise Invalid(_('Missing value'))
>     def __float__(self):
>         raise Invalid(_('Missing value'))
>     def __oct__(self):
>         raise Invalid(_('Missing value'))
>     def __hex__(self):
>         raise Invalid(_('Missing value'))
>     def __nonzero__(self):
>         return False
>
>
> Thanks!
> -Dave
>
> --
> Dave Caraway
> Owner
> Fog Mine
> dave at fogmine.com
> Cell: (937) 985-0867
> Fax: (866) 238-3120
>



-- 
Dave Caraway
Owner
Fog Mine
dave at fogmine.com
Cell: (937) 985-0867
Fax: (866) 238-3120
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130907/40501b6d/attachment-0001.html>


More information about the ckan-dev mailing list