I'm not a mapscript expert, others may be able to help out better than me. try "LAYER VALIDATION .. .. .. END END"
-- thomas On 14 January 2016 at 11:26, Andrea Peri <[email protected]> wrote: > Thx Thomas , > I find the right function name. > It is > updateFromString() > now the function is callable, but have another kind of 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 1568, in updateFromString > def updateFromString(self, *args): return > _mapscript.layerObj_updateFromStri > ng(self, *args) > EOFError: loadLayer(): Premature End-of-File. > > A. > > > 2016-01-14 11:18 GMT+01:00 thomas bonfort <[email protected]>: > > mapscript is camelcase > > > > On 14 January 2016 at 10:51, Andrea Peri <[email protected]> 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 <[email protected]>: > >> > 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 <[email protected]> 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 > >> >> [email protected] > >> >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >> > > >> > > >> > >> > >> > >> -- > >> ----------------- > >> Andrea Peri > >> . . . . . . . . . > >> qwerty àèìòù > >> ----------------- > > > > > > > > -- > ----------------- > Andrea Peri > . . . . . . . . . > qwerty àèìòù > ----------------- >
_______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
