Hi, so I have created my own deform widget which is an updated select2 (with help from this group) and rather than copy the .js and the .cs into the deform folder I would like to be able to serve them from elsewhere. I am using pyramid. and have several includes as well as my main pyramid app. bds.theme is one of those includes.
In the definition of my widget I have:
class Select2RemoteDataWidget(deform.widget.Select2Widget):
template = 'bds.theme:templates/remotedataselect2-1.pt'
requirements = (('deform', None), ('select2', '4.0.3'))
readonly_template = 'bds.theme:templates/remotedataselect2-1-ro.pt
url = ''
With just this I get a value error as there is no such requirement to be found in deform.
Then I added to the requirements in the init file of my pyramid application
registry = deform.widget.ResourceRegistry(use_defaults=True)
registry.set_js_resources('select2', '4.0.3', 'bds.theme:static/select2/select2-4.0.3.js')
registry.set_css_resources('select2', '4.0.3', 'bds.theme:static/select2/select2-4.0.3.cs')
Form.set_default_resource_registry(registry)
I have also set up a static route but it doesn't seem to have any effect.
config.add_static_view(bds.theme:static,,bds.theme:static, cache_max_age=86400)
I no longer get the value error with this setup but instead I get a 401 error if I try and look for the file referred to.
It says the file is found at: