12 messages in com.googlegroups.pylons-discussRe: AuthKit problems| From | Sent On | Attachments |
|---|---|---|
| enrico secco | 17 Dec 2007 02:58 | |
| Mike Orr | 17 Dec 2007 12:10 | |
| Lythoner LY | 18 Dec 2007 18:39 | |
| James Gardner | 19 Dec 2007 13:45 | |
| enrico secco | 20 Dec 2007 02:27 | |
| Lythoner LY | 20 Dec 2007 10:54 | .py |
| James Gardner | 20 Dec 2007 12:58 | |
| James Gardner | 20 Dec 2007 13:11 | |
| Adam Ryan | 25 Jan 2008 13:55 | |
| n1ywb | 13 Feb 2008 13:33 | |
| n1ywb | 14 Feb 2008 09:47 | |
| n1ywb | 14 Feb 2008 10:53 |
| Subject: | Re: AuthKit problems![]() |
|---|---|
| From: | enrico secco (enri...@public.gmane.org) |
| Date: | 12/20/2007 02:27:51 AM |
| List: | com.googlegroups.pylons-discuss |
Hi James,
I'm happy to know that I do'nt must use SAContext ... because it's non installable, at least fo me.
I did try to follow the information of Mike Orr and samething is changed. Now the it seems that the 'sqlalchemy_04_driver' have some problem with 'environ' object. Could be I do'nt work correctly at the model level but i search to follow your example in '' Authentication and Authorization' to apply database users and roles at the QuickWiki. The alternative documents that Mike indicate to me do'nt seems to contain the necessary informations.
What can I do?
Help me.
Enrico Secco """ root@ubuntuSVR:~# paster setup-app test.ini Running setup_config() from quickwiki.websetup Traceback (most recent call last): File "/usr/bin/paster", line 8, in <module> load_entry_point('PasteScript==1.3.6', 'console_scripts', 'paster') () File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/command.py", line 78, in run invoke(command, command_name, options, args[1:]) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/command.py", line 117, in invoke exit_code = runner.run(args) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 68, in run return super(AbstractInstallCommand, self).run(new_args) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/command.py", line 212, in run result = self.command() File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 456, in command self, config_file, section, self.sysconfig_install_vars(installer)) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 592, in setup_config mod.setup_config(command, filename, section, vars) File "/usr/lib/python2.5/site-packages/QuickWiki-0.1.5-py2.5.egg/ quickwiki/websetup.py", line 22, in setup_config users = UsersFromDatabase(model) File "/usr/lib/python2.5/site-packages/AuthKit-0.4.1dev_r143- py2.5.egg/authkit/users/sqlalchemy_04_driver.py", line 100, in __init__ if not environ.has_key('sqlalchemy.model') or not environ.has_key('sqlalchemy.session'): AttributeError: 'module' object has no attribute 'has_key' """
On 19 Dic, 22:45, James Gardner <ja.....@public.gmane.org>
wrote:
Hi Lythoner,
You've spotted the SQLAlchemy 0.4 driver have you? AuthKit has never used SAContext ever.
Cheers,
James
Lythoner LY wrote:
Enrico,
AuthKit 0.4 is not updated to use the full power of sqlalchemy 0.4. I had faced a lot of issues with UsersFromDatabase class last week. SAContext is a hook they have added temporarily to help the session management and reduce number of repetitive code. Now sqlalchemy 0.4 has improved in this area. AuthKit 0.4 code is really cruft and it has to be updated in many areas & require clean up.
Myself I did some changes in the UsersFromDatabase class to use the latest version of the sqlalchemy. I don't know whether it is good approach or not. I just enjoy the learning curve(with frustration). Their documentation sucks :-(.
Regards,
Lythoner
On Dec 17, 2007 4:28 PM, enrico secco
<enri...@public.gmane.org
<mailto:enri...@public.gmane.org>> wrote:
Hi Pylons people, I'm trying to test the possibility to develop a web application in Pylons and I must handle the permission at row level of my db. I did think to use AuthKit but I'm forced to use the UsersFromDatabase mode. I did try to test the funcionality on following the tutorial relative to QuickWiki in the Authentication and Authorization (PylonsBook) but I don't be aple to pass the
paster setup-app development.ini
The first problem was the definition of 'meta' and 'ctx'. For meta I suppose that there was e change in QuickWiki because MetaData() is assigned to a 'metadata' variable. Then i add the line
meta = metadata
and for ctx insert 2 lines in QuickWiki model
from pylons.database import create_engine, session_context ... ctx = session_context()
I know session_context is deprecated but I find no other way.
Then I stop at the same point with:
""" root@ubuntuSVR:~# paster setup-app test.ini Running setup_config() from quickwiki.websetup /usr/lib/python2.5/site-packages/QuickWiki-0.1.5-py2.5.egg /quickwiki/ model/__init__.py:10: DeprecationWarning: pylons.database is deprecated, and will be removed from a future version of Pylons. SQLAlchemy 0.3.x users are recommended to migrate to SAContext (http:// cheeseshop.python.org/pypi/SAContext <http://cheeseshop.python.org/pypi/SAContext>) for similar functionality from pylons.database import create_engine, session_context /usr/lib/python2.5/site-packages/Pylons- 0.9.6.1-py2.5.egg/pylons/ database.py:142: SADeprecationWarning: SessionContext is deprecated. Use scoped_session(). scopefunc=app_scope) Traceback (most recent call last): File "/usr/bin/paster", line 8, in <module> load_entry_point('PasteScript==1.3.6', 'console_scripts', 'paster') () File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/command.py", line 78, in run invoke(command, command_name, options, args[1:]) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/command.py", line 117, in invoke exit_code = runner.run(args) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 68, in run return super(AbstractInstallCommand, self).run(new_args) File "/usr/lib/python2.5/site-packages/PasteScript- 1.3.6-py2.5.egg/ paste/script/command.py", line 212, in run result = self.command() File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 456, in command self, config_file, section, self.sysconfig_install_vars(installer)) File "/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg/ paste/script/appinstall.py", line 592, in setup_config mod.setup_config(command, filename, section, vars) File "/usr/lib/python2.5/site-packages/QuickWiki-0.1.5-py2.5.egg/ quickwiki/websetup.py", line 20, in setup_config import quickwiki.model as model File "/usr/lib/python2.5/site-packages/QuickWiki-0.1.5-py2.5.egg/ quickwiki/model/__init__.py", line 27, in <module> ctx = session_context() File "/usr/lib/python2.5/site-packages/SQLAlchemy- 0.4.1-py2.5.egg/ sqlalchemy/orm/scoping.py", line 44, in __call__ return self.registry() File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.1-py2.5.egg/ sqlalchemy/util.py", line 785, in __call__ return self.registry.setdefault(key, self.createfunc()) File "/usr/lib/python2.5/site-packages/Pylons-0.9.6.1-py2.5.egg/ pylons/database.py", line 137, in make_session engine = create_engine(uri, echo=echo, **kwargs) File "/usr/lib/python2.5/site-packages/Pylons-0.9.6.1-py2.5.egg/ pylons/database.py", line 84, in create_engine assert uri AssertionError """ The tables are created with all the constraints but not the istances 'delete' in the role ad admin in the user tables.
I did also update my AuthKit package with the trunk version but the result is the same. I did develop a lot of code on Zope but I find Pylons too nice and I want try to change. But my job is to develop administrative and business tool and the permission record by record is necessary. So I must develop a db level sistem of permission and the user ad role must be inside the database.
Help me, thanks. Enrico





.py