yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

template parameter in form meta options is ignored #93

Closed onurmatik closed 12 years ago

onurmatik commented 12 years ago

I am trying to override a forms map widget template like this:

class PostForm(MapModelForm):
    class Meta:
        model = Post
        options = {
            'template': 'posts/post_form_map.html',
            'layers': [...],
            ...
        }

but the template parameter is ignored.

Thanks.

yourcelf commented 12 years ago

Thanks, fixed in fd4de8d99ed3173aa4fd34e655047ace8b37d9f9. Since the "options" dictionary is passed more or less directly to the javascript map constructor, it makes more sense for the template declaration to be a property of the Meta class. Use this syntax here:

https://github.com/yourcelf/olwidget/blob/master/django-olwidget/olwidget/tests.py#L76

onurmatik commented 12 years ago

thanks a lot. cheers.