roles_table = Table('tg_role', metadata,
Column('role_id', Integer, primary_key=True),
Column('role_name', Unicode(16), unique=True),
)
users_table = Table('tg_user', metadata,
Column('user_id', Integer, primary_key=True),
Column('user_name', Unicode(16), unique=True),
..other parameters
)
user_role_table = Table('user_role', metadata,
Column('user_id', Integer, ForeignKey('tg_user.user_id')),
Column('role_id', Integer, ForeignKey('tg_role.role_id'))
)
tg-admin sql create works fine but am unable to start the server.
Starting it throws this exception. Any ideas what could be wrong with
the schema...
Unhandled exception in thread started by <bound method Server._start of
<cherryp
y._cpserver.Server object at 0x00D4D690>>
.......
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\iden
tity\saprovider.py", line 119, in __init__
group_class = load_class(group_class_path)
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\util
.py", line 294, in load_class
splitted_path = dottedpath.split('.')
AttributeError: 'NoneType' object has no attribute 'split'
You can't change the model of the identity framework and expect it to work.
Your error is caused by a missing group object:
> group_class = load_class(group_class_path)
I am not quite sure if I understood your reply. If I go change the
model and recreate the database, is there a higher up authority
deciding for me that I can only have a Group object? If so, why does it
work with SQLObject?
Thanks,
Suren
The SqlAlchemy identity provider doesn't do that. You need to define a
group class in your config (as well as a permissions class).
File
"/var/lib/python-support/python2.4/turbogears/identity/visitor.py",
line 50, in create_extension_model
provider= create_default_provider()
File
"/var/lib/python-support/python2.4/turbogears/identity/__init__.py",
line 26, in create_default_provider
return plugin()
File
"/var/lib/python-support/python2.4/turbogears/identity/saprovider.py",
line 119, in __init__
group_class = load_class(group_class_path)
File "/var/lib/python-support/python2.4/turbogears/util.py", line
295, in load_class
splitted_path = dottedpath.split('.')
AttributeError: 'NoneType' object has no attribute 'split'
what is weird is that it occurs only when i run unittests, in test.cfg
I have:
dentity.on=True
identity.provider="sqlalchemy"
identity.saprovider.model.user="globalconfui.model.User"
identity.saprovider.model.visit="globalconfui.model.VisitIdentity"
identity.saprovider.encryption_algorithm="sha1"
before upgrading to TG 1.0 last week the tests ran ok.
And through the browser identity works like a charm.
but if you go deleting stuff without knowing what exactly gets call
you end up here.
On the other hand the current default identity the autogenerated and
the TG_*, are supposed to be the minimum requirement for *any* project
so IMO you should not need to delete anything, and if your thinking
"nah I don't need groups" then think about it as "i may some day needs
groups" :)
> Thanks,
> Suren
>
>
> >
>