[mapserver-users] Add a validation block using python mapscript

thomas bonfort thomas.bonfort at gmail.com
Thu Jan 14 02:18:03 PST 2016


mapscript is camelcase

On 14 January 2016 at 10:51, Andrea Peri <aperi2007 at gmail.com> wrote:

> Hi Thomas,
> Thx for reply, I don't know this sintax.
>
> I try this:
>
>     theLayer = clone_map.getLayer(li)
>     tempValidation = "VALIDATION 'idtpn' '^[a-zA-Z0-9\-_#]+$'
> 'default_idtpn' '%' END"
>     theLayer.updatefromstring(tempValidation)
>
> But it return an error:
>
> Traceback (most recent call last):
>   File "generatore_mapfile_istat.py", line 192, in <module>
>     theLayer.updatefromstring(tempValidation)
>   File
> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li
> ne 1385, in <lambda>
>     __getattr__ = lambda self, name: _swig_getattr(self, layerObj, name)
>   File
> "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li
> ne 54, in _swig_getattr
>     raise AttributeError(name)
> AttributeError: updatefromstring
>
> A.
>
>
> 2016-01-14 10:38 GMT+01:00 thomas bonfort <thomas.bonfort at gmail.com>:
> > if there is no mapscript interface for VALIDATION you can always use
> >
> > layer->updatefromstring("VALIDATION etc END")
> >
> > --
> > thomas
> >
> > On 14 January 2016 at 10:33, Andrea Peri <aperi2007 at gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> Is possible , using the python mapscript add a block for validation like
> >> this ?
> >>
> >>     VALIDATION
> >>       'idtpn' '^[a-zA-Z0-9\-_#]+$'
> >>       'default_idtpn' '%'
> >>     END
> >>
> >>
> >> --
> >> -----------------
> >> Andrea Peri
> >> . . . . . . . . .
> >> qwerty àèìòù
> >> -----------------
> >> _______________________________________________
> >> mapserver-users mailing list
> >> mapserver-users at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160114/92b6ee99/attachment.html>


More information about the mapserver-users mailing list