diff --git a/.gitignore b/.gitignore index a49daf6..015d6a6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ docs/modules/ include/ .installed.cfg *.egg-info -*.pt.py *.swp *.pyc *.pyo diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..d9d7a2e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,8 @@ +include CHANGES.txt +recursive-include pyramid_formalchemy *.pt.py +recursive-include pyramid_formalchemy *.pt +recursive-include pyramid_formalchemy *.css +recursive-include pyramid_formalchemy *.js +recursive-include pyramid_formalchemy *.gif +recursive-include pyramid_formalchemy *.png +recursive-include pyramid_formalchemy *.jpg diff --git a/pyramid_formalchemy/templates/admin/edit.pt.py b/pyramid_formalchemy/templates/admin/edit.pt.py new file mode 100644 index 0000000..d1900d9 --- /dev/null +++ b/pyramid_formalchemy/templates/admin/edit.pt.py @@ -0,0 +1,77 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _attrs_4357189584 = _loads('(dp1\nVaction\np2\nV\nsVmethod\np3\nVPOST\np4\nsVenctype\np5\nVmultipart/form-data\np6\ns.') + _attrs_4357187280 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4357189392 = _loads('(dp1\n.') + _attrs_4357187728 = _loads('(dp1\nVname\np2\nV_method\np3\nsVtype\np4\nVhidden\np5\nsVvalue\np6\nVPUT\np7\ns.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u"main.macros['master']" + _metal = _lookup_attr(econtext['main'], 'macros')['master'] + def _callback_main(econtext, _repeat, _out=_out, _write=_write, _domain=_domain, **_ignored): + if _repeat: + repeat.update(_repeat) + attrs = _attrs_4357189392 + _write(u'
\n ') + attrs = _attrs_4357189584 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'fs.render()' + _content = _lookup_attr(econtext['fs'], 'render')() + attrs = _attrs_4357187280 + u'_content' + _write(u'
') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
\n ') + attrs = _attrs_4357187728 + u"main.macros['buttons']" + _write(u'\n ') + _metal = _lookup_attr(econtext['main'], 'macros')['buttons'] + u'{}' + _tmp = {} + u"main.macros['buttons']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + _write(u'\n
\n
\n') + u"{'main': _callback_main}" + _tmp = {'main': _callback_main, } + u"main.macros['master']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + return _out.getvalue() + return render + +__filename__ = u'/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/edit.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/admin/listing.pt.py b/pyramid_formalchemy/templates/admin/listing.pt.py new file mode 100644 index 0000000..d158ad5 --- /dev/null +++ b/pyramid_formalchemy/templates/admin/listing.pt.py @@ -0,0 +1,173 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _attrs_4347680016 = _loads('(dp1\nVclass\np2\nVlayout-grid\np3\ns.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4347717136 = _loads('(dp1\nVclass\np2\nVui-widget-header ui-widget-link ui-corner-all\np3\ns.') + _attrs_4347680400 = _loads('(dp1\nVclass\np2\nVui-pager\np3\ns.') + _attrs_4347680656 = _loads('(dp1\n.') + _attrs_4347717200 = _loads('(dp1\nVclass\np2\nVui-icon ui-icon-circle-plus\np3\ns.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4347680528 = _loads('(dp1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u"main.macros['master']" + _metal = _lookup_attr(econtext['main'], 'macros')['master'] + def _callback_main(econtext, _repeat, _out=_out, _write=_write, _domain=_domain, **_ignored): + if _repeat: + repeat.update(_repeat) + attrs = _attrs_4347680656 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'pager' + _content = econtext['pager'] + attrs = _attrs_4347680400 + u'_content' + _write(u'
') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + u"''" + _write(u'
\n ') + _default.value = default = '' + u'fs.render()' + _content = _lookup_attr(econtext['fs'], 'render')() + attrs = _attrs_4347680016 + u'_content' + _write(u'') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
\n ') + attrs = _attrs_4347680528 + _write(u'

\n ') + attrs = _attrs_4347717136 + u"request.route_url(request.route_name, traverse='%s/new' % request.model_name)" + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u'>\n ') + attrs = _attrs_4347717200 + u"F_('New')" + _write(u'\n ') + _tmp1 = econtext['F_']('New') + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + u'model_name' + _write(u' ') + _tmp1 = econtext['model_name'] + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n \n

\n
\n') + u"{'main': _callback_main}" + _tmp = {'main': _callback_main, } + u"main.macros['master']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/listing.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/admin/master.pt.py b/pyramid_formalchemy/templates/admin/master.pt.py new file mode 100644 index 0000000..3ec8b71 --- /dev/null +++ b/pyramid_formalchemy/templates/admin/master.pt.py @@ -0,0 +1,368 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _attrs_4349228944 = _loads('(dp1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4349229648 = _loads('(dp1\n.') + _attrs_4349229712 = _loads('(dp1\nVclass\np2\nVbreadcrumb\np3\ns.') + _attrs_4349229392 = _loads('(dp1\n.') + _attrs_4349229776 = _loads('(dp1\n.') + _attrs_4349230160 = _loads('(dp1\n.') + _attrs_4349229520 = _loads('(dp1\nVrel\np2\nVstylesheet\np3\ns.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4349229072 = _loads('(dp1\n.') + _attrs_4349229584 = _loads('(dp1\nVid\np2\nVheader\np3\nsVclass\np4\nVui-widget-header ui-corner-all\np5\ns.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4349229968 = _loads('(dp1\nVid\np2\nVcontent\np3\nsVclass\np4\nVui-admin ui-widget\np5\ns.') + _attrs_4349229264 = _loads('(dp1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + _attrs_4349230480 = _loads('(dp1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u"%(scope)s['%(out)s'], %(scope)s['%(write)s']" + (_out, _write, ) = (econtext['_out'], econtext['_write'], ) + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + attrs = _attrs_4349228944 + _write(u'\n ') + attrs = _attrs_4349229072 + u"''" + _write(u'\n ') + _default.value = default = '' + u"request.model_name or 'root'" + _content = (_lookup_attr(econtext['request'], 'model_name') or 'root') + attrs = _attrs_4349229392 + u'_content' + _write(u'') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n ') + attrs = _attrs_4349229520 + u"request.static_url('pyramid_formalchemy:static/admin.css')" + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u'>\n \n ') + attrs = _attrs_4349229264 + _write(u'\n ') + attrs = _attrs_4349229968 + _write(u'
\n ') + attrs = _attrs_4349229584 + _write(u'

\n ') + attrs = _attrs_4349229712 + u'breadcrumb' + _write(u'\n ') + _default.value = default = '' + u"request.model_name or 'root'" + _content = (_lookup_attr(econtext['request'], 'model_name') or 'root') + attrs = _attrs_4349229776 + u'_content' + _write(u'
') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + u"%(slots)s.get(u'main')" + _write(u'
\n

\n ') + _tmp = _slots.get(u'main') + u'%(tmp)s is not None' + _tmp1 = (_tmp is not None) + if _tmp1: + pass + u'isinstance(%(tmp)s, basestring)' + _tmp2 = isinstance(_tmp, basestring) + if not _tmp2: + pass + econtext.update(dict(rcontext=rcontext, _domain=_domain)) + _tmp(econtext, repeat) + else: + pass + u'%(tmp)s' + _tmp2 = _tmp + _tmp = _tmp2 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + else: + pass + attrs = _attrs_4349229648 + _write(u'
\n
') + _write(u'\n
\n \n') + return + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/master.pt' +registry[('master', False, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4351942800 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4351944656 = _loads('(dp1\nVhref\np2\nV#\nsVclass\np3\nVui-widget-header ui-widget-link ui-widget-button ui-corner-all\np4\ns.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4351944784 = _loads("(dp1\nVtype\np2\nVsubmit\np3\nsVvalue\np4\nV${F_('Save')}\np5\ns.") + _attrs_4351945104 = _loads('(dp1\nVclass\np2\nVui-icon ui-icon-circle-arrow-w\np3\ns.') + _attrs_4351943504 = _loads('(dp1\nVclass\np2\nVfa_field\np3\ns.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + _attrs_4351944848 = _loads('(dp1\nVclass\np2\nVui-widget-header ui-widget-link ui-corner-all\np3\ns.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u"%(scope)s['%(out)s'], %(scope)s['%(write)s']" + (_out, _write, ) = (econtext['_out'], econtext['_write'], ) + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + attrs = _attrs_4351942800 + _write(u'
\n ') + attrs = _attrs_4351943504 + _write(u'

\n ') + attrs = _attrs_4351944656 + _write(u'\n ') + attrs = _attrs_4351944784 + 'join(value("F_(\'Save\')"),)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' value="' + _tmp1) + '"')) + _write(u' />\n \n ') + attrs = _attrs_4351944848 + u'request.route_url(request.route_name, traverse=request.model_name)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u'>\n ') + attrs = _attrs_4351945104 + u"F_('Cancel')" + _write(u'\n ') + _tmp1 = econtext['F_']('Cancel') + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n \n

\n
') + return + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/master.pt' +registry[('buttons', False, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/admin/models.pt.py b/pyramid_formalchemy/templates/admin/models.pt.py new file mode 100644 index 0000000..7f906d3 --- /dev/null +++ b/pyramid_formalchemy/templates/admin/models.pt.py @@ -0,0 +1,113 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4349176784 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4349176912 = _loads('(dp1\n.') + _attrs_4349177040 = _loads('(dp1\n.') + _attrs_4349177168 = _loads('(dp1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u"main.macros['master']" + _metal = _lookup_attr(econtext['main'], 'macros')['master'] + def _callback_main(econtext, _repeat, _out=_out, _write=_write, _domain=_domain, **_ignored): + if _repeat: + repeat.update(_repeat) + attrs = _attrs_4349176784 + u'models' + _write(u'
\n ') + _tmp1 = econtext['models'] + item = None + (_tmp1, _tmp2, ) = repeat.insert('item', _tmp1) + for item in _tmp1: + _tmp2 = (_tmp2 - 1) + attrs = _attrs_4349176912 + _write(u'
\n ') + attrs = _attrs_4349177040 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'item' + _content = item + attrs = _attrs_4349177168 + u'request.route_url(request.route_name, traverse=item)' + _write(u'' in _tmp3): + _tmp3 = _tmp3.replace('>', '>') + if ('"' in _tmp3): + _tmp3 = _tmp3.replace('"', '"') + _write(((' href="' + _tmp3) + '"')) + u'_content' + _write('>') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n
\n
') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n
\n') + u"{'main': _callback_main}" + _tmp = {'main': _callback_main, } + u"main.macros['master']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/models.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/admin/new.pt.py b/pyramid_formalchemy/templates/admin/new.pt.py new file mode 100644 index 0000000..d2eb7ba --- /dev/null +++ b/pyramid_formalchemy/templates/admin/new.pt.py @@ -0,0 +1,178 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4356615376 = _loads('(dp1\nVhref\np2\nV#\nsVclass\np3\nVui-widget-header ui-widget-link ui-widget-button ui-corner-all\np4\ns.') + _attrs_4356594192 = _loads('(dp1\n.') + _attrs_4356613392 = _loads('(dp1\nVclass\np2\nVui-widget-header ui-widget-link ui-corner-all\np3\ns.') + _attrs_4355158224 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4355158672 = _loads('(dp1\nVmethod\np2\nVPOST\np3\nsVenctype\np4\nVmultipart/form-data\np5\ns.') + _attrs_4356612688 = _loads("(dp1\nVtype\np2\nVsubmit\np3\nsVvalue\np4\nV${F_('Save')}\np5\ns.") + _attrs_4356595088 = _loads('(dp1\nVclass\np2\nVfa_field\np3\ns.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4356612624 = _loads('(dp1\nVclass\np2\nVui-icon ui-icon-circle-arrow-w\np3\ns.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u"main.macros['master']" + _metal = _lookup_attr(econtext['main'], 'macros')['master'] + def _callback_main(econtext, _repeat, _out=_out, _write=_write, _domain=_domain, **_ignored): + if _repeat: + repeat.update(_repeat) + attrs = _attrs_4355158224 + _write(u'
\n ') + attrs = _attrs_4355158672 + u'request.route_url(request.route_name, traverse=request.model_name)' + _write(u'
' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' action="' + _tmp1) + '"')) + u"''" + _write(u'>\n ') + _default.value = default = '' + u'fs.render()' + _content = _lookup_attr(econtext['fs'], 'render')() + attrs = _attrs_4356594192 + u'_content' + _write(u'
') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
\n ') + attrs = _attrs_4356595088 + _write(u'

\n ') + attrs = _attrs_4356615376 + _write(u'\n ') + attrs = _attrs_4356612688 + 'join(value("F_(\'Save\')"),)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' value="' + _tmp1) + '"')) + _write(u' />\n \n ') + attrs = _attrs_4356613392 + u'request.route_url(request.route_name, traverse=request.model_name)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u'>\n ') + attrs = _attrs_4356612624 + u"F_('Cancel')" + _write(u'\n ') + _tmp1 = econtext['F_']('Cancel') + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n \n

\n
\n
\n') + u"{'main': _callback_main}" + _tmp = {'main': _callback_main, } + u"main.macros['master']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/new.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/admin/restfieldset.pt b/pyramid_formalchemy/templates/admin/restfieldset.pt deleted file mode 100644 index 470fd36..0000000 --- a/pyramid_formalchemy/templates/admin/restfieldset.pt +++ /dev/null @@ -1,96 +0,0 @@ -{{if template_engine == 'mako'}} -# -*- coding: utf-8 -*- -<%! -from formalchemy.ext.pylons.controller import model_url -from pylons import url -%> -<%def name="h1(title, href=None)"> -

- %if breadcrumb: - - %endif - %if href: - ${title.title()} - %else: - ${title.title()} - %endif -

- -<%def name="buttons()"> -

- - - - - - ${F_('Cancel')} - -

- - - - - ${collection_name.title()} - - - - -
- %if isinstance(models, dict): -

${F_('Models')}

- %for name in sorted(models): -

- ${name} -

- %endfor - %elif is_grid: - ${h1(model_name)} -
- ${pager|n} -
- - ${fs.render()|n} -
-

- - - ${F_('New')} ${model_name} - -

- %else: - ${h1(model_name, href=model_url(collection_name))} - %if action == 'show': - - ${fs.render()|n} -
-

- - - ${F_('Edit')} - -

- %elif action == 'edit': -
- ${fs.render()|n} - - ${buttons()} -
- %else: -
- ${fs.render()|n} - ${buttons()} -
- %endif - %endif -
- - -{{endif}} - diff --git a/pyramid_formalchemy/templates/admin/show.pt.py b/pyramid_formalchemy/templates/admin/show.pt.py new file mode 100644 index 0000000..f98755e --- /dev/null +++ b/pyramid_formalchemy/templates/admin/show.pt.py @@ -0,0 +1,71 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4357103760 = _loads('(dp1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4357103888 = _loads('(dp1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u"main.macros['master']" + _metal = _lookup_attr(econtext['main'], 'macros')['master'] + def _callback_main(econtext, _repeat, _out=_out, _write=_write, _domain=_domain, **_ignored): + if _repeat: + repeat.update(_repeat) + attrs = _attrs_4357103760 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'fs.render()' + _content = _lookup_attr(econtext['fs'], 'render')() + attrs = _attrs_4357103888 + u'_content' + _write(u'
') + _tmp1 = _content + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + u"main.macros['buttons']" + _write(u'
\n ') + _metal = _lookup_attr(econtext['main'], 'macros')['buttons'] + u'{}' + _tmp = {} + u"main.macros['buttons']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + _write(u'\n
\n') + u"{'main': _callback_main}" + _tmp = {'main': _callback_main, } + u"main.macros['master']" + _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext) + return _out.getvalue() + return render + +__filename__ = u'/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/admin/show.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/forms/fieldset.pt b/pyramid_formalchemy/templates/forms/fieldset.pt new file mode 100644 index 0000000..e31ddee --- /dev/null +++ b/pyramid_formalchemy/templates/forms/fieldset.pt @@ -0,0 +1,31 @@ + +
+
+
+ + +
+
+
+ +
+
+
+
+
+
+
+
+ + + diff --git a/pyramid_formalchemy/templates/forms/fieldset.pt.py b/pyramid_formalchemy/templates/forms/fieldset.pt.py new file mode 100644 index 0000000..44bc54e --- /dev/null +++ b/pyramid_formalchemy/templates/forms/fieldset.pt.py @@ -0,0 +1,367 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _attrs_4301975440 = _loads('(dp1\nVclass\np2\nVfield_input\np3\ns.') + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4301975312 = _loads('(dp1\nVclass\np2\nVui-state-error ui-corner-all\np3\ns.') + _attrs_4301975504 = _loads('(dp1\n.') + _attrs_4301974800 = _loads('(dp1\n.') + _attrs_4301975120 = _loads('(dp1\nVclass\np2\nVfa_instructions ui-corner-all\np3\ns.') + _attrs_4301975248 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4301975056 = _loads('(dp1\nVclass\np2\nVlabel\np3\ns.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4301974992 = _loads('(dp1\n.') + _attrs_4301974544 = _loads('(dp1\n.') + _attrs_4301974928 = _loads('(dp1\nVclass\np2\nVfa_field ui-widget\np3\ns.') + _attrs_4301975184 = _loads('(dp1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + u'False' + focus_rendered = False + u'fieldset.errors.get(None, False)' + _write(u'\n') + _tmp1 = _lookup_attr(_lookup_attr(econtext['fieldset'], 'errors'), 'get')(None, False) + if _tmp1: + pass + attrs = _attrs_4301974544 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'fieldset.error.get(None)' + _tmp1 = _lookup_attr(_lookup_attr(econtext['fieldset'], 'error'), 'get')(None) + error = None + (_tmp1, _tmp2, ) = repeat.insert('error', _tmp1) + for error in _tmp1: + _tmp2 = (_tmp2 - 1) + u'error' + _content = error + attrs = _attrs_4301974800 + u'_content' + _write(u'
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n
') + u'fieldset.render_fields.itervalues()' + _write(u'\n\n') + _tmp1 = _lookup_attr(_lookup_attr(econtext['fieldset'], 'render_fields'), 'itervalues')() + field = None + (_tmp1, _tmp2, ) = repeat.insert('field', _tmp1) + for field in _tmp1: + _tmp2 = (_tmp2 - 1) + _write(u'\n ') + attrs = _attrs_4301974928 + u'field.requires_label' + _write(u'
\n ') + _tmp3 = _lookup_attr(field, 'requires_label') + if _tmp3: + pass + attrs = _attrs_4301975056 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'isinstance(field.type, fatypes.Boolean)' + _tmp3 = isinstance(_lookup_attr(field, 'type'), _lookup_attr(econtext['fatypes'], 'Boolean')) + if _tmp3: + pass + u'field.render()' + _content = _lookup_attr(field, 'render')() + attrs = _attrs_4301975184 + u'_content' + _write(u'
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
') + _write(u'\n ') + attrs = _attrs_4301975248 + u"field.is_required() and 'field_req' or 'field_opt'" + _write(u'' in _tmp3): + _tmp3 = _tmp3.replace('>', '>') + if ('"' in _tmp3): + _tmp3 = _tmp3.replace('"', '"') + _write(((' class="' + _tmp3) + '"')) + u'field.renderer.name' + _tmp3 = _lookup_attr(_lookup_attr(field, 'renderer'), 'name') + if (_tmp3 is _default): + _tmp3 = None + if ((_tmp3 is not None) and (_tmp3 is not False)): + if (_tmp3.__class__ not in (str, unicode, int, float, )): + _tmp3 = unicode(_translate(_tmp3, domain=_domain, mapping=None, target_language=target_language, default=None)) + else: + if not isinstance(_tmp3, unicode): + _tmp3 = str(_tmp3) + if ('&' in _tmp3): + if (';' in _tmp3): + _tmp3 = _re_amp.sub('&', _tmp3) + else: + _tmp3 = _tmp3.replace('&', '&') + if ('<' in _tmp3): + _tmp3 = _tmp3.replace('<', '<') + if ('>' in _tmp3): + _tmp3 = _tmp3.replace('>', '>') + if ('"' in _tmp3): + _tmp3 = _tmp3.replace('"', '"') + _write(((' for="' + _tmp3) + '"')) + u"''" + _write(u'>\n ') + _default.value = default = '' + u'[field.label_text, fieldset.prettify(field.key)][int(field.label_text is None)]' + _content = [_lookup_attr(field, 'label_text'), _lookup_attr(econtext['fieldset'], 'prettify')(_lookup_attr(field, 'key')), ][int((_lookup_attr(field, 'label_text') is None))] + u'_content' + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'\n \n
') + u"u'\\n '" + _write(u'\n ') + _default.value = default = u'\n ' + u"'instructions' in field.metadata" + _tmp3 = ('instructions' in _lookup_attr(field, 'metadata')) + if _tmp3: + pass + u"field.metadata['instructions']" + _content = _lookup_attr(field, 'metadata')['instructions'] + attrs = _attrs_4301975120 + u'_content' + _write(u'
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
') + u'field.errors' + _write(u'\n ') + _tmp3 = _lookup_attr(field, 'errors') + if _tmp3: + pass + attrs = _attrs_4301975312 + u"''" + _write(u'
\n ') + _default.value = default = '' + u'field.errors' + _tmp3 = _lookup_attr(field, 'errors') + error = None + (_tmp3, _tmp4, ) = repeat.insert('error', _tmp3) + for error in _tmp3: + _tmp4 = (_tmp4 - 1) + u'error' + _content = error + attrs = _attrs_4301975504 + u'_content' + _write(u'
') + _tmp5 = _content + _tmp = _tmp5 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
') + if (_tmp4 == 0): + break + _write(' ') + _write(u'\n
') + u"''" + _write(u'\n ') + _default.value = default = '' + u'not isinstance(field.type, fatypes.Boolean)' + _tmp3 = not isinstance(_lookup_attr(field, 'type'), _lookup_attr(econtext['fatypes'], 'Boolean')) + if _tmp3: + pass + u'field.render()' + _content = _lookup_attr(field, 'render')() + attrs = _attrs_4301975440 + u'_content' + _write(u'
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
') + u'not field.is_readonly() and (fieldset.focus == field or fieldset.focus is True) and not focus_rendered' + _write(u'\n
\n ') + _tmp3 = (not _lookup_attr(field, 'is_readonly')() and ((_lookup_attr(econtext['fieldset'], 'focus') == field) or (_lookup_attr(econtext['fieldset'], 'focus') is True)) and not focus_rendered) + if _tmp3: + pass + attrs = _attrs_4301974992 + u'True' + _write(u'') + _write(u'\n') + if (_tmp2 == 0): + break + _write(' ') + _write(u'') + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/fa.jquery/fa/jquery/templates/forms/fieldset.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/forms/fieldset_readonly.pt b/pyramid_formalchemy/templates/forms/fieldset_readonly.pt new file mode 100644 index 0000000..a667251 --- /dev/null +++ b/pyramid_formalchemy/templates/forms/fieldset_readonly.pt @@ -0,0 +1,17 @@ + + + + + +   + +
+ + + + diff --git a/pyramid_formalchemy/templates/forms/fieldset_readonly.pt.py b/pyramid_formalchemy/templates/forms/fieldset_readonly.pt.py new file mode 100644 index 0000000..bc3667f --- /dev/null +++ b/pyramid_formalchemy/templates/forms/fieldset_readonly.pt.py @@ -0,0 +1,156 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _attrs_4354113680 = _loads('(dp1\n.') + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4354096784 = _loads('(dp1\n.') + _attrs_4354113616 = _loads('(dp1\nVclass\np2\nVfield_readonly\np3\ns.') + _attrs_4354096976 = _loads('(dp1\nVstyle\np2\nVdisplay:none\np3\ns.') + _attrs_4354113744 = _loads('(dp1\n.') + _attrs_4354113808 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4354097040 = _loads('(dp1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4354113872 = _loads('(dp1\n.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + attrs = _attrs_4354096784 + u'fieldset.render_fields.itervalues()' + _write(u'\n ') + _tmp1 = _lookup_attr(_lookup_attr(econtext['fieldset'], 'render_fields'), 'itervalues')() + field = None + (_tmp1, _tmp2, ) = repeat.insert('field', _tmp1) + for field in _tmp1: + _tmp2 = (_tmp2 - 1) + u'field.requires_label' + _write(u'') + _tmp3 = _lookup_attr(field, 'requires_label') + if _tmp3: + pass + attrs = _attrs_4354097040 + _write(u'\n ') + attrs = _attrs_4354113616 + u"''" + _write(u'\n ') + _default.value = default = '' + u'[field.label_text, fieldset.prettify(field.key)][int(field.label_text is None)]' + _content = [_lookup_attr(field, 'label_text'), _lookup_attr(econtext['fieldset'], 'prettify')(_lookup_attr(field, 'key')), ][int((_lookup_attr(field, 'label_text') is None))] + attrs = _attrs_4354113744 + u'_content' + _write(u'\n \n ') + _default.value = default = '' + u'field.render_readonly()' + _content = _lookup_attr(field, 'render_readonly')() + attrs = _attrs_4354113680 + u'_content' + _write(u'') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'\n ') + _write(u'\n ') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n ') + attrs = _attrs_4354096976 + _write(u'') + attrs = _attrs_4354113808 + _write(u' ') + attrs = _attrs_4354113872 + u'fieldset.render_fields.itervalues()' + _write(u'\n ') + _tmp1 = _lookup_attr(_lookup_attr(econtext['fieldset'], 'render_fields'), 'itervalues')() + field = None + (_tmp1, _tmp2, ) = repeat.insert('field', _tmp1) + for field in _tmp1: + _tmp2 = (_tmp2 - 1) + u"''" + _write(u'') + _default.value = default = '' + u'not field.requires_label' + _tmp3 = not _lookup_attr(field, 'requires_label') + if _tmp3: + pass + u'field.render_readonly()' + _content = _lookup_attr(field, 'render_readonly')() + u'_content' + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'\n ') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n \n \n') + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/forms/fieldset_readonly.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/forms/grid.pt b/pyramid_formalchemy/templates/forms/grid.pt new file mode 100644 index 0000000..40abb88 --- /dev/null +++ b/pyramid_formalchemy/templates/forms/grid.pt @@ -0,0 +1,21 @@ + + + + + + + + + + + + + +
+
+
${error}
+
+ diff --git a/pyramid_formalchemy/templates/forms/grid.pt.py b/pyramid_formalchemy/templates/forms/grid.pt.py new file mode 100644 index 0000000..53ced90 --- /dev/null +++ b/pyramid_formalchemy/templates/forms/grid.pt.py @@ -0,0 +1,198 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _attrs_4349827536 = _loads('(dp1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _attrs_4349879568 = _loads('(dp1\nVclass\np2\nVlayout-grid\np3\ns.') + _attrs_4349825872 = _loads('(dp1\nVclass\np2\nVgrid_error\np3\ns.') + _attrs_4349881488 = _loads('(dp1\n.') + _attrs_4349879888 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4349880336 = _loads('(dp1\n.') + _attrs_4349879504 = _loads('(dp1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4349879952 = _loads('(dp1\nVclass\np2\nVui-widget-header\np3\ns.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + attrs = _attrs_4349879568 + _write(u'\n') + attrs = _attrs_4349880336 + _write(u'\n ') + attrs = _attrs_4349879952 + u"''" + _write(u'\n ') + _default.value = default = '' + u'collection.render_fields.itervalues()' + _tmp1 = _lookup_attr(_lookup_attr(econtext['collection'], 'render_fields'), 'itervalues')() + field = None + (_tmp1, _tmp2, ) = repeat.insert('field', _tmp1) + for field in _tmp1: + _tmp2 = (_tmp2 - 1) + u'field.label_text or collection.prettify(field.key)' + _content = (_lookup_attr(field, 'label_text') or _lookup_attr(econtext['collection'], 'prettify')(_lookup_attr(field, 'key'))) + attrs = _attrs_4349879504 + u'_content' + _write(u'') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n \n\n') + attrs = _attrs_4349881488 + u'collection.rows' + _write(u'\n ') + _tmp1 = _lookup_attr(econtext['collection'], 'rows') + row = None + (_tmp1, _tmp2, ) = repeat.insert('row', _tmp1) + for row in _tmp1: + _tmp2 = (_tmp2 - 1) + u'collection._set_active(row)' + _write(u'') + dummy = _lookup_attr(econtext['collection'], '_set_active')(row) + u'collection.get_errors(row)' + row_errors = _lookup_attr(econtext['collection'], 'get_errors')(row) + attrs = _attrs_4349879888 + u"ui-widget-${repeat.row.even and 'even' or 'odd'}" + _write(u'' in _tmp3): + _tmp3 = _tmp3.replace('>', '>') + if ('"' in _tmp3): + _tmp3 = _tmp3.replace('"', '"') + _write(((' class="' + _tmp3) + '"')) + u'collection.render_fields.itervalues()' + _write(u'>\n ') + _tmp3 = _lookup_attr(_lookup_attr(econtext['collection'], 'render_fields'), 'itervalues')() + field = None + (_tmp3, _tmp4, ) = repeat.insert('field', _tmp3) + for field in _tmp3: + _tmp4 = (_tmp4 - 1) + attrs = _attrs_4349827536 + u"''" + _write(u'') + if (_tmp4 == 0): + break + _write(' ') + _write(u'\n \n ') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n\n
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
\n ') + _default.value = default = '' + u'field.render()' + _content = _lookup_attr(field, 'render')() + u'_content' + _tmp5 = _content + _tmp = _tmp5 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + u'row_errors.get(field, [])' + _write(u'\n ') + _tmp5 = _lookup_attr(row_errors, 'get')(field, []) + error = None + (_tmp5, _tmp6, ) = repeat.insert('error', _tmp5) + for error in _tmp5: + _tmp6 = (_tmp6 - 1) + attrs = _attrs_4349825872 + u'error' + _write(u'
') + _tmp7 = error + _tmp = _tmp7 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
') + if (_tmp6 == 0): + break + _write(' ') + _write(u'\n
') + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/forms/grid.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/templates/forms/grid_readonly.pt b/pyramid_formalchemy/templates/forms/grid_readonly.pt new file mode 100644 index 0000000..911966f --- /dev/null +++ b/pyramid_formalchemy/templates/forms/grid_readonly.pt @@ -0,0 +1,17 @@ + + + + + + + + + + + + +
+
+ diff --git a/pyramid_formalchemy/templates/forms/grid_readonly.pt.py b/pyramid_formalchemy/templates/forms/grid_readonly.pt.py new file mode 100644 index 0000000..a0f8e49 --- /dev/null +++ b/pyramid_formalchemy/templates/forms/grid_readonly.pt.py @@ -0,0 +1,157 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _attrs_4354016912 = _loads('(dp1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4354017296 = _loads('(dp1\n.') + _attrs_4354016720 = _loads('(dp1\n.') + _attrs_4354017104 = _loads('(dp1\n.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4354016656 = _loads('(dp1\n.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4354016400 = _loads('(dp1\n.') + _attrs_4354016784 = _loads('(dp1\nVclass\np2\nVui-widget-header\np3\ns.') + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + attrs = _attrs_4354016400 + _write(u'\n ') + attrs = _attrs_4354016656 + _write(u'\n ') + attrs = _attrs_4354016784 + u"''" + _write(u'\n ') + _default.value = default = '' + u'collection.render_fields.itervalues()' + _tmp1 = _lookup_attr(_lookup_attr(econtext['collection'], 'render_fields'), 'itervalues')() + field = None + (_tmp1, _tmp2, ) = repeat.insert('field', _tmp1) + for field in _tmp1: + _tmp2 = (_tmp2 - 1) + u'field.label_text or collection.prettify(field.key)' + _content = (_lookup_attr(field, 'label_text') or _lookup_attr(econtext['collection'], 'prettify')(_lookup_attr(field, 'key'))) + attrs = _attrs_4354016912 + u'_content' + _write(u'') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n \n \n ') + attrs = _attrs_4354016720 + u'collection.rows' + _write(u'\n ') + _tmp1 = _lookup_attr(econtext['collection'], 'rows') + row = None + (_tmp1, _tmp2, ) = repeat.insert('row', _tmp1) + for row in _tmp1: + _tmp2 = (_tmp2 - 1) + u'collection._set_active(row)' + _write(u'') + dummy = _lookup_attr(econtext['collection'], '_set_active')(row) + attrs = _attrs_4354017104 + u"ui-widget-${repeat.row.even and 'even' or 'odd'}" + _write(u'' in _tmp3): + _tmp3 = _tmp3.replace('>', '>') + if ('"' in _tmp3): + _tmp3 = _tmp3.replace('"', '"') + _write(((' class="' + _tmp3) + '"')) + u"''" + _write(u'>\n ') + _default.value = default = '' + u'collection.render_fields.itervalues()' + _tmp3 = _lookup_attr(_lookup_attr(econtext['collection'], 'render_fields'), 'itervalues')() + field = None + (_tmp3, _tmp4, ) = repeat.insert('field', _tmp3) + for field in _tmp3: + _tmp4 = (_tmp4 - 1) + u'field.render_readonly()' + _content = _lookup_attr(field, 'render_readonly')() + attrs = _attrs_4354017296 + u'_content' + _write(u'') + if (_tmp4 == 0): + break + _write(' ') + _write(u'\n \n ') + if (_tmp2 == 0): + break + _write(' ') + _write(u'\n \n
') + _tmp3 = _content + _tmp = _tmp3 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u'
') + _tmp5 = _content + _tmp = _tmp5 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + _write(_tmp) + _write(u'
') + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramid_formalchemy/templates/forms/grid_readonly.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramid_formalchemy/utils.py b/pyramid_formalchemy/utils.py index b1f01c1..7fbfca6 100644 --- a/pyramid_formalchemy/utils.py +++ b/pyramid_formalchemy/utils.py @@ -16,7 +16,7 @@ class TemplateEngine(BaseTemplateEngine): name = name.strip('/') if not name.endswith('.pt'): name = '%s.pt' % name - renderer = 'fa.jquery:templates/forms/%s' % name + renderer = 'pyramid_formalchemy:templates/forms/%s' % name kwargs.update(dict( fatypes=fatypes, )) diff --git a/pyramid_formalchemy/views.py b/pyramid_formalchemy/views.py index a892c30..306e2ea 100644 --- a/pyramid_formalchemy/views.py +++ b/pyramid_formalchemy/views.py @@ -14,6 +14,7 @@ from pyramid.renderers import get_renderer from pyramid.response import Response from pyramid import httpexceptions as exc from pyramid.exceptions import NotFound +from pyramid_formalchemy.utils import TemplateEngine try: from formalchemy.ext.couchdb import Document @@ -39,7 +40,7 @@ class Session(object): class ModelView(object): """A RESTful view bound to a model""" - engine = prefix_name = None + engine = TemplateEngine() pager_args = dict(link_attr={'class': 'ui-pager-link ui-state-default ui-corner-all'}, curpage_attr={'class': 'ui-pager-curpage ui-state-highlight ui-corner-all'}) diff --git a/pyramidapp/pyramidapp/forms.py b/pyramidapp/pyramidapp/forms.py index 633f866..3a38bf9 100644 --- a/pyramidapp/pyramidapp/forms.py +++ b/pyramidapp/pyramidapp/forms.py @@ -1,2 +1,12 @@ # -*- coding: utf-8 -*- +from pyramid_formalchemy.utils import TemplateEngine +from pyramidapp import models +from formalchemy import Grid, FieldSet +from formalchemy import config + +config.engine = TemplateEngine() + +MyModel = FieldSet(models.MyModel) + +GridMyModel = Grid(models.MyModel) diff --git a/pyramidapp/pyramidapp/templates/mytemplate.pt.py b/pyramidapp/pyramidapp/templates/mytemplate.pt.py new file mode 100644 index 0000000..f07cd3c --- /dev/null +++ b/pyramidapp/pyramidapp/templates/mytemplate.pt.py @@ -0,0 +1,298 @@ +registry = dict(version=0) +def bind(): + from cPickle import loads as _loads + _lookup_attr = _loads('cchameleon.core.codegen\nlookup_attr\np1\n.') + _attrs_4356044944 = _loads('(dp1\n.') + _attrs_4356017808 = _loads('(dp1\n.') + _re_amp = _loads("cre\n_compile\np1\n(S'&(?!([A-Za-z]+|#[0-9]+);)'\np2\nI0\ntRp3\n.") + _attrs_4356015888 = _loads('(dp1\n.') + _attrs_4356045392 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#sample-applications\np3\ns.') + _attrs_4356044880 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#tutorials\np3\ns.') + _attrs_4356045712 = _loads('(dp1\n.') + _attrs_4356043152 = _loads('(dp1\nVid\np2\nVright\np3\nsVclass\np4\nValign-left\np5\ns.') + _init_stream = _loads('cchameleon.core.generation\ninitialize_stream\np1\n.') + _attrs_4356045136 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#change-history\np3\ns.') + _attrs_4356045456 = _loads('(dp1\n.') + _attrs_4356044624 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#api-documentation\np3\ns.') + _attrs_4356017680 = _loads('(dp1\nVclass\np2\nVapp-name\np3\ns.') + _attrs_4356017360 = _loads('(dp1\nVid\np2\nVbottom\np3\ns.') + _attrs_4356016080 = _loads('(dp1\nVcontent\np2\nVpyramid web application\np3\nsVname\np4\nVdescription\np5\ns.') + _attrs_4356016272 = _loads('(dp1\nVmedia\np2\nVscreen\np3\nsVcharset\np4\nVutf-8\np5\nsVhref\np6\nVhttp://fonts.googleapis.com/css?family=Neuton&subset=latin\np7\nsVrel\np8\nVstylesheet\np9\nsVtype\np10\nVtext/css\np11\ns.') + _attrs_4356045200 = _loads('(dp1\n.') + _attrs_4356043280 = _loads('(dp1\nVname\np2\nVq\nsVvalue\np3\nV\nsVtype\np4\nVtext\np5\nsVid\np6\nVq\ns.') + _attrs_4356017296 = _loads('(dp1\nVclass\np2\nVmiddle align-center\np3\ns.') + _attrs_4356016144 = _loads("(dp1\nVhref\np2\nV${request.static_url('pyramidapp:static/favicon.ico')}\np3\nsVrel\np4\nVshortcut icon\np5\ns.") + _attrs_4356043920 = _loads('(dp1\n.') + _attrs_4356016848 = _loads('(dp1\nVid\np2\nVmiddle\np3\ns.') + _attrs_4356017936 = _loads('(dp1\nVclass\np2\nVbottom\np3\ns.') + _attrs_4356015504 = _loads('(dp1\n.') + _attrs_4356043408 = _loads('(dp1\nVtype\np2\nVsubmit\np3\nsVid\np4\nVx\nsVvalue\np5\nVGo\np6\ns.') + _init_default = _loads('cchameleon.core.generation\ninitialize_default\np1\n.') + _attrs_4356017488 = _loads('(dp1\nVclass\np2\nVapp-welcome\np3\ns.') + _attrs_4356017168 = _loads("(dp1\nVsrc\np2\nV${request.static_url('pyramidapp:static/pyramid.png')}\np3\nsVheight\np4\nV169\np5\nsVwidth\np6\nV750\np7\nsValt\np8\nVpyramid\np9\ns.") + _init_tal = _loads('cchameleon.core.generation\ninitialize_tal\np1\n.') + _attrs_4356016784 = _loads('(dp1\nVclass\np2\nVtop align-center\np3\ns.') + _attrs_4356045904 = _loads('(dp1\nVhref\np2\nVirc://irc.freenode.net#pyramid\np3\ns.') + _attrs_4356043088 = _loads('(dp1\nVaction\np2\nVhttp://docs.pylonshq.com/pyramid/dev/search.html\np3\nsVmethod\np4\nVget\np5\ns.') + _attrs_4356044112 = _loads('(dp1\nVhref\np2\nVhttp://pylonshq.com\np3\ns.') + _attrs_4356043600 = _loads('(dp1\n.') + _attrs_4356045648 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#support-and-development\np3\ns.') + _attrs_4356043728 = _loads('(dp1\nVclass\np2\nVlinks\np3\ns.') + _attrs_4356018128 = _loads('(dp1\nVid\np2\nVleft\np3\nsVclass\np4\nValign-right\np5\ns.') + _attrs_4356017552 = _loads('(dp1\nVid\np2\nVfooter\np3\ns.') + _attrs_4356044176 = _loads('(dp1\n.') + _attrs_4356044432 = _loads('(dp1\n.') + _attrs_4356016336 = _loads('(dp1\nVmedia\np2\nVscreen\np3\nsVcharset\np4\nVutf-8\np5\nsVhref\np6\nVhttp://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic&subset=latin\np7\nsVrel\np8\nVstylesheet\np9\nsVtype\np10\nVtext/css\np11\ns.') + _attrs_4356015952 = _loads('(dp1\nVcontent\np2\nVtext/html;charset=UTF-8\np3\nsVhttp-equiv\np4\nVContent-Type\np5\ns.') + _attrs_4356042960 = _loads('(dp1\n.') + _attrs_4356016528 = _loads('(dp1\nVid\np2\nVwrap\np3\ns.') + _attrs_4356015696 = _loads('(dp1\n.') + _init_scope = _loads('cchameleon.core.utils\necontext\np1\n.') + _attrs_4356016208 = _loads("(dp1\nVmedia\np2\nVscreen\np3\nsVcharset\np4\nVutf-8\np5\nsVhref\np6\nV${request.static_url('pyramidapp:static/pylons.css')}\np7\nsVrel\np8\nVstylesheet\np9\nsVtype\np10\nVtext/css\np11\ns.") + _attrs_4356044368 = _loads('(dp1\nVhref\np2\nVhttp://docs.pylonshq.com/pyramid/dev/#narrative-documentation\np3\ns.') + _attrs_4356044688 = _loads('(dp1\n.') + _attrs_4356016656 = _loads('(dp1\nVid\np2\nVtop\np3\ns.') + _attrs_4356015760 = _loads('(dp1\nVxmlns\np2\nVhttp://www.w3.org/1999/xhtml\np3\nsVxml:lang\np4\nVen\np5\ns.') + _attrs_4356043792 = _loads('(dp1\nVclass\np2\nVfooter\np3\ns.') + _attrs_4356016016 = _loads('(dp1\nVcontent\np2\nVpython web application\np3\nsVname\np4\nVkeywords\np5\ns.') + _attrs_4356016976 = _loads('(dp1\n.') + def render(econtext, rcontext=None): + macros = econtext.get('macros') + _translate = econtext.get('_translate') + _slots = econtext.get('_slots') + target_language = econtext.get('target_language') + u'_init_stream()' + (_out, _write, ) = _init_stream() + u'_init_tal()' + (_attributes, repeat, ) = _init_tal() + u'_init_default()' + _default = _init_default() + u'None' + default = None + u'None' + _domain = None + _write('\n') + attrs = _attrs_4356015760 + _write(u'\n') + attrs = _attrs_4356015696 + _write(u'\n\t') + attrs = _attrs_4356015504 + _write(u'The Pyramid Web Application Development Framework\n\t') + attrs = _attrs_4356015952 + _write(u'\n\t') + attrs = _attrs_4356016016 + _write(u'\n\t') + attrs = _attrs_4356016080 + _write(u'\n\t') + attrs = _attrs_4356016144 + 'join(value("request.static_url(\'pyramidapp:static/favicon.ico\')"),)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u' />\n\t') + attrs = _attrs_4356016208 + 'join(value("request.static_url(\'pyramidapp:static/pylons.css\')"),)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' href="' + _tmp1) + '"')) + _write(u' type="text/css" media="screen" charset="utf-8" />\n\t') + attrs = _attrs_4356016272 + _write(u'\n\t') + attrs = _attrs_4356016336 + u"request.static_url('pyramidapp:static/ie6.css')" + _write(u'\n\t\n\n') + attrs = _attrs_4356015888 + _write(u'\n\t') + attrs = _attrs_4356016528 + _write(u'
\n\t\t') + attrs = _attrs_4356016656 + _write(u'
\n\t\t\t') + attrs = _attrs_4356016784 + _write(u'
\n\t\t\t\t') + attrs = _attrs_4356016976 + _write(u'
') + attrs = _attrs_4356017168 + 'join(value("request.static_url(\'pyramidapp:static/pyramid.png\')"),)' + _write(u'' in _tmp1): + _tmp1 = _tmp1.replace('>', '>') + if ('"' in _tmp1): + _tmp1 = _tmp1.replace('"', '"') + _write(((' src="' + _tmp1) + '"')) + _write(u' width="750" height="169" alt="pyramid" />
\n\t\t\t
\n\t\t
\n\t\t') + attrs = _attrs_4356016848 + _write(u'
\n\t\t\t') + attrs = _attrs_4356017296 + _write(u'
\n\t\t\t\t') + attrs = _attrs_4356017488 + _write(u'

\n\t\t\t\t\tWelcome to ') + attrs = _attrs_4356017680 + u'project' + _write(u'') + _tmp1 = econtext['project'] + _tmp = _tmp1 + if (_tmp.__class__ not in (str, unicode, int, float, )): + try: + _tmp = _tmp.__html__ + except: + _tmp = _translate(_tmp, domain=_domain, mapping=None, target_language=target_language, default=None) + else: + _tmp = _tmp() + _write(_tmp) + _tmp = None + if (_tmp is not None): + if not isinstance(_tmp, unicode): + _tmp = str(_tmp) + if ('&' in _tmp): + if (';' in _tmp): + _tmp = _re_amp.sub('&', _tmp) + else: + _tmp = _tmp.replace('&', '&') + if ('<' in _tmp): + _tmp = _tmp.replace('<', '<') + if ('>' in _tmp): + _tmp = _tmp.replace('>', '>') + _write(_tmp) + _write(u', an application generated by') + attrs = _attrs_4356017808 + _write(u'
\n\t\t\t\t\tthe Pyramid web application development framework.\n\t\t\t\t

\n\t\t\t
\n\t\t
\n\t\t') + attrs = _attrs_4356017360 + _write(u'
\n\t\t\t') + attrs = _attrs_4356017936 + _write(u'
\n\t\t\t\t') + attrs = _attrs_4356018128 + _write(u'
\n\t\t\t\t\t') + attrs = _attrs_4356042960 + _write(u'

Search documentation

\n\t\t\t\t\t') + attrs = _attrs_4356043088 + _write(u'
\n\t\t \t\t\t') + attrs = _attrs_4356043280 + _write(u'\n\t\t \t\t\t') + attrs = _attrs_4356043408 + _write(u'\n\t\t \t\t\t
\n\t\t\t\t
\n\t\t\t\t') + attrs = _attrs_4356043152 + _write(u'\n\t\t\t
\n\t\t
\n\t
\n\t') + attrs = _attrs_4356017552 + _write(u'\n\n') + return _out.getvalue() + return render + +__filename__ = '/Users/gawel/py/formalchemy_project/pyramid_formalchemy/pyramidapp/pyramidapp/templates/mytemplate.pt' +registry[(None, True, '1488bdb950901f8f258549439ef6661a49aae984')] = bind() diff --git a/pyramidapp/pyramidapp/tests.py b/pyramidapp/pyramidapp/tests.py index 8fdba31..1175595 100644 --- a/pyramidapp/pyramidapp/tests.py +++ b/pyramidapp/pyramidapp/tests.py @@ -29,8 +29,10 @@ class TestController(unittest.TestCase): def tearDown(self): self.config.end() - def test_index(self): + resp = self.app.get('/') + + def test_crud(self): # index resp = self.app.get('/admin/') resp.mustcontain('/admin/Foo') diff --git a/pyramidapp/pyramidapp/views.py b/pyramidapp/pyramidapp/views.py index 906e586..c39cd34 100644 --- a/pyramidapp/pyramidapp/views.py +++ b/pyramidapp/pyramidapp/views.py @@ -1,7 +1,9 @@ from pyramidapp.models import DBSession from pyramidapp.models import MyModel +from pyramidapp import forms def my_view(request): dbsession = DBSession() root = dbsession.query(MyModel).filter(MyModel.name==u'root').first() + fs = forms.GridMyModel.bind([root]).render() return {'root':root, 'project':'pyramidapp'} diff --git a/setup.py b/setup.py index 5ed44a9..727c6b2 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,11 @@ here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() -requires = ['pyramid>=1.0', 'WebError', 'FormAlchemy'] +requires = ['pyramid>=1.0', 'WebError', 'FormAlchemy>=1.3.5'] setup(name='pyramid_formalchemy', - version='0.0', - description='pyramid_formalchemy', + version='0.1', + description='FormAlchemy plugins and helpers for Pyramid', long_description=README + '\n\n' + CHANGES, classifiers=[ "Programming Language :: Python", @@ -20,7 +20,7 @@ setup(name='pyramid_formalchemy', ], author='Gael Pasgrimaud', author_email='gael@gawel.org', - url='', + url='http://docs.formalchemy.org/pyramid_formalchemy/', keywords='web pyramid pylons formalchemy', packages=find_packages(exclude=['pyramidapp']), include_package_data=True,