[web2py] Re: error when upgraded to v1.99

2011-11-05 Thread Massimo Di Pierro
The error is here

File /web2py/helpdesk/applications/helpdesk/models/
dbowrappers.py, line 226, in create_admin     id =
cls.db.user_profile.insert(**data)

what's in data?

for key in data: print ket, repr(data[key]), type(data[key])


On Nov 4, 11:00 pm, Richard Baron Penman richar...@gmail.com wrote:
 Yes the app uses a customized auth.
 That user field stores google accounts:

 from google.appengine.api import users
 google_user = users.get_current_user()

 The error is raised from GAE but doesn't happen when I use the same
 version of GAE with an older version of web2py.
 Do you know what might have changed in web2py to break it?

 Richard

 On Sat, Nov 5, 2011 at 12:41 PM, Massimo Di Pierro







 massimo.dipie...@gmail.com wrote:
  This is not a web2py error. You are declaring

  Field('user', gae.UserProperty()),

  what are you putting into this field? You seem to be re-implementing a
  lot of the auth logic yourself.

  On Nov 3, 10:07 pm, Richard Baron Penman richar...@gmail.com wrote:
  from trunk, now a different error:

  Traceback (most recent call last):
    File /web2py/helpdesk/gluon/restricted.py, line 204, in restricted
      exec ccode in environment
    File 
  /web2py/helpdesk/applications/helpdesk/controllers/default.py:index,
  line 11, in module
    File applications/helpdesk/modules/auth.py, line 109, in __call__
      user_profile = UserProfile.get_or_create_from_session()
    File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
  line 234, in get_or_create_from_session
      return cls.from_session() or cls.create_admin()
    File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
  line 226, in create_admin
      id = cls.db.user_profile.insert(**data)
    File /web2py/helpdesk/gluon/dal.py, line 5063, in insert
      return self._db._adapter.insert(self,self._listify(fields))
    File /web2py/helpdesk/gluon/dal.py, line 3464, in insert
      tmp = table._tableobj(**dfields)
    File /google_appengine/google/appengine/ext/db/__init__.py, line
  945, in __init__
      prop.__set__(self, value)
    File /google_appengine/google/appengine/ext/db/__init__.py, line
  599, in __set__
      value = self.validate(value)
    File /google_appengine/google/appengine/ext/db/__init__.py, line
  3269, in validate
      raise BadValueError('Property %s must be a User' % self.name)
  BadValueError: Property user must be a User

  On Fri, Nov 4, 2011 at 10:14 AM, Massimo Di Pierro

  massimo.dipie...@gmail.com wrote:
   Try the latest trunk.

   On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
   db.define_table('user_profile',
       Field('name'),
       Field('user', gae.UserProperty()),
       Field('email'),
       Field('active', 'boolean'),
       Field('role_worker', 'boolean'),
       Field('role_facilitator', 'boolean'),
       Field('role_admin', 'boolean'),
   )


Re: [web2py] Re: error when upgraded to v1.99

2011-11-05 Thread Richard Baron Penman
   data = {
'name': users.get_current_user().nickname(),
'user': users.get_current_user(),
'email': users.get_current_user().email(),
'active': True,
'role_worker': True,
'role_facilitator': True,
'role_admin': True,
}


On Sat, Nov 5, 2011 at 11:38 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 The error is here

 File /web2py/helpdesk/applications/helpdesk/models/
 dbowrappers.py, line 226, in create_admin id =
 cls.db.user_profile.insert(**data)

 what's in data?

 for key in data: print ket, repr(data[key]), type(data[key])


 On Nov 4, 11:00 pm, Richard Baron Penman richar...@gmail.com wrote:
  Yes the app uses a customized auth.
  That user field stores google accounts:
 
  from google.appengine.api import users
  google_user = users.get_current_user()
 
  The error is raised from GAE but doesn't happen when I use the same
  version of GAE with an older version of web2py.
  Do you know what might have changed in web2py to break it?
 
  Richard
 
  On Sat, Nov 5, 2011 at 12:41 PM, Massimo Di Pierro
 
 
 
 
 
 
 
  massimo.dipie...@gmail.com wrote:
   This is not a web2py error. You are declaring
 
   Field('user', gae.UserProperty()),
 
   what are you putting into this field? You seem to be re-implementing a
   lot of the auth logic yourself.
 
   On Nov 3, 10:07 pm, Richard Baron Penman richar...@gmail.com wrote:
   from trunk, now a different error:
 
   Traceback (most recent call last):
 File /web2py/helpdesk/gluon/restricted.py, line 204, in restricted
   exec ccode in environment
 File
 /web2py/helpdesk/applications/helpdesk/controllers/default.py:index,
   line 11, in module
 File applications/helpdesk/modules/auth.py, line 109, in __call__
   user_profile = UserProfile.get_or_create_from_session()
 File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
   line 234, in get_or_create_from_session
   return cls.from_session() or cls.create_admin()
 File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
   line 226, in create_admin
   id = cls.db.user_profile.insert(**data)
 File /web2py/helpdesk/gluon/dal.py, line 5063, in insert
   return self._db._adapter.insert(self,self._listify(fields))
 File /web2py/helpdesk/gluon/dal.py, line 3464, in insert
   tmp = table._tableobj(**dfields)
 File /google_appengine/google/appengine/ext/db/__init__.py, line
   945, in __init__
   prop.__set__(self, value)
 File /google_appengine/google/appengine/ext/db/__init__.py, line
   599, in __set__
   value = self.validate(value)
 File /google_appengine/google/appengine/ext/db/__init__.py, line
   3269, in validate
   raise BadValueError('Property %s must be a User' % self.name)
   BadValueError: Property user must be a User
 
   On Fri, Nov 4, 2011 at 10:14 AM, Massimo Di Pierro
 
   massimo.dipie...@gmail.com wrote:
Try the latest trunk.
 
On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
db.define_table('user_profile',
Field('name'),
Field('user', gae.UserProperty()),
Field('email'),
Field('active', 'boolean'),
Field('role_worker', 'boolean'),
Field('role_facilitator', 'boolean'),
Field('role_admin', 'boolean'),
)



[web2py] Re: error when upgraded to v1.99

2011-11-04 Thread Massimo Di Pierro
This is not a web2py error. You are declaring

Field('user', gae.UserProperty()),

what are you putting into this field? You seem to be re-implementing a
lot of the auth logic yourself.



On Nov 3, 10:07 pm, Richard Baron Penman richar...@gmail.com wrote:
 from trunk, now a different error:

 Traceback (most recent call last):
   File /web2py/helpdesk/gluon/restricted.py, line 204, in restricted
     exec ccode in environment
   File /web2py/helpdesk/applications/helpdesk/controllers/default.py:index,
 line 11, in module
   File applications/helpdesk/modules/auth.py, line 109, in __call__
     user_profile = UserProfile.get_or_create_from_session()
   File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
 line 234, in get_or_create_from_session
     return cls.from_session() or cls.create_admin()
   File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
 line 226, in create_admin
     id = cls.db.user_profile.insert(**data)
   File /web2py/helpdesk/gluon/dal.py, line 5063, in insert
     return self._db._adapter.insert(self,self._listify(fields))
   File /web2py/helpdesk/gluon/dal.py, line 3464, in insert
     tmp = table._tableobj(**dfields)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 945, in __init__
     prop.__set__(self, value)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 599, in __set__
     value = self.validate(value)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 3269, in validate
     raise BadValueError('Property %s must be a User' % self.name)
 BadValueError: Property user must be a User

 On Fri, Nov 4, 2011 at 10:14 AM, Massimo Di Pierro







 massimo.dipie...@gmail.com wrote:
  Try the latest trunk.

  On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
  db.define_table('user_profile',
      Field('name'),
      Field('user', gae.UserProperty()),
      Field('email'),
      Field('active', 'boolean'),
      Field('role_worker', 'boolean'),
      Field('role_facilitator', 'boolean'),
      Field('role_admin', 'boolean'),
  )


Re: [web2py] Re: error when upgraded to v1.99

2011-11-04 Thread Richard Baron Penman
Yes the app uses a customized auth.
That user field stores google accounts:

from google.appengine.api import users
google_user = users.get_current_user()

The error is raised from GAE but doesn't happen when I use the same
version of GAE with an older version of web2py.
Do you know what might have changed in web2py to break it?

Richard


On Sat, Nov 5, 2011 at 12:41 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
 This is not a web2py error. You are declaring

 Field('user', gae.UserProperty()),

 what are you putting into this field? You seem to be re-implementing a
 lot of the auth logic yourself.



 On Nov 3, 10:07 pm, Richard Baron Penman richar...@gmail.com wrote:
 from trunk, now a different error:

 Traceback (most recent call last):
   File /web2py/helpdesk/gluon/restricted.py, line 204, in restricted
     exec ccode in environment
   File /web2py/helpdesk/applications/helpdesk/controllers/default.py:index,
 line 11, in module
   File applications/helpdesk/modules/auth.py, line 109, in __call__
     user_profile = UserProfile.get_or_create_from_session()
   File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
 line 234, in get_or_create_from_session
     return cls.from_session() or cls.create_admin()
   File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
 line 226, in create_admin
     id = cls.db.user_profile.insert(**data)
   File /web2py/helpdesk/gluon/dal.py, line 5063, in insert
     return self._db._adapter.insert(self,self._listify(fields))
   File /web2py/helpdesk/gluon/dal.py, line 3464, in insert
     tmp = table._tableobj(**dfields)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 945, in __init__
     prop.__set__(self, value)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 599, in __set__
     value = self.validate(value)
   File /google_appengine/google/appengine/ext/db/__init__.py, line
 3269, in validate
     raise BadValueError('Property %s must be a User' % self.name)
 BadValueError: Property user must be a User

 On Fri, Nov 4, 2011 at 10:14 AM, Massimo Di Pierro







 massimo.dipie...@gmail.com wrote:
  Try the latest trunk.

  On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
  db.define_table('user_profile',
      Field('name'),
      Field('user', gae.UserProperty()),
      Field('email'),
      Field('active', 'boolean'),
      Field('role_worker', 'boolean'),
      Field('role_facilitator', 'boolean'),
      Field('role_admin', 'boolean'),
  )


[web2py] Re: error when upgraded to v1.99

2011-11-03 Thread Plumo
db.define_table('user_profile',
Field('name'),
Field('user', gae.UserProperty()),
Field('email'),
Field('active', 'boolean'),
Field('role_worker', 'boolean'),
Field('role_facilitator', 'boolean'),
Field('role_admin', 'boolean'),
)



[web2py] Re: error when upgraded to v1.99

2011-11-03 Thread Massimo Di Pierro
Try the latest trunk.

On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
 db.define_table('user_profile',
     Field('name'),
     Field('user', gae.UserProperty()),
     Field('email'),
     Field('active', 'boolean'),
     Field('role_worker', 'boolean'),
     Field('role_facilitator', 'boolean'),
     Field('role_admin', 'boolean'),
 )


Re: [web2py] Re: error when upgraded to v1.99

2011-11-03 Thread Richard Baron Penman
from trunk, now a different error:

Traceback (most recent call last):
  File /web2py/helpdesk/gluon/restricted.py, line 204, in restricted
exec ccode in environment
  File /web2py/helpdesk/applications/helpdesk/controllers/default.py:index,
line 11, in module
  File applications/helpdesk/modules/auth.py, line 109, in __call__
user_profile = UserProfile.get_or_create_from_session()
  File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
line 234, in get_or_create_from_session
return cls.from_session() or cls.create_admin()
  File /web2py/helpdesk/applications/helpdesk/models/dbowrappers.py,
line 226, in create_admin
id = cls.db.user_profile.insert(**data)
  File /web2py/helpdesk/gluon/dal.py, line 5063, in insert
return self._db._adapter.insert(self,self._listify(fields))
  File /web2py/helpdesk/gluon/dal.py, line 3464, in insert
tmp = table._tableobj(**dfields)
  File /google_appengine/google/appengine/ext/db/__init__.py, line
945, in __init__
prop.__set__(self, value)
  File /google_appengine/google/appengine/ext/db/__init__.py, line
599, in __set__
value = self.validate(value)
  File /google_appengine/google/appengine/ext/db/__init__.py, line
3269, in validate
raise BadValueError('Property %s must be a User' % self.name)
BadValueError: Property user must be a User



On Fri, Nov 4, 2011 at 10:14 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
 Try the latest trunk.

 On Nov 3, 6:53 pm, Plumo richar...@gmail.com wrote:
 db.define_table('user_profile',
     Field('name'),
     Field('user', gae.UserProperty()),
     Field('email'),
     Field('active', 'boolean'),
     Field('role_worker', 'boolean'),
     Field('role_facilitator', 'boolean'),
     Field('role_admin', 'boolean'),
 )


[web2py] Re: error when upgraded to v1.99

2011-11-01 Thread Massimo Di Pierro
What's your model?

On Nov 1, 10:02 pm, Plumo richar...@gmail.com wrote:
 I had a GAE app running on Version 1.94.6 (2011-03-27 17:35:27)
 I tried upgrading to: Version 1.99.2 (2011-09-26 06:55:33) stable

 But then get an error with this
 line: db(cls.db.user_profile.user==google_user).select().first()

   File /web2py/gluon/dal.py, line 5786, in select
     return self.db._adapter.select(self.query,fields,attributes)
   File /web2py/gluon/dal.py, line 3407, in select
     (items, tablename, fields) = self.select_raw(query,fields,attributes)
   File /web2py/gluon/dal.py, line 3364, in select_raw
     filters = self.expand(query)
   File /web2py/gluon/dal.py, line 3246, in expand
     return expression.op(expression.first, expression.second)
   File /web2py/gluon/dal.py, line 3269, in EQ
     return [GAEF(first.name,'=',self.represent(second,first.type),lambda
 a,b:a==b)]
   File /web2py/gluon/dal.py, line 3014, in represent
     if fieldtype.startswith('list:'):
 AttributeError: 'UserProperty' object has no attribute 'startswith'

 Same error with: Version 1.99.3 (2011-11-01 08:28:28) dev

 Do you have an idea what has changed with web2py to produce this error?

 Richard