[web2py] Re: ProgrammingError: relation auth_user already exists

2010-04-12 Thread annet
Could it have anything to do with defining a custom auth_user tabel?

auth.settings.table_user=db.define_table('auth_user',
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=''))

db.auth_user.bedrijf.requires=[IS_IN_DB(db, db.bedrijf.id, '%
(bedrijfsnaam)s')]
db.auth_user.bedrijf.label='Bedrijf * '
db.auth_user.first_name.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY()]
db.auth_user.first_name.label='Voornaam * '
db.auth_user.last_name.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY()]
db.auth_user.last_name.label='Achternaam * '
db.auth_user.email.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_EMAIL(), IS_NOT_EMPTY()]
db.auth_user.email.label='E-mail * '
db.auth_user.site.default=False
db.auth_user.username.requires=[IS_LENGTH(128,error_message='lengte
overschreidt 128 tekens'), IS_NOT_EMPTY(), IS_NOT_IN_DB(db,
'auth_user.username')]
db.auth_user.username.label='Gebruikersnaam * '
db.auth_user.password.requires=[IS_NOT_EMPTY(), CRYPT()]
db.auth_user.password.label='Wachtwoord * '
db.auth_user.created_on.default=request.now
db.auth_user.modified_on.default=request.now
db.auth_user.modified_on.update=request.now
db.auth_user.most_recent_login.default=request.now


Kind regards,

Annet.


-- 
To unsubscribe, reply using remove me as the subject.


[web2py] Re: ProgrammingError: relation auth_user already exists

2010-04-12 Thread mdipierro
I think web2py is trying to create a table that is already there. If
you do not have data delete everything in databases/*


On Apr 12, 8:51 am, annet annet.verm...@gmail.com wrote:
 I have one application (called base) in which I define all the tables
 for three other applications. In the three applications I use the same
 db.py file. In these db.py files I set migrate=False on all tables.

 One of these applications is a CMS, in which I enabled Authorization
 and Authentication. This creates the .table files for auth_event,
 auth- group, auth_membership, auth_permission and auth_user in the
 databases folder of the cms application, all the .table files for the
 other
 tables are in the databases folder of the base application.

 Today I defined four more tables in the base application's db.py file,
 and copied and paste them to the db.py files of the other
 applications, and set migrate=False on these tables. After saving the
 db.py file of the CMS application I got the following error when I go
 to the database administration:

 ProgrammingError: relation auth_user already exists

 Does this mean I cannot make changes to the db.py file in which
 Authorization and Authentication are enabled? i.e. I can only save the
 db.py file once.

 Kind regards,

 Annet.


-- 
To unsubscribe, reply using remove me as the subject.


[web2py] Re: ProgrammingError: relation auth_user already exists

2010-04-12 Thread annet
Massimo,

Yes, that would solve the problem, but I do have data in the auth_xxx
tables. I had hoped there would be a more robust solution. Isn't it
possible to define the auth_event, auth- group, auth_membership,
auth_permission and auth_user in db.py just like I define all the
other tables, and after the tables have been created set their
migrates to migrate=False. I mean to not use auth.define_tables() to
create the tables. In that case the auth_xxx tables are created once,
and longer touched when I edit the db.py file.

Kind regards,

Annet.


-- 
To unsubscribe, reply using remove me as the subject.