diff --git a/pkgs/python-packages.nix b/pkgs/python-packages.nix --- a/pkgs/python-packages.nix +++ b/pkgs/python-packages.nix @@ -572,14 +572,13 @@ }; }; deform = super.buildPythonPackage { - name = "deform-2.0a3.dev0"; + name = "deform-2.0a2"; buildInputs = with self; []; doCheck = false; - propagatedBuildInputs = with self; [Chameleon colander iso8601 peppercorn translationstring zope.deprecation]; - src = fetchgit { - url = "https://github.com/Pylons/deform"; - rev = "08fb9de077c76951f6e70e28d4bf060a209d3d39"; - sha256 = "0nmhajc4pfgp4lbwhs5szqfzswpij1qyr69m7qkyhncl2g2d759r"; + propagatedBuildInputs = with self; [Chameleon colander peppercorn translationstring zope.deprecation]; + src = fetchurl { + url = "https://pypi.python.org/packages/8d/b3/aab57e81da974a806dc9c5fa024a6404720f890a6dcf2e80885e3cb4609a/deform-2.0a2.tar.gz"; + md5 = "7a90d41f7fbc18002ce74f39bd90a5e4"; }; meta = { license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ]; diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -42,26 +42,35 @@ for SELECT use formencode.All(OneOf(list """ import deform +import logging +import formencode + from pkg_resources import resource_filename +from formencode import All, Pipe + +from pylons.i18n.translation import _ + +from rhodecode import BACKENDS +from rhodecode.lib import helpers +from rhodecode.model import validators as v + +log = logging.getLogger(__name__) + deform_templates = resource_filename('deform', 'templates') rhodecode_templates = resource_filename('rhodecode', 'templates/forms') search_path = (rhodecode_templates, deform_templates) -deform.Form.set_zpt_renderer(search_path) + +class RhodecodeFormZPTRendererFactory(deform.ZPTRendererFactory): + """ Subclass of ZPTRendererFactory to add rhodecode context variables """ + def __call__(self, template_name, **kw): + kw['h'] = helpers + return self.load(template_name)(**kw) -import logging - -import formencode -from formencode import All, Pipe - -from pylons.i18n.translation import _ - -from rhodecode import BACKENDS -from rhodecode.model import validators as v - -log = logging.getLogger(__name__) +form_renderer = RhodecodeFormZPTRendererFactory(search_path) +deform.Form.set_default_renderer(form_renderer) def LoginForm(): diff --git a/rhodecode/templates/admin/integrations/edit.html b/rhodecode/templates/admin/integrations/edit.html --- a/rhodecode/templates/admin/integrations/edit.html +++ b/rhodecode/templates/admin/integrations/edit.html @@ -38,7 +38,6 @@