Apologies.  Here is the remainder of my reply:

In models/db.py (the process hangs in the last line of this code.:

from applications.toets.modules.mydal import *

db.define_table('auth_user',
                Field('id','id',
                      represent=lambda id:SPAN(id,' ',A('view',_href=URL(
'auth_user_read',args=id)))),
                Field('username', type='string',
                      label=T('Username')),
                Field('first_name', type='string',
                      label=T('First Name')),
                Field('last_name', type='string',
                      label=T('Last Name')),
                Field('email', type='string',
                      label=T('Email')),
                Field('password', type='password',
                      readable=False,
                      label=T('Password')),
                Field('created_on','datetime',default=request.now,
                      label=T('Created On'),writable=False,readable=False),
                Field('modified_on','datetime',default=request.now,
                      label=T('Modified On'),writable=False,readable=False,
                      update=request.now),
                Field('registration_key',default='',
                      writable=False,readable=False),
                Field('reset_password_key',default='',
                      writable=False,readable=False),
                Field('registration_id', length=64, default=lambda:str(uuid.
uuid4()),
                      writable=False,readable=False),
                format='%(username)s' ,
                migrate=False, # make sure to not create the table
                table_class=MyTable # notice i use MyTable instead the 
original Table, that support schema
                )

db.auth_user.set_schema('toets0', migrate=True, _adapter=db._adapter) 

In the Postgresql-log:

2012-05-08 12:13:20 SAST LOG:  could not receive data from client: 
Connection reset by peer

In the end I used Ctrl-C to stop the process - leaving this traceback:

^CTraceback (most recent call last):
  File "web2py.py", line 20, in <module>
    gluon.widget.start(cron=True)
  File "/home/js/web2py/gluon/widget.py", line 869, in start
    import_models=options.import_models, startfile=options.run)
  File "/home/js/web2py/gluon/shell.py", line 189, in run
    _env = env(a, c=c, import_models=import_models)
  File "/home/js/web2py/gluon/shell.py", line 131, in env
    run_models_in(environment)
  File "/home/js/web2py/gluon/compileapp.py", line 513, in run_models_in
    restricted(code, environment, layer=model)
  File "/home/js/web2py/gluon/restricted.py", line 205, in restricted
    exec ccode in environment
  File "applications/toets/models/db.py", line 81, in <module>
    db.auth_user.set_schema('toets0', migrate=True, _adapter=db._adapter) 
  File "applications/toets/modules/mydal.py", line 553, in set_schema
    _adapter.create_table(self)
  File "/home/js/web2py/gluon/dal.py", line 770, in create_table
    logfile = self.file_open(table._loggername, 'a')
  File "/home/js/web2py/gluon/dal.py", line 579, in file_open
    fileobj = portalocker.LockedFile(filename,mode)
  File "/home/js/web2py/gluon/portalocker.py", line 121, in __init__
    lock(self.file,LOCK_EX)
  File "/home/js/web2py/gluon/portalocker.py", line 88, in lock
    fcntl.flock(file.fileno(), flags)
KeyboardInterrupt


Regards
Johann



Reply via email to