Trying to save an invalid geometry syntax via TextArea widget results in a TemplateSyntaxError

4 views
Skip to first unread message

Haes

unread,
Mar 28, 2011, 9:32:26 AM3/28/11
to olwidget
Hi,

if you try to save an invalid geometry syntax via a TextArea widget in
the admin, a TemplateSyntaxError is raised.
Is it possible to catch those exceptions (I've seen OGRException and
GEOSException so far) and raise a ValidationError, so that the
corresponding field is marked as erroneous with an appropriate error
msg?

Thanks for any help.

PS: Unfortunately, the code never enters the form's clean_XX() methods
or I'd be able to catch those exceptions in admin.py myself.

Charlie DeTar

unread,
Mar 28, 2011, 10:53:01 AM3/28/11
to olwi...@googlegroups.com
Good suggestion. I've opened an issue here:

https://github.com/yourcelf/olwidget/issues/54

-charlie

Reply all
Reply to author
Forward
0 new messages