Massimo,
Thanks for your reply.
> Back to your original problem:
> 2) You have a custom auth_user in the wrong place in db.py (or with
> wrong syntax) and the table gets defined twice. I am pretty sure this
> is the case but I cannot point to the error if I do not see the code.
This is the code I have in db.py:
from gluon.tools import *
auth=Auth(globals(),db) # authentication/
authorization
# auth.settings.hmac_key='sha512:a94ab0df-7d00-4326-bc4b-e8732ed0e81a'
auth_table=db.define_table(auth.settings.table_user_name,
Field('bedrijf', db.bedrijf, default='',
notnull=True,ondelete='CASCADE', writable=False, readable=False),
Field('first_name', length=128, default='', notnull=True),
Field('last_name', length=128, default='', notnull=True),
Field('email', length=128, default='', notnull=True),
Field('site', type='boolean', writable=False, readable=False),
Field('username', length=128, default='', notnull=True,
unique=True),
Field('password', type='password', length=256, readable=False,
default='', notnull=True),
Field('created_on',type='datetime', writable=False,
readable=False),
Field('modified_on',type='datetime', writable=False,
readable=False),
Field('most_recent_login',type='datetime', writable=False,
readable=False),
Field('registration_key', length=128, writable=False,
readable=False, default=''))
auth_table.bedrijf.requires=[IS_IN_DB(db, db.bedrijf.id, '%
(bedrijfsnaam)s')]
auth_table.bedrijf.label='Bedrijf * '
auth_table.first_name.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY()]
auth_table.first_name.label='Voornaam * '
auth_table.last_name.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY()]
auth_table.last_name.label='Achternaam * '
auth_table.email.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_EMAIL(), IS_NOT_EMPTY()]
auth_table.email.label='E-mail * '
auth_table.site.default=False
auth_table.username.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY(), IS_NOT_IN_DB(db,
'auth_user.username')]
auth_table.username.label='Gebruikersnaam * '
auth_table.password.requires=[IS_NOT_EMPTY(), CRYPT()]
auth_table.password.label='Wachtwoord * '
auth_table.created_on.default=request.now
auth_table.modified_on.default=request.now
auth_table.modified_on.update=request.now
auth_table.most_recent_login.default=request.now
auth.settings.table_user=auth_table
auth.define_tables() # creates all needed
tables
I hope this provides you with sufficient information to help me solve
the problem.
The fact that the tables related to authentication and authorization
are defined in a different application than the other tables isn't a
problem then?
Kind regards,
Annet.
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.