We should have a limit somewhere. Allowing a choice field with 100,000
options seems like a bug, not a feature.
If we do want to support that amount of options it will probably need to be
served from an autocomplete for usability, and should get a different type.

UI/API validation is probably fine.

On Wed, Aug 7, 2013 at 11:31 AM, Adam Hinz <notifications@github.com> wrote:

> In opentreemap/treemap/udf.py:
>
> > +        if 'type' not in datatype:
> > +            raise ValidationError(_('type required data type definition'))
> > +
> > +        if datatype['type'] not in ['float', 'int', 'string',
> > +                                    'user', 'choice', 'date']:
> > +            raise ValidationError(_('invalid datatype'))
> > +
> > +        if datatype['type'] == 'choice':
> > +            choices = datatype.get('choices', None)
> > +
> > +            if choices is None:
> > +                raise ValidationError(_('missing choices key for key'))
> > +
> > +            if len(choices) == 0:
> > +                raise ValidationError(_('empty choice list'))
> > +
>
> @maurizi <https://github.com/maurizi> I'm tempted to leave that as a
> UI/API constraint. Do you think it would be better to prohibit it directly
> on the model?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/azavea/OTM2/pull/148/files#r5634490>
> .
>



-- 
Michael V. Maurizi Jr, Software Developer

Azavea |  340 N 12th St, Suite 402, Philadelphia, PA
mmaurizi@azavea.com  | T 215.558.6190
Web azavea.com <http://www.azavea.com/>  |  Blog
azavea.com/blogs<http://www.azavea.com/Blogs>
| Twitter @azavea <http://twitter.com/azavea>