[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread nick name
I've just done an hg pull -u:

changeset:   2435:8cbfa1244549
tag: tip
user:mdipierro@massimo-di-pierros-macbook-2.local
date:Wed Sep 21 00:17:23 2011 -0500
summary: sys.exit(0), thanks Praneeth

The README file mentions request.utcnow, but the code doesn't. So either 
the README needs a fix, or some patch was lost along the way.


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread guruyaya
I've just D/L vcms to try. It works well on 1.98.2, but not throws an
exception on the home page. Here's the ticket details:

Traceback (most recent call last):
  File /home/guruyaya/web2py/gluon/restricted.py, line 194, in
restricted
exec ccode in environment
  File /home/guruyaya/web2py/applications/blog/controllers/
default.py, line 294, in module
  File /home/guruyaya/web2py/gluon/globals.py, line 148, in lambda
self._caller = lambda f: f()
  File /home/guruyaya/web2py/applications/blog/controllers/
default.py, line 15, in index
all_articles = db().select(db.article.ALL,
orderby=~db.article.date|~db.article.modified)
  File /home/guruyaya/web2py/gluon/dal.py, line 5697, in select
return self.db._adapter.select(self.query,fields,attributes)
  File /home/guruyaya/web2py/gluon/dal.py, line 1233, in select
rows = response(sql)
  File /home/guruyaya/web2py/gluon/dal.py, line 1223, in response
self.execute(sql)
  File /home/guruyaya/web2py/gluon/dal.py, line 1309, in execute
return self.log_execute(*a, **b)
  File /home/guruyaya/web2py/gluon/dal.py, line 1304, in log_execute
ret = self.cursor.execute(*a,**b)
  File /usr/lib/python2.7/sqlite3/dbapi2.py, line 66, in
convert_timestamp
datepart, timepart = val.split( )
ValueError: need more than 1 value to unpack

I'll give it a deeper look later.


On Sep 21, 9:04 pm, nick name i.like.privacy@gmail.com wrote:
 I've just done an hg pull -u:

 changeset:   2435:8cbfa1244549
 tag:         tip
 user:        mdipie...@massimo-di-pierros-macbook-2.local
 date:        Wed Sep 21 00:17:23 2011 -0500
 summary:     sys.exit(0), thanks Praneeth

 The README file mentions request.utcnow, but the code doesn't. So either
 the README needs a fix, or some patch was lost along the way.


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread guruyaya
This is what I got. No fix, for now.
Say you have a datetime field. The database adapter will save it as a
TIMESTAMP sqlite type.
Now if you decide you just want the date, you don't care for the time.
You change the field to be a date col. But SQLite still use the
TIMESTAMP field type. At this point, it converts timestamp to date, as
part of what the python sqlite adapter tells it to do, and that line
has a bug, that creates the ValueError.

I have no idea how 1.98.2 can go around this. It seems more an sqlite
bug, then a web2py bug. Yet - the problem remains.
Hope someone will have a better idea what's going on here.



On Sep 21, 9:29 pm, guruyaya guruy...@gmail.com wrote:
 I've just D/L vcms to try. It works well on 1.98.2, but not throws an
 exception on the home page. Here's the ticket details:

 Traceback (most recent call last):
   File /home/guruyaya/web2py/gluon/restricted.py, line 194, in
 restricted
     exec ccode in environment
   File /home/guruyaya/web2py/applications/blog/controllers/
 default.py, line 294, in module
   File /home/guruyaya/web2py/gluon/globals.py, line 148, in lambda
     self._caller = lambda f: f()
   File /home/guruyaya/web2py/applications/blog/controllers/
 default.py, line 15, in index
     all_articles = db().select(db.article.ALL,
 orderby=~db.article.date|~db.article.modified)
   File /home/guruyaya/web2py/gluon/dal.py, line 5697, in select
     return self.db._adapter.select(self.query,fields,attributes)
   File /home/guruyaya/web2py/gluon/dal.py, line 1233, in select
     rows = response(sql)
   File /home/guruyaya/web2py/gluon/dal.py, line 1223, in response
     self.execute(sql)
   File /home/guruyaya/web2py/gluon/dal.py, line 1309, in execute
     return self.log_execute(*a, **b)
   File /home/guruyaya/web2py/gluon/dal.py, line 1304, in log_execute
     ret = self.cursor.execute(*a,**b)
   File /usr/lib/python2.7/sqlite3/dbapi2.py, line 66, in
 convert_timestamp
     datepart, timepart = val.split( )
 ValueError: need more than 1 value to unpack

 I'll give it a deeper look later.

 On Sep 21, 9:04 pm, nick name i.like.privacy@gmail.com wrote:







  I've just done an hg pull -u:

  changeset:   2435:8cbfa1244549
  tag:         tip
  user:        mdipie...@massimo-di-pierros-macbook-2.local
  date:        Wed Sep 21 00:17:23 2011 -0500
  summary:     sys.exit(0), thanks Praneeth

  The README file mentions request.utcnow, but the code doesn't. So either
  the README needs a fix, or some patch was lost along the way.


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-21 Thread nick name


On Wednesday, September 21, 2011 4:16:07 PM UTC-4, guruyaya wrote:

 This is what I got. No fix, for now. 
 Say you have a datetime field. The database adapter will save it as a 
 TIMESTAMP sqlite type. 
 Now if you decide you just want the date, you don't care for the time. 
 You change the field to be a date col. But SQLite still use the 
 TIMESTAMP field type. At this point, it converts timestamp to date, as 
 part of what the python sqlite adapter tells it to do, and that line 
 has a bug, that creates the ValueError. 

 I have no idea how 1.98.2 can go around this. It seems more an sqlite 
 bug, then a web2py bug. Yet - the problem remains. 
 Hope someone will have a better idea what's going on here. 


This is the result of a change I was pushing for, which makes sqlite behave 
more like every other database - by asking it to parse the date or timestamp 
field itself, rather than return a string.

Your database itself is in a actually in an inconsistent state -- if you 
dumped it to .csv and reloaded, you will not get the same database; if you 
tried to dump and reload into Postgres, you wouid fail. The previous web2py 
behavior somehow shielded you from that, but that's sort of a lucky 
coincidence for you; If you changed the column type from a 'decimal' to an 
'int' and had float values, you'd be in the same trouble; or even worse if 
you changed from a 'string' to an 'int'.

Massimo might back the change out, but if he does not, you can force a 
return to sqlite's previous behaviour by changing from

db = DAL('sqlite:') 

to 

db = DAL('sqlite:...', driver_args={'detect_types': 0}}

Either way, I would think it's a good idea for you to make the database 
consistent -- things like this tend to byte in more than one way.


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread David Marko
Many features have been added recently(last 3 months) but documentation is 
behind these. Can docs can be updated, without this many features  will be 
lost somewhere in code. Also as Python is not staticly typed language and 
doesnt use variable type declaration its very often dificult to understand 
it without  comments in code or docs.

e.g.
Here is an example of method signature for SQLFORM.grid. It toook me some 
time to find out the format for fields parameter. I tried 
['id','name','age'], then ['db.person.id','db.person.name', 
'db-person.age'], then (db.person.id, db.person.name ...) and the latest 
worked :-) but its just guesswork. And there are many other parameters in 
this method. 

 def grid(query,
 fields=None,
 field_id=None,
 left=None,
 headers={},
 columns=None,
 orderby=None,
 searchable=True,
 sortable=True,
 paginate=20,
 deletable=True,
 editable=True,
 details=True,
 selectable=None,
 create=True,
 csv=True,
 links=None,
 upload = 'default',
 args=[],
 user_signature = True,
 maxtextlengths={},
 maxtextlength=20,
 onvalidation=None,
 oncreate=None,
 onupdate=None, 
 ondelete=None,
 sorter_icons=('[^]','[v]'),
 ui = 'jquery-ui',
 _class=web2py_grid, 
 formname='web2py_grid',
):


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread ron_m
Ran application I am working on no problems.

The welcome application seems to pull in some adware. Firebug opens in 
Firefox with a problem loading sm6.html saying _gat is not defined. I 
believe this is coming from the Share item in the top menu.

The jQuery team has released 1.6.4 to fix a bug introduced in 1.6.3 which I 
have not seen yet, I believe it manifests on IE. The version in trunk is 
1.6.3 still.

Ron


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
I forgot: it's Version 1.99.0 (2011-09-20 03:52:08)

2011/9/20 Martin Weissenboeck mweis...@gmail.com

 I wanted to play with other login methods. Therefore I created a new
 application called alt_login - it started with no problems.

 Next step: I copied the definition of my own auth_table from the book
 into alt_login.
 Here are the lines of code:


...



 Traceback (most recent call last):
   File /etc/web2py/gluon/restricted.py, line 194, in restricted


 exec ccode in environment
   File /etc/web2py/applications/alt_login/models/db.py 
 https://secure.infosms.org:8000/admin/default/edit/alt_login/models/db.py, 
 line 56, in module


 IS_NOT_EMPTY(error_message=auth.messages.is_empty)

 NameError: name 'auth_table' is not defined


 I have tried it without the line auth.define_tables() - same result.
 Any ideas?
 Regards, Martin



Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Ross Peoples
You should be using db.auth_table, not just auth_table

Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Ross Peoples
Actually, sorry, it should be db.auth_user. Where did you get the 
auth_table variable from anyways?

Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
copy and paste from the book.  :-)
Chapter Custimizing Auth

2011/9/20 Ross Peoples ross.peop...@gmail.com

 Actually, sorry, it should be db.auth_user. Where did you get the
 auth_table variable from anyways?


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Ross Peoples
The actual code from the book:

db.define_table(
auth.settings.table_user_name,
Field http://web2py.com/book/default/docstring/Field('first_name', 
length=128, default=''),
Field http://web2py.com/book/default/docstring/Field('last_name', 
length=128, default=''),
Field http://web2py.com/book/default/docstring/Field('email', length=128, 
default='', unique=True),
Field http://web2py.com/book/default/docstring/Field('password', 
'password', length=512,
  readable=False, label='Password'),
Field http://web2py.com/book/default/docstring/Field('registration_key', 
length=512,
  writable=False, readable=False, default=''),
Field 
http://web2py.com/book/default/docstring/Field('reset_password_key', 
length=512,
  writable=False, readable=False, default=''),
Field http://web2py.com/book/default/docstring/Field('registration_id', 
length=512,
  writable=False, readable=False, default=''))

custom_auth_table = db[auth.settings.table_user_name] # get the 
custom_auth_table
custom_auth_table.first_name.requires = \
  IS_NOT_EMPTY 
http://web2py.com/book/default/docstring/IS_NOT_EMPTY(error_message=auth.messages.is_empty)
custom_auth_table.last_name.requires = \
  IS_NOT_EMPTY 
http://web2py.com/book/default/docstring/IS_NOT_EMPTY(error_message=auth.messages.is_empty)
custom_auth_table.password.requires = [IS_STRONG 
http://web2py.com/book/default/docstring/IS_STRONG(), CRYPT 
http://web2py.com/book/default/docstring/CRYPT()]
custom_auth_table.email.requires = [
  IS_EMAIL 
http://web2py.com/book/default/docstring/IS_EMAIL(error_message=auth.messages.invalid_email),
  IS_NOT_IN_DB http://web2py.com/book/default/docstring/IS_NOT_IN_DB(db, 
custom_auth_table.email)]

auth.settings.table_user = custom_auth_table # tell auth to use 
custom_auth_table

# before
# auth.define_tables()


You forgot this line which creates and assigns a reference to 
custom_auth_table:

custom_auth_table = db[auth.settings.table_user_name] # get the 
custom_auth_table



[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Anthony
+1 for more comments in the code. Also, sometimes comments/docstrings need 
to be updated when changes are made.

On Tuesday, September 20, 2011 3:55:24 AM UTC-4, David Marko wrote:

 Many features have been added recently(last 3 months) but documentation is 
 behind these. Can docs can be updated, without this many features  will be 
 lost somewhere in code. Also as Python is not staticly typed language and 
 doesnt use variable type declaration its very often dificult to understand 
 it without  comments in code or docs.

 e.g.
 Here is an example of method signature for SQLFORM.grid. It toook me some 
 time to find out the format for fields parameter. I tried 
 ['id','name','age'], then ['db.person.id','db.person.name', 
 'db-person.age'], then (db.person.id, db.person.name ...) and the latest 
 worked :-) but its just guesswork. And there are many other parameters in 
 this method. 

  def grid(query,
  fields=None,
  field_id=None,
  left=None,
  headers={},
  columns=None,
  orderby=None,
  searchable=True,
  sortable=True,
  paginate=20,
  deletable=True,
  editable=True,
  details=True,
  selectable=None,
  create=True,
  csv=True,
  links=None,
  upload = 'default',
  args=[],
  user_signature = True,
  maxtextlengths={},
  maxtextlength=20,
  onvalidation=None,
  oncreate=None,
  onupdate=None, 
  ondelete=None,
  sorter_icons=('[^]','[v]'),
  ui = 'jquery-ui',
  _class=web2py_grid, 
  formname='web2py_grid',
 ):



Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Furqan Rauf
so is there anyone who is in charge of updating the book? Massimo is already
doing too much?

On Tue, Sep 20, 2011 at 8:23 AM, Anthony abasta...@gmail.com wrote:

 +1 for more comments in the code. Also, sometimes comments/docstrings need
 to be updated when changes are made.


 On Tuesday, September 20, 2011 3:55:24 AM UTC-4, David Marko wrote:

 Many features have been added recently(last 3 months) but documentation is
 behind these. Can docs can be updated, without this many features  will be
 lost somewhere in code. Also as Python is not staticly typed language and
 doesnt use variable type declaration its very often dificult to understand
 it without  comments in code or docs.

 e.g.
 Here is an example of method signature for SQLFORM.grid. It toook me some
 time to find out the format for fields parameter. I tried
 ['id','name','age'], then 
 ['db.person.id','db.person.**namehttp://db.person.name',
 'db-person.age'], then (db.person.id, db.person.name ...) and the latest
 worked :-) but its just guesswork. And there are many other parameters in
 this method.

  def grid(query,
  fields=None,
  field_id=None,
  left=None,
  headers={},
  columns=None,
  orderby=None,
  searchable=True,
  sortable=True,
  paginate=20,
  deletable=True,
  editable=True,
  details=True,
  selectable=None,
  create=True,
  csv=True,
  links=None,
  upload = 'default',
  args=[],
  user_signature = True,
  maxtextlengths={},
  maxtextlength=20,
  onvalidation=None,
  oncreate=None,
  onupdate=None,
  ondelete=None,
  sorter_icons=('[^]','[v]'),
  ui = 'jquery-ui',
  _class=web2py_grid,
  formname='web2py_grid',
 ):




-- 
*-Furqan Rauf*
*Do you love your creator? Love your fellow-beings first. -Prophet Muhammad
*
*http://www.amway.com/furqanrauf*


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Richard Vézina
It seems like it's the most stable release that's coming ;-)

Richard



On Tue, Sep 20, 2011 at 9:23 AM, Anthony abasta...@gmail.com wrote:

 +1 for more comments in the code. Also, sometimes comments/docstrings need
 to be updated when changes are made.


 On Tuesday, September 20, 2011 3:55:24 AM UTC-4, David Marko wrote:

 Many features have been added recently(last 3 months) but documentation is
 behind these. Can docs can be updated, without this many features  will be
 lost somewhere in code. Also as Python is not staticly typed language and
 doesnt use variable type declaration its very often dificult to understand
 it without  comments in code or docs.

 e.g.
 Here is an example of method signature for SQLFORM.grid. It toook me some
 time to find out the format for fields parameter. I tried
 ['id','name','age'], then 
 ['db.person.id','db.person.**namehttp://db.person.name',
 'db-person.age'], then (db.person.id, db.person.name ...) and the latest
 worked :-) but its just guesswork. And there are many other parameters in
 this method.

  def grid(query,
  fields=None,
  field_id=None,
  left=None,
  headers={},
  columns=None,
  orderby=None,
  searchable=True,
  sortable=True,
  paginate=20,
  deletable=True,
  editable=True,
  details=True,
  selectable=None,
  create=True,
  csv=True,
  links=None,
  upload = 'default',
  args=[],
  user_signature = True,
  maxtextlengths={},
  maxtextlength=20,
  onvalidation=None,
  oncreate=None,
  onupdate=None,
  ondelete=None,
  sorter_icons=('[^]','[v]'),
  ui = 'jquery-ui',
  _class=web2py_grid,
  formname='web2py_grid',
 ):




Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
Thank you - now it works.
But: maybe there are two versions of THE BOOK?

Five minutes ago I have found the following code in the online version
(chapter Customizing Auth):

# after
# auth = Auth(globals(),db)

db.define_table(
   auth.settings.table_user_name,
Field('first_name', length=128, default=''),
Field('last_name', length=128, default=''),
Field('email', length=128, default='', unique=True),
Field('password', 'password', length=512,
   readable=False, label='Password'),
Field('registration_key', length=512,
   writable=False, readable=False, default=''),
Field('reset_password_key', length=512,
   writable=False, readable=False, default=''),
Field('registration_id', length=512,
   writable=False, readable=False, default=''))

auth_table.first_name.requires = \
   IS_NOT_EMPTY(error_message=auth.messages.is_empty)
auth_table.last_name.requires = \
   IS_NOT_EMPTY(error_message=auth.messages.is_empty)
auth_table.password.requires = [IS_STRONG(), CRYPT()]
auth_table.email.requires = [
   IS_EMAIL(error_message=auth.messages.invalid_email),
   IS_NOT_IN_DB(db, auth_table.email)]
auth.settings.table_user = auth_table

# before
# auth.define_tables()

Where did you find your code?
Martin


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Ross Peoples
The code I posted is from here:

http://web2py.com/book/default/chapter/08#Customizing-Auth


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Anthony
Weird, I see different code when visiting that link. Are you looking at the 
English version?

On Tuesday, September 20, 2011 11:47:11 AM UTC-4, Ross Peoples wrote:

 The code I posted is from here:

 http://web2py.com/book/default/chapter/08#Customizing-Auth



Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
My link is http://www.web2py.com/book/default/chapter/08#Customizing-Auth(it
is the same!) I have tried twice with two different browsers.



2011/9/20 Anthony abasta...@gmail.com

 Here's what I see at
 http://web2py.com/book/default/chapter/08#Customizing-Auth (screenshot
 attached) -- not the same as what you have pasted below.

 What URL are you accessing?

 Anthony

 On Tuesday, September 20, 2011 11:27:36 AM UTC-4, mweissen wrote:

 Thank you - now it works.
 But: maybe there are two versions of THE BOOK?

 Five minutes ago I have found the following code in the online version
 (chapter Customizing Auth):

 # after
 # auth = Auth(globals(),db)

 db.define_table(
auth.settings.table_user_name,
 Field('first_name', length=128, default=''),
 Field('last_name', length=128, default=''),
 Field('email', length=128, default='', unique=True),
 Field('password', 'password', length=512,
readable=False, label='Password'),
 Field('registration_key', length=512,
writable=False, readable=False, default=''),
 Field('reset_password_key', length=512,
writable=False, readable=False, default=''),
 Field('registration_id', length=512,
writable=False, readable=False, default=''))

 auth_table.first_name.requires = \
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
 auth_table.last_name.requires = \
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
 auth_table.password.requires = [IS_STRONG(), CRYPT()]
 auth_table.email.requires = [
IS_EMAIL(error_message=auth.messages.invalid_email),
IS_NOT_IN_DB(db, auth_table.email)]
 auth.settings.table_user = auth_table

 # before
 # auth.define_tables()

 Where did you find your code?
 Martin




[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Massimo Di Pierro
Yes. There are different versions depending on the accept_language
browser settings. Problem is that non-english one that have not been
translated default to engllish.
The title should tell you which one you are looking at.

On Sep 20, 11:10 am, Martin Weissenboeck mweis...@gmail.com wrote:
 My link ishttp://www.web2py.com/book/default/chapter/08#Customizing-Auth(it
 is the same!) I have tried twice with two different browsers.

 2011/9/20 Anthony abasta...@gmail.com







  Here's what I see at
 http://web2py.com/book/default/chapter/08#Customizing-Auth(screenshot
  attached) -- not the same as what you have pasted below.

  What URL are you accessing?

  Anthony

  On Tuesday, September 20, 2011 11:27:36 AM UTC-4, mweissen wrote:

  Thank you - now it works.
  But: maybe there are two versions of THE BOOK?

  Five minutes ago I have found the following code in the online version
  (chapter Customizing Auth):

  # after
  # auth = Auth(globals(),db)

  db.define_table(
     auth.settings.table_user_name,
  Field('first_name', length=128, default=''),
  Field('last_name', length=128, default=''),
  Field('email', length=128, default='', unique=True),
  Field('password', 'password', length=512,
     readable=False, label='Password'),
  Field('registration_key', length=512,
     writable=False, readable=False, default=''),
  Field('reset_password_key', length=512,
     writable=False, readable=False, default=''),
  Field('registration_id', length=512,
     writable=False, readable=False, default=''))

  auth_table.first_name.requires = \
     IS_NOT_EMPTY(error_message=auth.messages.is_empty)
  auth_table.last_name.requires = \
     IS_NOT_EMPTY(error_message=auth.messages.is_empty)
  auth_table.password.requires = [IS_STRONG(), CRYPT()]
  auth_table.email.requires = [
     IS_EMAIL(error_message=auth.messages.invalid_email),
     IS_NOT_IN_DB(db, auth_table.email)]
  auth.settings.table_user = auth_table

  # before
  # auth.define_tables()

  Where did you find your code?
  Martin


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
That is the headline of the first page:

The Official (3rd Ed.)
web2py Book(de)

Does de mean German? But there is no German word inside this book.
And I cann't find any way to change the language.



2011/9/20 Anthony abasta...@gmail.com

 Weird, I see different code when visiting that link. Are you looking at the
 English version?


 On Tuesday, September 20, 2011 11:47:11 AM UTC-4, Ross Peoples wrote:

 The code I posted is from here:

 http://web2py.com/book/default/chapter/08#Customizing-Auth




Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
That is the answer. Now I switched to en and I can see the actual version
of this example.

2011/9/20 Massimo Di Pierro massimo.dipie...@gmail.com

 Yes. There are different versions depending on the accept_language
 browser settings. Problem is that non-english one that have not been
 translated default to engllish.
 The title should tell you which one you are looking at.

 On Sep 20, 11:10 am, Martin Weissenboeck mweis...@gmail.com wrote:
  My link ishttp://
 www.web2py.com/book/default/chapter/08#Customizing-Auth(it
  is the same!) I have tried twice with two different browsers.
 
  2011/9/20 Anthony abasta...@gmail.com
 
 
 
 
 
 
 
   Here's what I see at
  http://web2py.com/book/default/chapter/08#Customizing-Auth(screenshot
   attached) -- not the same as what you have pasted below.
 
   What URL are you accessing?
 
   Anthony
 
   On Tuesday, September 20, 2011 11:27:36 AM UTC-4, mweissen wrote:
 
   Thank you - now it works.
   But: maybe there are two versions of THE BOOK?
 
   Five minutes ago I have found the following code in the online version
   (chapter Customizing Auth):
 
   # after
   # auth = Auth(globals(),db)
 
   db.define_table(
  auth.settings.table_user_name,
   Field('first_name', length=128, default=''),
   Field('last_name', length=128, default=''),
   Field('email', length=128, default='', unique=True),
   Field('password', 'password', length=512,
  readable=False, label='Password'),
   Field('registration_key', length=512,
  writable=False, readable=False, default=''),
   Field('reset_password_key', length=512,
  writable=False, readable=False, default=''),
   Field('registration_id', length=512,
  writable=False, readable=False, default=''))
 
   auth_table.first_name.requires = \
  IS_NOT_EMPTY(error_message=auth.messages.is_empty)
   auth_table.last_name.requires = \
  IS_NOT_EMPTY(error_message=auth.messages.is_empty)
   auth_table.password.requires = [IS_STRONG(), CRYPT()]
   auth_table.email.requires = [
  IS_EMAIL(error_message=auth.messages.invalid_email),
  IS_NOT_IN_DB(db, auth_table.email)]
   auth.settings.table_user = auth_table
 
   # before
   # auth.define_tables()
 
   Where did you find your code?
   Martin



Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Anthony
On Tuesday, September 20, 2011 12:28:48 PM UTC-4, mweissen wrote:

 That is the headline of the first page:

 The Official (3rd Ed.)
 web2py Book(de)

 Does de mean German? But there is no German word inside this book. 
 And I cann't find any way to change the language.


A number of people have been reporting odd problems with the online book and 
language settings. I and others were randomly be shown the book with French 
text (even though the title said web2py Book(en)). Now you have the German 
version of the book, but with English text. What's going on?

Anthony


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Massimo Di Pierro

At some point we made the book multi-language. That means that the
book detects the language from accept_language and uses that. 8
languages were created (en, es, de, fr, pt, jp, cz, it) and pre
populated with english (official 3rd ed, except for it pre populated
with italian) to easy translation. People did not check their browser
settings and the language (stated at the top of the book) and have
edited the different languages. This is a recent problem (less than
1mo). I have now frozen all translations and they will stay frozen
until I process the 4th edition. I will diff everything to make sure
no edit gets lost.

Massimo


On Sep 20, 1:10 pm, Anthony abasta...@gmail.com wrote:
 On Tuesday, September 20, 2011 12:28:48 PM UTC-4, mweissen wrote:

  That is the headline of the first page:

  The Official (3rd Ed.)
  web2py Book(de)

  Does de mean German? But there is no German word inside this book.
  And I cann't find any way to change the language.

 A number of people have been reporting odd problems with the online book and
 language settings. I and others were randomly be shown the book with French
 text (even though the title said web2py Book(en)). Now you have the German
 version of the book, but with English text. What's going on?

 Anthony


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread juanduke
Some weeks ago, I reported here some typo related with validators. Someone 
tell me that the typo has been corrected, but when I check again the book, 
the typo still there.

PS: And I see Book (es) but fully english lang

HTH

Bye, and sorry for my bad english


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Anthony
On Tuesday, September 20, 2011 2:29:08 PM UTC-4, juanduke wrote:

 Some weeks ago, I reported here some typo related with validators. Someone 
 tell me that the typo has been corrected, but when I check again the book, 
 the typo still there.


Yes, the typos have been fixed in the markmin but are not showing up because 
of the problems Massimo mentioned. Hopefully this will all be resolved soon.

Anthony



[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Massimo Di Pierro
This is a commit error. Will fix in a few hours when I will have
access to my dev machine again. Sorry.

On Sep 20, 2:56 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 On Tue, Sep 20, 2011 at 12:00 AM, Massimo Di Pierro 

 massimo.dipie...@gmail.com wrote:
  Please download the nightly built and try it with your apps. If they
  work, say go and I we will launch tomorrow.

 I ran in to this:

 Traceback (most recent call last):

   File /home/rochacbruno/projects/199test/gluon/restricted.py, line
 194, in restricted

     exec ccode in environment

   File 
 /home/rochacbruno/projects/199test/applications/rifaapp/controllers/defaul 
 t.py
 http://127.0.0.1:8001/admin/default/edit/rifaapp/controllers/default.py,
 line 755, in module

   File /home/rochacbruno/projects/199test/gluon/globals.py, line
 148, in lambda

     self._caller = lambda f: f()

   File 
 /home/rochacbruno/projects/199test/applications/rifaapp/controllers/defaul 
 t.py
 http://127.0.0.1:8001/admin/default/edit/rifaapp/controllers/default.py,
 line 618, in user

     return dict(form=auth())

   File /home/rochacbruno/projects/199test/gluon/tools.py, line 1125,
 in __call__

     return getattr(self,args[0])()

   File /home/rochacbruno/projects/199test/gluon/tools.py, line 1868,
 in register

     next = replace_id(next, form)

   File /home/rochacbruno/projects/199test/gluon/tools.py, line 74,
 in replace_id

     if url and not url[0] == '/' and url[:4] != 'http':

 NameError: global name 'url' is not defined


[web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread kasapo
Yes, sometimes when I do google searches it seems to find the code i
search for in the french version (since the code is still english...
like searching for response.vars or something), but there is a
variable ?_language=fr in the URL.

After accessing a page (creating a session?) with the 'fr' param for
language, I find that visiting web2py.com/book renders the whole book
in french, until I manually type _language=en back into the address
bar.

That switches it back to english.


On Sep 20, 1:10 pm, Anthony abasta...@gmail.com wrote:
 On Tuesday, September 20, 2011 12:28:48 PM UTC-4, mweissen wrote:

  That is the headline of the first page:

  The Official (3rd Ed.)
  web2py Book(de)

  Does de mean German? But there is no German word inside this book.
  And I cann't find any way to change the language.

 A number of people have been reporting odd problems with the online book and
 language settings. I and others were randomly be shown the book with French
 text (even though the title said web2py Book(en)). Now you have the German
 version of the book, but with English text. What's going on?

 Anthony


Re: [web2py] Re: Are we ready to launch 1.99.1?

2011-09-20 Thread Martin Weissenboeck
In gloun/tools there is the definition of class Recaptcha.
It contains a class variable
self.comment = ''
but there is no way to change by a parameter. Is it intended or is it a bug?

Martin