pombreda / formalchemy

Automatically exported from code.google.com/p/formalchemy
MIT License
0 stars 0 forks source link

Fix one ext.pylons.admin issue with Elixir entity #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

this patch fix one ext.pylons.admin issue with Elixir entity.

With Elixir, we don't need to call S.save(my_entity) to append it to
SQLAlchemy session.

Regards,
Stephane

Original issue reported on code.google.com by klein.stephane on 11 Mar 2009 at 12:57

Attachments:

GoogleCodeExporter commented 9 years ago
does elixir actually error out if you try to save(), or is it just redundant?

Original comment by jbel...@gmail.com on 11 Mar 2009 at 2:33

GoogleCodeExporter commented 9 years ago
> does elixir actually error out if you try to save(), or is it just redundant?

I've one error.

Original comment by klein.stephane on 11 Mar 2009 at 2:38

GoogleCodeExporter commented 9 years ago
I've this error :

URL: http://localhost:5000/admin/Movie/edit
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/WebError-0.10.1-
py2.5.egg/weberror/evalexception.py',
line 431 in respond
  app_iter = self.application(environ, detect_start_response)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/Beaker-1.2.1-py2
.5.egg/beaker/middleware.py',
line 81 in __call__
  return self.app(environ, start_response)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/Beaker-1.2.1-py2
.5.egg/beaker/middleware.py',
line 160 in __call__
  return self.wrap_app(environ, session_start_response)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/Routes-1.10.1-py
2.5.egg/routes/middleware.py',
line 118 in __call__
  response = self.app(environ, start_response)
File '/home/harobed/test/test_pylons/env/src/Pylons/pylons/wsgiapp.py', line 
126 in
__call__
  response = self.dispatch(controller, environ, start_response)
File '/home/harobed/test/test_pylons/env/src/Pylons/pylons/wsgiapp.py', line 
321 in
dispatch
  return controller(environ, start_response)
File
'/home/harobed/test/test_pylons/env/src/fa_themes/pylonsapp/pylonsapp/lib/base.p
y',
line 19 in __call__
  return WSGIController.__call__(self, environ, start_response)
File 
'/home/harobed/test/test_pylons/env/src/Pylons/pylons/controllers/core.py', line
221 in __call__
  response = self._dispatch_call()
File 
'/home/harobed/test/test_pylons/env/src/Pylons/pylons/controllers/core.py', line
172 in _dispatch_call
  response = self._inspect_call(func)
File 
'/home/harobed/test/test_pylons/env/src/Pylons/pylons/controllers/core.py', line
107 in _inspect_call
  result = self._perform_call(func, args)
File 
'/home/harobed/test/test_pylons/env/src/Pylons/pylons/controllers/core.py', line
61 in _perform_call
  return func(**args)
File
'/home/harobed/test/test_pylons/env/src/formalchemy/formalchemy/ext/pylons/admin
.py',
line 151 in edit
  S.save(c.fs.model)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/SQLAlchemy-0.5.2
-py2.5.egg/sqlalchemy/orm/scoping.py',
line 121 in do
  return getattr(self.registry(), name)(*args, **kwargs)
File '<string>', line 1 in <lambda>
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/SQLAlchemy-0.5.2
-py2.5.egg/sqlalchemy/util.py',
line 1524 in warned
  return fn(*args, **kwargs)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/SQLAlchemy-0.5.2
-py2.5.egg/sqlalchemy/orm/session.py',
line 1054 in save
  state = _state_for_unsaved_instance(instance)
File
'/home/harobed/test/test_pylons/env/lib/python2.5/site-packages/SQLAlchemy-0.5.2
-py2.5.egg/sqlalchemy/orm/session.py',
line 1549 in _state_for_unsaved_instance
  mapperutil.state_str(state))
InvalidRequestError: Instance '<Movie at 0xa0557ec>' is already persistent

Original comment by klein.stephane on 11 Mar 2009 at 2:39

GoogleCodeExporter commented 9 years ago
applied in 724, thanks

Original comment by jbel...@gmail.com on 11 Mar 2009 at 2:47