I'm developing a custom widget for Deform that requires the use of the
Google Maps API (and another JS requirement that I have written) and I want
to set this as a required resource for developers using the widget. This is
simple enough:
class CustomWidget(Widget):
requirements = ( ('maptack', None), ('googlemaps-api', '3.0'))
The user is required to specify the JS resources similar to the following
in their project (I'd also love a way around this -- seems very non-modular
and puts a lot of expectations of someone using the widget):
registry = ResourceRegistry(use_defaults=True)
registry.set_js_resources('googlemaps-api', '3.0',
'http://maps.googleapis.com/maps/api/js?sensor=false')
The issue I am facing is set_js_resources expects a relative asset (which
may or may not be packaged within my widget) which is usually output to the
<head> of their HTML file by using Deform.Form.get_widget_resources(). I
have been unable to find any examples of this problem being solved nor any
references to it within the documentation. Has anyone had experience with
this, or have a good solution? Any example widgets that use resources which
are not included in Deform by default would be much appreciated.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.