Giter VIP home page Giter VIP logo

fa.jquery's Introduction

FormAlchemy eliminates boilerplate by autogenerating HTML input fields from a
given model. FormAlchemy will try to figure out what kind of HTML code should
be returned by introspecting the model's properties and generate ready-to-use
HTML code that will fit the developer's application.

Of course, FormAlchemy can't figure out everything, i.e, the developer might
want to display only a few columns from the given model. Thus, FormAlchemy is
also highly customizable.

Please visit the FormAlchemy's homepage for documentation and more information:

  http://docs.formalchemy.org/

You can subscribe to FormAlchemy's mailing list:

  http://groups.google.com/group/formalchemy

fa.jquery's People

Contributors

amleczko avatar bbinet avatar disko avatar do3cc avatar drnextgis avatar dvv avatar gawel avatar samuelchen avatar sbrunner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fa.jquery's Issues

Error while rendering empty record from db

I have one model (RelTag) with only two fields, both of which are nullable. When an empty record is being created through the fa.jquery /admin following error is produced when later trying to open this empty record for editing.

I am using:

  • pyramid 1.4
  • fa.jquery 0.9.5
  • pyramid-formalchemy 0.4.3
  • SQLAlchemy 0.7.6
    on Postgresql 8.4.

TypeError: coercing to Unicode: need string or buffer, NoneType found

  • Expression: "unicode(request.model_instance)"
  • Filename: ... uery-0.9.5-py2.6.egg/fa/jquery/templates/admin/master.pt
  • Location: (42:31)
  • Source: tal:replace="unicode(request.model_instance)"/>
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Arguments: fs: <FieldSet - at 0x4729d10>
    model_plural: RelTags
    actions: {...} (1)
    model_label: RelTag
    breadcrumb: <Actions - at 0x4a6d100>
    repeat: {...} (0)
    renderer_name: pyramid_formalchemy:templates/admin/edit.pt
    F_: <function translate at 0x4a701b8>
    id: 3
    req: <Request - at 0x4700650>
    renderer_info: <RendererHelper - at 0x428c610>
    request: <Request - at 0x4700650>
    context: <RelTagCustomModel_admin_edit_GET 3 at 0x4729310>
    model_class: <I18NModel RelTag at 0x4729590>
    main: <PageTemplateFile - at 0x471a5d0>
    model_name: RelTag
    view: <ModelView - at 0x4729510>

jQuery.fa.jqgrid is not a function javascript error in firefox 8.0

Hi Gael,
I Am using Shabti app, its using fa.jquery version 8.0.

The issue is when I click on link to get grid for users table record or any table, I Am getting error saying that jQuery.fa.jqgrid is not a function. This issue is only for latest firefox 8.0.

Thanks and Regard
Ataulla S H

In older versions of firefox its working fine.

attribute error when upgrading from 0.9.3 to 0.9.4

Hello,
I was doing some development on a project that user fa.jquery 0.9.3. I just now upgraded to 0.9.4 and now get the following error trace when I render a form:

form = tabs.render()
File "/Users/cswank/src/grcweb/lib/python2.7/site-packages/fa.jquery-0.9.4-py2.7.egg/fa/jquery/forms.py", line 177, in render
F_=get_translator(request=self._request),
File "/Users/cswank/src/grcweb/lib/python2.7/site-packages/fa.jquery-0.9.4-py2.7.egg/fa/jquery/forms.py", line 101, in getattr
raise AttributeError(attr)
AttributeError: _request

When I switch back to 0.9.3 the error goes away.

Craig

Exception with pyramid_handlers, url dispatch

An exception occures when trying to use fa.jquery with pyramid_handlers and url dispatch (haven't tried other setups..)

Somehow jqgrid.pt doesn't get the context and context.view variables.

Update:

Tried to change listing.pt to:

<div tal:content="structure fs.render(renderer='fa.jquery:templates/forms/jqgrid.pt', request=request, context=context, view=view)" />

This does not resolve the issue because 'collection' isn't set. Don't know what exactly it does.

URL: http://dev.myproject.de/admin/Publisher
File '/usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py', line 431 in respond
  app_iter = self.application(environ, detect_start_response)
File '/usr/local/lib/python2.6/dist-packages/repoze.tm2-1.0b1-py2.6.egg/repoze/tm/__init__.py', line 23 in __call__
  result = self.application(environ, save_status_and_headers)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/router.py', line 158 in __call__
  response = view_callable(context, request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/config.py', line 2617 in __call__
  return view(context, request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/config.py', line 2805 in attr_view
  return view(context, request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/config.py', line 2784 in predicate_wrapper
  return view(context, request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/config.py', line 2839 in _rendered_view
  context)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/renderers.py', line 294 in render_view
  request=request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/renderers.py', line 322 in render_to_response
  result = self.render(value, system_values, request=request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/renderers.py', line 318 in render
  result = renderer(value, system_values)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/chameleon_zpt.py', line 52 in __call__
  result = self.template(**system)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 104 in __call__
  return self.render(**kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 402 in render
  return super(TemplateFile, self).render(*args, **kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/zpt/template.py', line 17 in render
  return super(PageTemplate, self).render(*args, **kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 229 in render
  return self.cook_and_render(kwargs, utils.emptydict, None, True)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 382 in cook_and_render
  args, slots, macro, global_scope)
(,)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 217 in cook_and_render
  utils.raise_template_exception(kwargs, sys.exc_info())
File '/tmp/tmpmyUSaG/listing.pt.py', line 173 in render
  _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 428 in render
  return self.render(name, slots=slots, parameters=kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/zpt/template.py', line 22 in render_macro
  macro, global_scope=global_scope, slots=slots, parameters=parameters)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 239 in render_macro
  return self.cook_and_render(parameters, slots, macro, global_scope)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 382 in cook_and_render
  args, slots, macro, global_scope)
(,)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 217 in cook_and_render
  utils.raise_template_exception(kwargs, sys.exc_info())
File '/tmp/tmpmyUSaG/listing.pt.py', line 69 in _callback_main
  _content = _lookup_attr(econtext['fs'], 'render')(renderer='fa.jquery:templates/forms/jqgrid.pt', request=econtext['request'])
File '/usr/local/lib/python2.6/dist-packages/FormAlchemy-1.3.6-py2.6.egg/formalchemy/tables.py', line 102 in render
  return engine('grid_readonly', collection=self, **kwargs)
File '/usr/local/lib/python2.6/dist-packages/FormAlchemy-1.3.6-py2.6.egg/formalchemy/templates.py', line 66 in __call__
  return self.render(template_name, **kw)
File '/usr/local/lib/python2.6/dist-packages/pyramid_formalchemy-0.1-py2.6.egg/pyramid_formalchemy/utils.py', line 24 in render
  return literal(render(renderer, kwargs))
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/renderers.py', line 68 in render
  return helper.render(value, None, request=request)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/renderers.py', line 318 in render
  result = renderer(value, system_values)
File '/usr/local/lib/python2.6/dist-packages/pyramid-1.0-py2.6.egg/pyramid/chameleon_zpt.py', line 52 in __call__
  result = self.template(**system)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 104 in __call__
  return self.render(**kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 402 in render
  return super(TemplateFile, self).render(*args, **kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/zpt/template.py', line 17 in render
  return super(PageTemplate, self).render(*args, **kwargs)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 229 in render
  return self.cook_and_render(kwargs, utils.emptydict, None, True)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 382 in cook_and_render
  args, slots, macro, global_scope)
(,)
File '/usr/local/lib/python2.6/dist-packages/Chameleon-1.3.0_rc1-py2.6.egg/chameleon/core/template.py', line 217 in cook_and_render
  utils.raise_template_exception(kwargs, sys.exc_info())
File '/tmp/tmpJUgO5k/jqgrid.pt.py', line 34 in render
  colmodels = _lookup_attr(',', 'join')([_lookup_attr(_lookup_attr(f, 'metadata'), 'get')('json') for f in _lookup_attr(_lookup_attr(econtext['collection'], 'render_fields'), 'values')()])
RuntimeError: Caught exception rendering template.
 - Expression: ``main.macros['master']``
 - Filename:   /usr/local/lib/python2.6/dist-packages/fa.jquery-0.8-py2.6.egg/fa/jquery/templates/admin/listing.pt
 - Arguments:  fs: 
               renderer_name: pyramid_formalchemy:templates/admin/listing.pt
               context: 
               xincludes: 
               request: 
               tmpl_context: 
               F_: 
               renderer_info: 
               session: 
               pager: 
               id: 
               c: 
               breadcrumb: 
               url: 
               h: 
               is_grid: True
               macros: 
               template: 
               main: 
               model_name: Publisher
               view: 

RuntimeError: Caught exception rendering template.
 - Expression: ``fs.render(renderer='fa.jquery:templates/forms/jqgrid.pt', request=request)``
 - Filename:   /usr/local/lib/python2.6/dist-packages/fa.jquery-0.8-py2.6.egg/fa/jquery/templates/admin/master.pt
 - Arguments:  macros: 

RuntimeError: Caught exception rendering template.
 - Expression: ``','.join([f.metadata.get('json') for f in collection.render_fields.values()])``
 - Filename:   /usr/local/lib/python2.6/dist-packages/fa.jquery-0.8-py2.6.egg/fa/jquery/templates/forms/jqgrid.pt
 - Arguments:  renderer_name: fa.jquery:templates/forms/jqgrid.pt
               template: 
               xincludes: 
               tmpl_context: 
               collection: 
               F_: 
               renderer_info: 
               session: 
               c: 
               fatypes: 
               url: 
               h: 
               request: 
               macros: 
               html: 
               context: 
               view: 

TypeError: sequence item 0: expected string, NoneType found

Unicode decoding error during rendering a date field

I use fa.jquery-0.9.4

RenderError: An uncaught exception was raised. TypeError: decoding Unicode is not supported - Expression: "field.render()" - Filename: C:\Users\aodag\Documents\works\olive\lib\site-packages\fa.jquery-0.9.4-py2.7.egg\fa\jquery\templates\forms\fieldset.pt - Location: (21:32) - Arguments: repeat: {...} (1) renderer_name: pyramid_formalchemy:templates/forms/fieldset.pt template: <PageTemplateFile - at 0x3f11be0L> F_: <instancemethod translate at 0x41a8360L> renderer_info: <RendererHelper - at 0x642db00L> focus_rendered: True attrs: {...} (1) nothing: <NoneType - at 0x1e291448L> fieldset: <FieldSet - at 0x643ec50L> convert: <function translate at 0x403bac8L> fatypes: <module formalchemy.fatypes at 0x3e1c498L> field: <AttributeField - at 0x627c240L> default: <Placeholder - at 0x4196898L> error: <list - at 0x6470888L> request: <Request - at 0x643e320L> decode: <type unicode at 0x1e2a4150L> macros: <Macros - at 0x6265228L> html: <module formalchemy.helpers at 0x3d275b8L> context: <NoneType - at 0x1e291448L> translate: <function translate at 0x403bac8L> view: <NoneType - at 0x1e291448L>

<< value = self.field.model_value
F_ = self.get_translator(**kwargs)
month_options = [(F_('Month'), 'MM')] + [(unicode(F_('month_%02i' % i), 'utf-8'), str(i)) for i in xrange(1, 13)]
day_options = [(F_('Day'), 'DD')] + [(i, str(i)) for i in xrange(1, 32)]
mm_name = self.name + '__month'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.