[web2py] web2py rocket error on vps

2010-07-31 Thread Johan
Hello. I'm new here.
I just bought a vps at intovps.com , I installed archlinux on it with
everything that I'm used to work with, and tried launching web2py, but
to no avail.

$ python web2py.py --nogui --password="a" --port="55000"

web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.81.5 (2010-07-22 17:51:19)
Database drivers available: SQLite3, PostgreSQL
Starting hardcron...
please visit:
http://127.0.0.1:55000
use "kill -SIGTERM 24238" to shutdown the web2py server
Traceback (most recent call last):
  File "web2py.py", line 20, in 
gluon.widget.start(cron=True)
  File "/home/johan/web2py/gluon/widget.py", line 875, in start
server.start()
  File "/home/johan/web2py/gluon/main.py", line 683, in start
self.server.start()
  File "/home/johan/web2py/gluon/rocket.py", line 208, in start
self._threadpool.start()
  File "/home/johan/web2py/gluon/rocket.py", line 547, in start
thread.start()
  File "/usr/lib/python2.6/threading.py", line 474, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread


It seems that there is a problem with threads on the python
installation.
But I ran a simple threading test and it worked
Any ideas?


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Armin Ronacher
Hi,

On Jul 31, 2:38 am, Scott  wrote:
> I do not agree with item 1.  Session data should never be stored
> client-side as it opens a rather large attack vector.
Which attack vector exists for signed cookies with a signed timeout
compared to just session IDs in cookies? Both can be hijacked by a man
in the middle.


Regards,
Armin


[web2py] App Migration

2010-07-31 Thread Chase Lee
What's the process for migrating an app from one host to another or
from localhost to a hosted environment?

Thanks


[web2py] MongoDb and web2py

2010-07-31 Thread Amit Ambardekar
I want to use web2py with pymongo.
I don't need ORM or or anything. I just want to connect use pymongo
from Web2Py.
How can I use it inside web2py. I need it for high performance use.

Amit


[web2py] Re: plugin_wiki - how to define the target to an external link?

2010-07-31 Thread mdipierro
edit models/plugin_wiki.py

there is a place with
extra[...]=
extra[...]=
extra[...]=
extra[...]=

append

extra['link_target_blank']=lambda x: '%s' % (x.rsplit(' ',1)[1],x.rsplit(' ',1)[0])

On Jul 30, 10:38 pm, Bruno Rocha  wrote:
> As i really didn't figure out how to implement what you propose, I decided
> to do it in the wrong way:
>
> in meta-code I defined:
>
> def elink(text,url,target='_blank'):
>     """
>     >>>elink('Google','http://google.com')
>     'Google'
>     >>>elink('Google','http://google.com','_self')
>     'Google'
>     """
>     return XML("%s" %
> (url,text,target,text))
>
> and in my wiki-page:
>
> - ``{{=elink('Python para Desenvolvedores','http://migre.me/RdTv
> ','_blank')}}``:template
>
> which returns:
>
> http://migre.me/RdTvhttp://migre.me/RdTv>"
> alt="Python para Desenvolvedores" target="_blank">Python para
> Desenvolvedores
>
> I Know it is bad and ugly, but I have to save time now, later I will try to
> do what you said.
>
> Tks
>
> 2010/7/30 mdipierro 
>
>
>
> > You can use the extra parameters to define behaviour yourself
>
> > ``linkhttp://``:link_target_blank
>
> > extra = {'link_target_blank':lambda x: '
> > %s' % (x.rsplit(' ',1)[1],x.rsplit(' ',1)[0])
>
> > On Jul 29, 8:46 pm, Bruno Rocha  wrote:
> > > Any way to define the target="_blank" for  [["a link"http://someurl.com
> > ]]
>
> > > any way like this: [["a link"http://someurl.com"_blank";]] ???
>
> > > --
>
> > >http://rochacbruno.com.br
>
> --
>
> http://rochacbruno.com.br


[web2py] Re: fun with metaclasses

2010-07-31 Thread mdipierro
It was a toy example. this will not be in web2py.
As far as the book goes, I will see what I can do.

Massimo

On Jul 30, 9:32 pm, Jonathan Lundell  wrote:
> On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
>
>
>
> > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
> >> On Jul 30, 2010, at 9:19 AM, VP wrote:
> >>> On Jul 30, 9:35 am, mdipierro  wrote:
> http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>
> >>> This is really nice.  Please do more of this.
>
> >> My initial reaction is the opposite. The result might be more readable, 
> >> but it doesn't strike me as more writable.
>
> >> What would be most helpful for me would be a deeper explanation (in the 
> >> book) of what's going on behind the existing DAL "magic" syntax, rather 
> >> than adding yet another layer of magic.
>
> > You make a good point, Jonathan. And I think there is a underlying
> > question here. Which kind of audience is web2py targeting to?  If for
> > developers, the existing DAL syntax is already powerful and magical
> > enough (the document is also good, here it 
> > is.http://web2py.com/book/default/chapter/06
> > ). Developers don't need another layer which is more fancy but not
> > more powerful.
>
> I'm not satisfied with the treatment in the book. I'd like to see each of the 
> DAL objects more completely described, especially as to the underlying Python 
> types and the operations that they implicitly support. Several of them IIRC 
> are polymorphic wrt their argument types, and you either have to divine this 
> telepathically or read the source in detail. Likewise operator overloading.
>
> I'm sure it's second nature to Massimo, but for most of us, we have to hunt 
> around for an example that matches our situation, and blindly copy & paste. 
> Either that or experiment until it stops raising exceptions


[web2py] Re: block problem in 1.81.5

2010-07-31 Thread mdipierro
?

On Jul 31, 1:02 am, BearXu  wrote:
> report block is not defined


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread mdipierro
There is a difference.

If you have a uuid sessions cookie and a serverside session and an
attacker hijacks the cookie, he can only get access to the account of
the compromised user.

If the session is stored client side and the attackers hijacks the
cookie, he can tamper with the data in the session and, depending on
what the session cookie stores, may get access to more than data of
the compromised user.

Massimo

On Jul 31, 1:58 am, Armin Ronacher 
wrote:
> Hi,
>
> On Jul 31, 2:38 am, Scott  wrote:> I do not agree with 
> item 1.  Session data should never be stored
> > client-side as it opens a rather large attack vector.
>
> Which attack vector exists for signed cookies with a signed timeout
> compared to just session IDs in cookies? Both can be hijacked by a man
> in the middle.
>
> Regards,
> Armin


[web2py] Re: MongoDb and web2py

2010-07-31 Thread mdipierro
yes. Just set dbio=False in forms and do your own mymongo IO after
accepts:

On Jul 30, 11:18 am, Amit Ambardekar  wrote:
> I want to use web2py with pymongo.
> I don't need ORM or or anything. I just want to connect use pymongo
> from Web2Py.
> How can I use it inside web2py. I need it for high performance use.
>
> Amit


[web2py] Re: App Migration

2010-07-31 Thread mdipierro
>From admin click on [pack app] and on the other host admin upload the
generated w2p file.

Alteranatively

host1:/web2py/applications> zip -r myapp.zip myapp
host1:/web2py/applications> scp myapp.zip y...@host2:/
host1:/web2py/applications> ssh y...@host2
host2:/web2py/applications> sudo -u www-data bash
host2:/web2py/applications> cd /where/it/is/web2py/applications
host2:/web2py/applications> unzip ~you/web2py.zip









On Jul 31, 12:46 am, Chase Lee  wrote:
> What's the process for migrating an app from one host to another or
> from localhost to a hosted environment?
>
> Thanks


[web2py] Re: web2py rocket error on vps

2010-07-31 Thread mdipierro
which python version?

On Jul 30, 11:41 am, Johan  wrote:
> Hello. I'm new here.
> I just bought a vps at intovps.com , I installed archlinux on it with
> everything that I'm used to work with, and tried launching web2py, but
> to no avail.
>
> $ python web2py.py --nogui --password="a" --port="55000"
>
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.81.5 (2010-07-22 17:51:19)
> Database drivers available: SQLite3, PostgreSQL
> Starting hardcron...
> please visit:
>        http://127.0.0.1:55000
> use "kill -SIGTERM 24238" to shutdown the web2py server
> Traceback (most recent call last):
>   File "web2py.py", line 20, in 
>     gluon.widget.start(cron=True)
>   File "/home/johan/web2py/gluon/widget.py", line 875, in start
>     server.start()
>   File "/home/johan/web2py/gluon/main.py", line 683, in start
>     self.server.start()
>   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
>     self._threadpool.start()
>   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
>     thread.start()
>   File "/usr/lib/python2.6/threading.py", line 474, in start
>     _start_new_thread(self.__bootstrap, ())
> thread.error: can't start new thread
>
> It seems that there is a problem with threads on the python
> installation.
> But I ran a simple threading test and it worked
> Any ideas?


[web2py] Re: MongoDb and web2py

2010-07-31 Thread David Marko
Hi Massimo, can you give ua a hint how to impelement persistent
connection in web2py for pyMongo? PyMongo requires database connection
and to use it efficiently the connection has to be persistent and
shared among requests like a connection pool for database connections
as DAL has. But how to do it in web2py?

e.g.
from pymongo import Connection
connection = Connection('localhost', 27017)

### how to keep this connection object?

David


On 31 čnc, 09:57, mdipierro  wrote:
> yes. Just set dbio=False in forms and do your own mymongo IO after
> accepts:
>
> On Jul 30, 11:18 am, Amit Ambardekar  wrote:
>
>
>
> > I want to use web2py with pymongo.
> > I don't need ORM or or anything. I just want to connect use pymongo
> > from Web2Py.
> > How can I use it inside web2py. I need it for high performance use.
>
> > Amit


[web2py] Re: MongoDb and web2py

2010-07-31 Thread mdipierro
how about this? (None below means cache forever)

def make_connection():
from pymongo import Connection
connection = Connection('localhost', 27017)
return connection

connection = cache.ram('mongodb',make_connection,None)



On Jul 31, 3:11 am, David Marko  wrote:
> Hi Massimo, can you give ua a hint how to impelement persistent
> connection in web2py for pyMongo? PyMongo requires database connection
> and to use it efficiently the connection has to be persistent and
> shared among requests like a connection pool for database connections
> as DAL has. But how to do it in web2py?
>
> e.g.
> from pymongo import Connection
> connection = Connection('localhost', 27017)
>
> ### how to keep this connection object?
>
> David
>
> On 31 čnc, 09:57, mdipierro  wrote:
>
> > yes. Just set dbio=False in forms and do your own mymongo IO after
> > accepts:
>
> > On Jul 30, 11:18 am, Amit Ambardekar  wrote:
>
> > > I want to use web2py with pymongo.
> > > I don't need ORM or or anything. I just want to connect use pymongo
> > > from Web2Py.
> > > How can I use it inside web2py. I need it for high performance use.
>
> > > Amit


[web2py] Re: web2py rocket error on vps

2010-07-31 Thread Johan
I'm using python 2.6.5

On 31 iul., 11:00, mdipierro  wrote:
> which python version?
>
> On Jul 30, 11:41 am, Johan  wrote:
>
>
>
> > Hello. I'm new here.
> > I just bought a vps at intovps.com , I installed archlinux on it with
> > everything that I'm used to work with, and tried launching web2py, but
> > to no avail.
>
> > $ python web2py.py --nogui --password="a" --port="55000"
>
> > web2py Enterprise Web Framework
> > Created by Massimo Di Pierro, Copyright 2007-2010
> > Version 1.81.5 (2010-07-22 17:51:19)
> > Database drivers available: SQLite3, PostgreSQL
> > Starting hardcron...
> > please visit:
> >        http://127.0.0.1:55000
> > use "kill -SIGTERM 24238" to shutdown the web2py server
> > Traceback (most recent call last):
> >   File "web2py.py", line 20, in 
> >     gluon.widget.start(cron=True)
> >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> >     server.start()
> >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> >     self.server.start()
> >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> >     self._threadpool.start()
> >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> >     thread.start()
> >   File "/usr/lib/python2.6/threading.py", line 474, in start
> >     _start_new_thread(self.__bootstrap, ())
> > thread.error: can't start new thread
>
> > It seems that there is a problem with threads on the python
> > installation.
> > But I ran a simple threading test and it worked
> > Any ideas?


[web2py] Re: web2py rocket error on vps

2010-07-31 Thread mdipierro
Can you try with the -N option?

On Jul 31, 3:20 am, Johan  wrote:
> I'm using python 2.6.5
>
> On 31 iul., 11:00, mdipierro  wrote:
>
> > which python version?
>
> > On Jul 30, 11:41 am, Johan  wrote:
>
> > > Hello. I'm new here.
> > > I just bought a vps at intovps.com , I installed archlinux on it with
> > > everything that I'm used to work with, and tried launching web2py, but
> > > to no avail.
>
> > > $ python web2py.py --nogui --password="a" --port="55000"
>
> > > web2py Enterprise Web Framework
> > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > Version 1.81.5 (2010-07-22 17:51:19)
> > > Database drivers available: SQLite3, PostgreSQL
> > > Starting hardcron...
> > > please visit:
> > >        http://127.0.0.1:55000
> > > use "kill -SIGTERM 24238" to shutdown the web2py server
> > > Traceback (most recent call last):
> > >   File "web2py.py", line 20, in 
> > >     gluon.widget.start(cron=True)
> > >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> > >     server.start()
> > >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> > >     self.server.start()
> > >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> > >     self._threadpool.start()
> > >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> > >     thread.start()
> > >   File "/usr/lib/python2.6/threading.py", line 474, in start
> > >     _start_new_thread(self.__bootstrap, ())
> > > thread.error: can't start new thread
>
> > > It seems that there is a problem with threads on the python
> > > installation.
> > > But I ran a simple threading test and it worked
> > > Any ideas?


[web2py] Re: Redirect status of redirects via routes.py

2010-07-31 Thread ma...@rockiger.com
ok, I understand.

Then what is better:
handle the redirects via htaccess or via a web2py solution?

Any experience with that?

On Jul 29, 11:58 pm, mdipierro  wrote:
> None of them.
>
> routes_in does not generates a response. The map is done internally
> before dispatching. web2py only sees the new url, not the old one.
>
> On Jul 29, 3:58 am, "ma...@rockiger.com" 
> wrote:
>
>
>
> > If I rewrite an old url to a new one inroutes.py:
> > What is the response? A 301(permanent) or a 302 (temporary)?
>
> > I ask this question, because Google don't like temporary redirects
> > and I don't want to mess with my Apache configuration if I can
> > do the redirects with web2py.
>
> > Thanks,
> > Marco


[web2py] Re: web2py rocket error on vps

2010-07-31 Thread Johan
I tried with -N 1, 2, 3, etc., same error message.

On a side note: I configured web2py to work with apache and mod_wsgi,
it works , but I noticed an exception in the apache error_log

[error] Exception KeyError: KeyError(-1211209984,) in  ignored

It doesn't seem to affect web2py, but I'm not sure that it won't cause
a problem in the future.
It may be related to the problem above.


On 31 iul., 11:27, mdipierro  wrote:
> Can you try with the -N option?
>
> On Jul 31, 3:20 am, Johan  wrote:
>
>
>
> > I'm using python 2.6.5
>
> > On 31 iul., 11:00, mdipierro  wrote:
>
> > > which python version?
>
> > > On Jul 30, 11:41 am, Johan  wrote:
>
> > > > Hello. I'm new here.
> > > > I just bought a vps at intovps.com , I installed archlinux on it with
> > > > everything that I'm used to work with, and tried launching web2py, but
> > > > to no avail.
>
> > > > $ python web2py.py --nogui --password="a" --port="55000"
>
> > > > web2py Enterprise Web Framework
> > > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > > Version 1.81.5 (2010-07-22 17:51:19)
> > > > Database drivers available: SQLite3, PostgreSQL
> > > > Starting hardcron...
> > > > please visit:
> > > >        http://127.0.0.1:55000
> > > > use "kill -SIGTERM 24238" to shutdown the web2py server
> > > > Traceback (most recent call last):
> > > >   File "web2py.py", line 20, in 
> > > >     gluon.widget.start(cron=True)
> > > >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> > > >     server.start()
> > > >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> > > >     self.server.start()
> > > >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> > > >     self._threadpool.start()
> > > >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> > > >     thread.start()
> > > >   File "/usr/lib/python2.6/threading.py", line 474, in start
> > > >     _start_new_thread(self.__bootstrap, ())
> > > > thread.error: can't start new thread
>
> > > > It seems that there is a problem with threads on the python
> > > > installation.
> > > > But I ran a simple threading test and it worked
> > > > Any ideas?


[web2py] posiible on register form

2010-07-31 Thread Frank
hi,
I just found when I set auth.settings.formstyle = 'divs'in welcome app of
1.81.5,the last line of register form wired change.

it also break my app by changing submit buttom to top of from,when I change back
to 'table3cols', things are fine.

Thanks,

Frank



[web2py] Re: web2py rocket error on vps

2010-07-31 Thread mdipierro
I have never seen this before but it seems something is wrong in the
threading module in python 2.6.5.
Has anybody else seen this with other Python versions?

On Jul 31, 3:49 am, Johan  wrote:
> I tried with -N 1, 2, 3, etc., same error message.
>
> On a side note: I configured web2py to work with apache and mod_wsgi,
> it works , but I noticed an exception in the apache error_log
>
> [error] Exception KeyError: KeyError(-1211209984,) in  'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
>
> It doesn't seem to affect web2py, but I'm not sure that it won't cause
> a problem in the future.
> It may be related to the problem above.
>
> On 31 iul., 11:27, mdipierro  wrote:
>
> > Can you try with the -N option?
>
> > On Jul 31, 3:20 am, Johan  wrote:
>
> > > I'm using python 2.6.5
>
> > > On 31 iul., 11:00, mdipierro  wrote:
>
> > > > which python version?
>
> > > > On Jul 30, 11:41 am, Johan  wrote:
>
> > > > > Hello. I'm new here.
> > > > > I just bought a vps at intovps.com , I installed archlinux on it with
> > > > > everything that I'm used to work with, and tried launching web2py, but
> > > > > to no avail.
>
> > > > > $ python web2py.py --nogui --password="a" --port="55000"
>
> > > > > web2py Enterprise Web Framework
> > > > > Created by Massimo Di Pierro, Copyright 2007-2010
> > > > > Version 1.81.5 (2010-07-22 17:51:19)
> > > > > Database drivers available: SQLite3, PostgreSQL
> > > > > Starting hardcron...
> > > > > please visit:
> > > > >        http://127.0.0.1:55000
> > > > > use "kill -SIGTERM 24238" to shutdown the web2py server
> > > > > Traceback (most recent call last):
> > > > >   File "web2py.py", line 20, in 
> > > > >     gluon.widget.start(cron=True)
> > > > >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> > > > >     server.start()
> > > > >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> > > > >     self.server.start()
> > > > >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> > > > >     self._threadpool.start()
> > > > >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> > > > >     thread.start()
> > > > >   File "/usr/lib/python2.6/threading.py", line 474, in start
> > > > >     _start_new_thread(self.__bootstrap, ())
> > > > > thread.error: can't start new thread
>
> > > > > It seems that there is a problem with threads on the python
> > > > > installation.
> > > > > But I ran a simple threading test and it worked
> > > > > Any ideas?


[web2py] Add name attribute to the form

2010-07-31 Thread Neveen Adel
Hello,

i want to make the generated html form to have name attribute.

in controller we write : form = SQLFORM(.) and then form is
translated to html code.

Is there an attribute that make the generated html code of the form
has attribute name?
e.g:
   <-- that what i want to do

Thanks in Advance

Neveen



[web2py] Re: Ladies and Gentelmen... the web2py book is online

2010-07-31 Thread LordMax
HI

I'll see some images not rendered.

for example on http://web2py.com/book/default/chapter/01#Model-View-Controller

On source page they are linked like:
/book2/static/book_images_png/MVC.png

but I think they must be:
http://web2py.com/book/default/static/book_images_png/MVC.png


on login.
I cant' register myself with gmail.
It say: Invalid argument: token_url domain not in whitelist

Tha same with myopenid and yahoo

Thanks



[web2py] Re: web2py rocket error on vps

2010-07-31 Thread Graham Dumpleton
Did you actually try Googling for it?

Python 2.6.5 and 3.1.2 (???) made a change to C api behaviour.

The message is harmless all the same.

Upgrade to mod_wsgi 3.3 where the message has been suppressed.

Go read ticket 197 on mod_wsgi site and read mod_wsgi release notes
for version 3.3.

Graham


On Jul 31, 7:18 pm, mdipierro  wrote:
> I have never seen this before but it seems something is wrong in the
> threading module in python 2.6.5.
> Has anybody else seen this with other Python versions?
>
> On Jul 31, 3:49 am, Johan  wrote:
>
>
>
> > I tried with -N 1, 2, 3, etc., same error message.
>
> > On a side note: I configured web2py to work with apache and mod_wsgi,
> > it works , but I noticed an exception in the apache error_log
>
> > [error] Exception KeyError: KeyError(-1211209984,) in  > 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
>
> > It doesn't seem to affect web2py, but I'm not sure that it won't cause
> > a problem in the future.
> > It may be related to the problem above.
>
> > On 31 iul., 11:27, mdipierro  wrote:
>
> > > Can you try with the -N option?
>
> > > On Jul 31, 3:20 am, Johan  wrote:
>
> > > > I'm using python 2.6.5
>
> > > > On 31 iul., 11:00, mdipierro  wrote:
>
> > > > > which python version?
>
> > > > > On Jul 30, 11:41 am, Johan  wrote:
>
> > > > > > Hello. I'm new here.
> > > > > > I just bought a vps at intovps.com , I installed archlinux on it 
> > > > > > with
> > > > > > everything that I'm used to work with, and tried launching web2py, 
> > > > > > but
> > > > > > to no avail.
>
> > > > > > $ python web2py.py --nogui --password="a" --port="55000"
>
> > > > > > web2py Enterprise Web Framework
> > > > > > Created by Massimo Di Pierro, Copyright2007-2010
> > > > > > Version1.81.5(2010-07-22 17:51:19)
> > > > > > Database drivers available: SQLite3, PostgreSQL
> > > > > > Starting hardcron...
> > > > > > please visit:
> > > > > >        http://127.0.0.1:55000
> > > > > > use "kill -SIGTERM 24238" to shutdown the web2py server
> > > > > > Traceback (most recent call last):
> > > > > >   File "web2py.py", line 20, in 
> > > > > >     gluon.widget.start(cron=True)
> > > > > >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> > > > > >     server.start()
> > > > > >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> > > > > >     self.server.start()
> > > > > >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> > > > > >     self._threadpool.start()
> > > > > >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> > > > > >     thread.start()
> > > > > >   File "/usr/lib/python2.6/threading.py", line 474, in start
> > > > > >     _start_new_thread(self.__bootstrap, ())
> > > > > > thread.error: can't start new thread
>
> > > > > > It seems that there is a problem with threads on the python
> > > > > > installation.
> > > > > > But I ran a simple threading test and it worked
> > > > > > Any ideas?


[web2py] Re: posiible on register form

2010-07-31 Thread mdipierro
If you use divs you must edit the css to dispore the divs the way you
like them.

On Jul 31, 4:10 am, Frank  wrote:
> hi,
> I just found when I set auth.settings.formstyle = 'divs'in welcome app of
> 1.81.5,the last line of register form wired change.
>
> it also break my app by changing submit buttom to top of from,when I change 
> back
> to 'table3cols', things are fine.
>
> Thanks,
>
> Frank


[web2py] Re: Add name attribute to the form

2010-07-31 Thread mdipierro
SQLFORM(...,_name='abc')

On Jul 31, 4:28 am, Neveen Adel  wrote:
> Hello,
>
> i want to make the generated html form to have name attribute.
>
> in controller we write : form = SQLFORM(.) and then form is
> translated to html code.
>
> Is there an attribute that make the generated html code of the form
> has attribute name?
> e.g:
>    <-- that what i want to do
>
> Thanks in Advance
>
> Neveen


[web2py] Re: web2py rocket error on vps

2010-07-31 Thread mdipierro
Good to know. Thanks Graham.

Massimo

On Jul 31, 5:47 am, Graham Dumpleton 
wrote:
> Did you actually try Googling for it?
>
> Python 2.6.5 and 3.1.2 (???) made a change to C api behaviour.
>
> The message is harmless all the same.
>
> Upgrade to mod_wsgi 3.3 where the message has been suppressed.
>
> Go read ticket 197 on mod_wsgi site and read mod_wsgi release notes
> for version 3.3.
>
> Graham
>
> On Jul 31, 7:18 pm, mdipierro  wrote:
>
> > I have never seen this before but it seems something is wrong in the
> > threading module in python 2.6.5.
> > Has anybody else seen this with other Python versions?
>
> > On Jul 31, 3:49 am, Johan  wrote:
>
> > > I tried with -N 1, 2, 3, etc., same error message.
>
> > > On a side note: I configured web2py to work with apache and mod_wsgi,
> > > it works , but I noticed an exception in the apache error_log
>
> > > [error] Exception KeyError: KeyError(-1211209984,) in  > > 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
>
> > > It doesn't seem to affect web2py, but I'm not sure that it won't cause
> > > a problem in the future.
> > > It may be related to the problem above.
>
> > > On 31 iul., 11:27, mdipierro  wrote:
>
> > > > Can you try with the -N option?
>
> > > > On Jul 31, 3:20 am, Johan  wrote:
>
> > > > > I'm using python 2.6.5
>
> > > > > On 31 iul., 11:00, mdipierro  wrote:
>
> > > > > > which python version?
>
> > > > > > On Jul 30, 11:41 am, Johan  wrote:
>
> > > > > > > Hello. I'm new here.
> > > > > > > I just bought a vps at intovps.com , I installed archlinux on it 
> > > > > > > with
> > > > > > > everything that I'm used to work with, and tried launching 
> > > > > > > web2py, but
> > > > > > > to no avail.
>
> > > > > > > $ python web2py.py --nogui --password="a" --port="55000"
>
> > > > > > > web2py Enterprise Web Framework
> > > > > > > Created by Massimo Di Pierro, Copyright2007-2010
> > > > > > > Version1.81.5(2010-07-22 17:51:19)
> > > > > > > Database drivers available: SQLite3, PostgreSQL
> > > > > > > Starting hardcron...
> > > > > > > please visit:
> > > > > > >        http://127.0.0.1:55000
> > > > > > > use "kill -SIGTERM 24238" to shutdown the web2py server
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "web2py.py", line 20, in 
> > > > > > >     gluon.widget.start(cron=True)
> > > > > > >   File "/home/johan/web2py/gluon/widget.py", line 875, in start
> > > > > > >     server.start()
> > > > > > >   File "/home/johan/web2py/gluon/main.py", line 683, in start
> > > > > > >     self.server.start()
> > > > > > >   File "/home/johan/web2py/gluon/rocket.py", line 208, in start
> > > > > > >     self._threadpool.start()
> > > > > > >   File "/home/johan/web2py/gluon/rocket.py", line 547, in start
> > > > > > >     thread.start()
> > > > > > >   File "/usr/lib/python2.6/threading.py", line 474, in start
> > > > > > >     _start_new_thread(self.__bootstrap, ())
> > > > > > > thread.error: can't start new thread
>
> > > > > > > It seems that there is a problem with threads on the python
> > > > > > > installation.
> > > > > > > But I ran a simple threading test and it worked
> > > > > > > Any ideas?


[web2py] Re: Add name attribute to the form

2010-07-31 Thread Neveen Adel
Thanks a lot  mdipierro

On Jul 31, 1:54 pm, mdipierro  wrote:
> SQLFORM(...,_name='abc')
>
> On Jul 31, 4:28 am, Neveen Adel  wrote:
>
>
>
> > Hello,
>
> > i want to make the generated html form to have name attribute.
>
> > in controller we write : form = SQLFORM(.) and then form is
> > translated to html code.
>
> > Is there an attribute that make the generated html code of the form
> > has attribute name?
> > e.g:
> >    <-- that what i want to do
>
> > Thanks in Advance
>
> > Neveen


[web2py] Re: fun with metaclasses

2010-07-31 Thread sarsar
VERY NICE . Even if i dont understand the magics , i can understand
the result. It is a poem(almost ) . I disagree also with the
conservative spirit of some responces . Fun like this must always have
positive acceptance . Documentation problem about the many features of
Web2py is existant and unsolved till now . It is one month i am trying
to learn from zero , i posted some questions , that now seems noise
even to me and i ve begun to reread all availiable aplications ,
examples , threads etc. This documentation problem will never find a
good solution , except if evolution stops . From the other side , many
who complain about documentation should at least have an article
somewhere for a problem they solved when they faced and solved it .
Many threads here ends with this  "Thanks a lot my problem was
solved" . How , a full example , explanations of the problem and the
full solution it is rare to find .  I was looking how to intergrate to
my examples the datatable jquery plugin and i could not find
something , that finally was under my nose . CRM aplication has a good
example for my problem .

Well, sory for speaking too much,i liked the_thing.id inside
my_things = the_thing.id>0 . a lot . Thanks a lot M.
Sarados



On 30 Ιούλ, 19:53, mikech  wrote:
> Very nice - Dzonedhttp://www.dzone.com/links/r/web2py_and_metaclasses.html
>
> Mike
>
> On Jul 30, 7:35 am, mdipierro  wrote:
>
> >http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>
>


[web2py] new syntax in trunk, please check it

2010-07-31 Thread mdipierro
given

  db.define_table('person',Field('name'))
  id = db.person.insert(name='john')

You can now do

  print db.person(id)
  print db.person(db.person.name=='john')
  print db.person(name='john')
  print db.person(id,name='john')

they all return the same record 'john'. On failure (record does not
exist) they return None. This allows the following syntax:

  record = db.person(request.args(0)) or redirect(URL('error'))

this is better than

  record = db.person[request.args(0)] or redirect(URL('error'))

since the latter raises an exception in case request.args(0) is not
None or an int.





Re: [web2py] Re: Final Day for WAE Submissions!

2010-07-31 Thread Mr admin
I'll post links to websites for each submission. (  where possible. )


Mr.NetAdmin

On Fri, Jul 30, 2010 at 11:12 PM, Iceberg  wrote:

> On Jul 31, 2:12 am, NetAdmin  wrote:
> > Web2py Application Exhibition
> >
> > Submissions must be e-mailed before
> > 12:59pm pm CST July 30, 2010
> >
> > Do you have a Web2py app that you'd like to show the world?
> > If so, you may be interested in the Web2py Application Exhibition.
> >
> > The WAE is a way to...
> > 1. Demonstrate what can be done with Web2py.
> > 2. Share and learn about useful web2py, python, Javascript, jQuery
> > etc. techniques.
> > 3. Earn some money toward that new  you've been craving.
> >
> > Projects will be judged in the following areas.
> >
> > Ease of use
> > Usefulness
> > Visual Appeal
> >
> > The Rules
> > 1. Applications must be submitted no later than July 30, 2010
> >
> > 2. Source must be included with your submissions.
> >
> > 3. If the application is written by a team, Massimo can NOT be
> > part of the team.
> >
> > 4. After a 2 week review period, on August 15, 2010, the
> > winners will be announced on the web2py-users list.
> >
> > 5. The 1st place winner will receive $100 US Dollars,
> > 2nd place will receive $50
> >
> > 6. You must enjoy using Web2py!
> >
> > Massimo is not affiliated with this exhibition, ( maybe he'll help
> > judge if I can twist his arm ) so, if you have any questions or
> > comments, I can be contacted on this forum or via gmail
> >
> > mr.netadmin
>
>
> Will there be a showcase for all the submitted work? Or the winner
> (and runner up) will only be announced after an undisclosed selection
> phase?


[web2py] Re: Final Day for WAE Submissions!

2010-07-31 Thread mdipierro
How many? do you have any statistics?
We may also want to link to appliances.



On Jul 31, 9:18 am, Mr admin  wrote:
> I'll post links to websites for each submission. (  where possible. )
>
> Mr.NetAdmin
>
> On Fri, Jul 30, 2010 at 11:12 PM, Iceberg  wrote:
> > On Jul 31, 2:12 am, NetAdmin  wrote:
> > > Web2py Application Exhibition
>
> > > Submissions must be e-mailed before
> > > 12:59pm pm CST July 30, 2010
>
> > > Do you have a Web2py app that you'd like to show the world?
> > > If so, you may be interested in the Web2py Application Exhibition.
>
> > > The WAE is a way to...
> > > 1. Demonstrate what can be done with Web2py.
> > > 2. Share and learn about useful web2py, python, Javascript, jQuery
> > > etc. techniques.
> > > 3. Earn some money toward that new  you've been craving.
>
> > > Projects will be judged in the following areas.
>
> > > Ease of use
> > > Usefulness
> > > Visual Appeal
>
> > > The Rules
> > > 1. Applications must be submitted no later than July 30, 2010
>
> > > 2. Source must be included with your submissions.
>
> > > 3. If the application is written by a team, Massimo can NOT be
> > > part of the team.
>
> > > 4. After a 2 week review period, on August 15, 2010, the
> > > winners will be announced on the web2py-users list.
>
> > > 5. The 1st place winner will receive $100 US Dollars,
> > > 2nd place will receive $50
>
> > > 6. You must enjoy using Web2py!
>
> > > Massimo is not affiliated with this exhibition, ( maybe he'll help
> > > judge if I can twist his arm ) so, if you have any questions or
> > > comments, I can be contacted on this forum or via gmail
>
> > > mr.netadmin
>
> > Will there be a showcase for all the submitted work? Or the winner
> > (and runner up) will only be announced after an undisclosed selection
> > phase?


[web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread VP
Massimo: when a new version is released, it is the latest in trunk,
right?
Thanks.

On Jul 31, 6:57 am, mdipierro  wrote:
> given
>
>   db.define_table('person',Field('name'))
>   id = db.person.insert(name='john')
>
> You can now do
>
>   print db.person(id)
>   print db.person(db.person.name=='john')
>   print db.person(name='john')
>   print db.person(id,name='john')
>
> they all return the same record 'john'. On failure (record does not
> exist) they return None. This allows the following syntax:
>
>   record = db.person(request.args(0)) or redirect(URL('error'))
>
> this is better than
>
>   record = db.person[request.args(0)] or redirect(URL('error'))
>
> since the latter raises an exception in case request.args(0) is not
> None or an int.


[web2py] Re: fun with metaclasses

2010-07-31 Thread VP
I completely support these ideas.  It seems the book is Massimo's
effort, not a community's effort.  Documentation needs to be a
community effort; look at Django, Drupal.

On Jul 30, 11:03 pm, Bruno Rocha  wrote:
> I completelly agree with Jonathan, I also want to have a deeper explanation
> on DAL backgrounds.
>
> web2py is Agile enough for me and for my development team, but, sometimes we
> spent more time trying to figure out "how to" to some things, and testing
> alternatives than developing real solutions.
>
> The book is very good when we need to solve common and trivial things,
> otherwise when we need to go further. The only solution has been testing,
> looking for examples, using this list, or in many cases reading the source
> code and trying to understand what is happening behind the scenes. It costs
> a great time.
>
> As was mentioned in the "why I hate Django" video, using frameworks you gain
> time in the early stages, but lost much more in that we need to refine and
> tune up applications.
>
> For this reason I support a forum , IMHO, until we have a
> broader and deeper documentation, a forum would be much more usable than
> this list, and the DRY concept could be applied more easily to posts in a
> forum, rather than messages in this list.
> Forum can do things like a good search engine, sintax highlighting,
> screenshots embeded in to the context
> and yet it is possible to create mechanisms for threads to be followed by
> email, and people could start new threads by email as well.  Perhaps using
> markmin syntax to include files, highlight the code, and things ... more
>
> This type of platform could be better used to build further documentation.
>
> why not support and start an official web2py forum?
>
> 2010/7/30 Jonathan Lundell 
>
>
>
> > On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
>
> > > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
> > >> On Jul 30, 2010, at 9:19 AM, VP wrote:
> > >>> On Jul 30, 9:35 am, mdipierro  wrote:
>
> >http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>
> > >>> This is really nice.  Please do more of this.
>
> > >> My initial reaction is the opposite. The result might be more readable,
> > but it doesn't strike me as more writable.
>
> > >> What would be most helpful for me would be a deeper explanation (in the
> > book) of what's going on behind the existing DAL "magic" syntax, rather than
> > adding yet another layer of magic.
>
> > > You make a good point, Jonathan. And I think there is a underlying
> > > question here. Which kind of audience is web2py targeting to?  If for
> > > developers, the existing DAL syntax is already powerful and magical
> > > enough (the document is also good, here it is.
> >http://web2py.com/book/default/chapter/06
> > > ). Developers don't need another layer which is more fancy but not
> > > more powerful.
>
> > I'm not satisfied with the treatment in the book. I'd like to see each of
> > the DAL objects more completely described, especially as to the underlying
> > Python types and the operations that they implicitly support. Several of
> > them IIRC are polymorphic wrt their argument types, and you either have to
> > divine this telepathically or read the source in detail. Likewise operator
> > overloading.
>
> > I'm sure it's second nature to Massimo, but for most of us, we have to hunt
> > around for an example that matches our situation, and blindly copy & paste.
> > Either that or experiment until it stops raising exceptions
>
> --
>
> http://rochacbruno.com.br


[web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread David Marko
### print db.person(name='john')
Does it also return many items when many items matches the condition?

David

On 31 čnc, 13:57, mdipierro  wrote:
> given
>
>   db.define_table('person',Field('name'))
>   id = db.person.insert(name='john')
>
> You can now do
>
>   print db.person(id)
>   print db.person(db.person.name=='john')
>   print db.person(name='john')
>   print db.person(id,name='john')
>
> they all return the same record 'john'. On failure (record does not
> exist) they return None. This allows the following syntax:
>
>   record = db.person(request.args(0)) or redirect(URL('error'))
>
> this is better than
>
>   record = db.person[request.args(0)] or redirect(URL('error'))
>
> since the latter raises an exception in case request.args(0) is not
> None or an int.


[web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread mdipierro
No. Only the first.

Massimo

On Jul 31, 10:50 am, David Marko  wrote:
> ### print db.person(name='john')
> Does it also return many items when many items matches the condition?
>
> David
>
> On 31 čnc, 13:57, mdipierro  wrote:
>
> > given
>
> >   db.define_table('person',Field('name'))
> >   id = db.person.insert(name='john')
>
> > You can now do
>
> >   print db.person(id)
> >   print db.person(db.person.name=='john')
> >   print db.person(name='john')
> >   print db.person(id,name='john')
>
> > they all return the same record 'john'. On failure (record does not
> > exist) they return None. This allows the following syntax:
>
> >   record = db.person(request.args(0)) or redirect(URL('error'))
>
> > this is better than
>
> >   record = db.person[request.args(0)] or redirect(URL('error'))
>
> > since the latter raises an exception in case request.args(0) is not
> > None or an int.


[web2py] Re: Getting Eclipse / Pydev running

2010-07-31 Thread pabloest
Thanks, Rob.

That's what I figured. I tried downloading and reinstalling, forcing
the interpreter to be python 2.5 and 2.4, but no luck.
The netstat command didn't reveal anything, but thanks for the tip.

One final thing: does it matter which flavor of Eclipse is used? I
have tried the javascript and classic bundles. I assume at least the
classic should be ok.

Pablo

On Jul 30, 9:47 pm, Rob  wrote:
> I have no issues with eclipse/pydev - sounds like from your initial
> message that maybe your eclipse/pydev install is broken - maybe try to
> redownload?
>
> Do you have something else running on that port?
>
> netstat -atun | grep 51530
>
> Good luck!
>
> On Jul 30, 9:18 pm, pabloest  wrote:
>
>
>
> > well, I guess I will go with Wing, as it seems something is wrong with
> > my method or setup...
>
> > pablo
>
> > On Jul 29, 2:08 pm, pabloest  wrote:
>
> > > Thanks, Christopher.
>
> > > At some point it may make sense for me to contribute my learnings to
> > > the wiki. However, for now I'm just trying to get off the ground so I
> > > can't provide much value.
>
> > > On Jul 29, 1:58 pm, Christopher Steel  wrote:
>
> > > > Hi Pabloest,
>
> > > > We have started a Wiki with Web2py Eclipse and Maven Stuff where we
> > > > publish working configurations. It may be helpful. If you want to
> > > > contribute any additional info let me know.
>
> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> > > > Cheer,
>
> > > > Christopher Steel
>
> > > > Voice of Access
>
> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> > > > On 29 juil, 13:26, pabloest  wrote:
>
> > > > > thanks.
> > > > > normally I do, but I'm not sure where to do so in Eclipse.  Similarly
> > > > > with the port and address (127.0.0.1).  I checked the debug config
> > > > > parameters and variables and tried a bit there, but it didn't lead
> > > > > anywhere.
>
> > > > > On Jul 29, 9:54 am, Bruno Rocha  wrote:
>
> > > > > > did you provide password parameter to run web2py.py?
>
> > > > > > 2010/7/29 pabloest 
>
> > > > > > > Hi,
>
> > > > > > > I'm having some trouble simply getting started with Eclipse and 
> > > > > > > Pydev
> > > > > > > for web2py development.
> > > > > > > I can't get into a debugging mode with web2py.py and the web 
> > > > > > > server
> > > > > > > will not even start. When I right-click and select Debug As > 
> > > > > > > Python
> > > > > > > Run, I get error messages that say:
> > > > > > > -unexpected error setting up the debugger: socket closed
> > > > > > > -pydev debugger: starting
> > > > > > > Could not connect to localhost: 51530
> > > > > > > Traceback (most recent call last):
> > > > > > >  File "/Applications/eclipse/plugins/
> > > > > > > org.python.pydev.debug_1.6.0.2010071813/pysrc/pydevd_comm.py", 
> > > > > > > line
> > > > > > > 341, in StartClient
> > > > > > >    s.connect((host, port))
> > > > > > >  File "", line 1, in connect
> > > > > > > gaierror: (8, 'nodename nor servname provided, or not known')
>
> > > > > > > I haven't modified my db.py files from the default.
> > > > > > > It seems I am missing something quite basic as I haven't found
> > > > > > > anything on this message board or others to indicate this is a 
> > > > > > > normal
> > > > > > > problem.
>
> > > > > > > I'm running Eclipse IDE for Javascript Developers (by the way, 
> > > > > > > does it
> > > > > > > matter which Eclipse? I also tried with Eclipse Classic and got 
> > > > > > > the
> > > > > > > same results).
> > > > > > > Eclipse v1.3.0.2
> > > > > > > Eclipse Platform SDK v3.0.6
> > > > > > > PyDev for Eclipse 1.6.0.2
> > > > > > > PyDev Mylyn Integration 0.3.0
>
> > > > > > > I'm on a Mac 10.5.8 and Python 2.6.5.
> > > > > > > Any hints?
> > > > > > > Thanks much.
>
> > > > > > --
>
> > > > > >http://rochacbruno.com.br


[web2py] Re: fun with metaclasses

2010-07-31 Thread Scott
I support community contributions but there still needs to be an
"editor" or someone ultimately responsible for the changes.

On Jul 31, 11:27 am, VP  wrote:
> I completely support these ideas.  It seems the book is Massimo's
> effort, not a community's effort.  Documentation needs to be a
> community effort; look at Django, Drupal.
>
> On Jul 30, 11:03 pm, Bruno Rocha  wrote:
>
>
>
>
>
>
>
> > I completelly agree with Jonathan, I also want to have a deeper explanation
> > on DAL backgrounds.
>
> > web2py is Agile enough for me and for my development team, but, sometimes we
> > spent more time trying to figure out "how to" to some things, and testing
> > alternatives than developing real solutions.
>
> > The book is very good when we need to solve common and trivial things,
> > otherwise when we need to go further. The only solution has been testing,
> > looking for examples, using this list, or in many cases reading the source
> > code and trying to understand what is happening behind the scenes. It costs
> > a great time.
>
> > As was mentioned in the "why I hate Django" video, using frameworks you gain
> > time in the early stages, but lost much more in that we need to refine and
> > tune up applications.
>
> > For this reason I support a forum , IMHO, until we have a
> > broader and deeper documentation, a forum would be much more usable than
> > this list, and the DRY concept could be applied more easily to posts in a
> > forum, rather than messages in this list.
> > Forum can do things like a good search engine, sintax highlighting,
> > screenshots embeded in to the context
> > and yet it is possible to create mechanisms for threads to be followed by
> > email, and people could start new threads by email as well.  Perhaps using
> > markmin syntax to include files, highlight the code, and things ... more
>
> > This type of platform could be better used to build further documentation.
>
> > why not support and start an official web2py forum?
>
> > 2010/7/30 Jonathan Lundell 
>
> > > On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
>
> > > > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
> > > >> On Jul 30, 2010, at 9:19 AM, VP wrote:
> > > >>> On Jul 30, 9:35 am, mdipierro  wrote:
>
> > >http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>
> > > >>> This is really nice.  Please do more of this.
>
> > > >> My initial reaction is the opposite. The result might be more readable,
> > > but it doesn't strike me as more writable.
>
> > > >> What would be most helpful for me would be a deeper explanation (in the
> > > book) of what's going on behind the existing DAL "magic" syntax, rather 
> > > than
> > > adding yet another layer of magic.
>
> > > > You make a good point, Jonathan. And I think there is a underlying
> > > > question here. Which kind of audience is web2py targeting to?  If for
> > > > developers, the existing DAL syntax is already powerful and magical
> > > > enough (the document is also good, here it is.
> > >http://web2py.com/book/default/chapter/06
> > > > ). Developers don't need another layer which is more fancy but not
> > > > more powerful.
>
> > > I'm not satisfied with the treatment in the book. I'd like to see each of
> > > the DAL objects more completely described, especially as to the underlying
> > > Python types and the operations that they implicitly support. Several of
> > > them IIRC are polymorphic wrt their argument types, and you either have to
> > > divine this telepathically or read the source in detail. Likewise operator
> > > overloading.
>
> > > I'm sure it's second nature to Massimo, but for most of us, we have to 
> > > hunt
> > > around for an example that matches our situation, and blindly copy & 
> > > paste.
> > > Either that or experiment until it stops raising exceptions
>
> > --
>
> >http://rochacbruno.com.br


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Armin Ronacher
That is incorrect. That is indeed true for a regular cookie, bit that
has all kimds of problems. I was referring to actual signed cookies.

On Jul 31, 9:56 am, mdipierro  wrote:
> There is a difference.
>
> If you have a uuid sessions cookie and a serverside session and an
> attacker hijacks the cookie, he can only get access to the account of
> the compromised user.
>
> If the session is stored client side and the attackers hijacks the
> cookie, he can tamper with the data in the session and, depending on
> what the session cookie stores, may get access to more than data of
> the compromised user.
>
> Massimo
>
> On Jul 31, 1:58 am, Armin Ronacher 
> wrote:
>
>
>
> > Hi,
>
> > On Jul 31, 2:38 am, Scott  wrote:> I do not agree 
> > with item 1.  Session data should never be stored
> > > client-side as it opens a rather large attack vector.
>
> > Which attack vector exists for signed cookies with a signed timeout
> > compared to just session IDs in cookies? Both can be hijacked by a man
> > in the middle.
>
> > Regards,
> > Armin


Re: [web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Thadeus Burgess
To crack a signed cookie you need the secret hmac key that is usually
stored within the application. Brute forcing an hmac key will take
more time than any hacker has, especially if you change it once a
month or so.

--
Thadeus





On Sat, Jul 31, 2010 at 1:00 PM, Armin Ronacher
 wrote:
> That is incorrect. That is indeed true for a regular cookie, bit that
> has all kimds of problems. I was referring to actual signed cookies.
>
> On Jul 31, 9:56 am, mdipierro  wrote:
>> There is a difference.
>>
>> If you have a uuid sessions cookie and a serverside session and an
>> attacker hijacks the cookie, he can only get access to the account of
>> the compromised user.
>>
>> If the session is stored client side and the attackers hijacks the
>> cookie, he can tamper with the data in the session and, depending on
>> what the session cookie stores, may get access to more than data of
>> the compromised user.
>>
>> Massimo
>>
>> On Jul 31, 1:58 am, Armin Ronacher 
>> wrote:
>>
>>
>>
>> > Hi,
>>
>> > On Jul 31, 2:38 am, Scott  wrote:> I do not agree 
>> > with item 1.  Session data should never be stored
>> > > client-side as it opens a rather large attack vector.
>>
>> > Which attack vector exists for signed cookies with a signed timeout
>> > compared to just session IDs in cookies? Both can be hijacked by a man
>> > in the middle.
>>
>> > Regards,
>> > Armin
>


Re: [web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread Thadeus Burgess
If there are multiple records we need to know about it =/

--
Thadeus





On Sat, Jul 31, 2010 at 11:36 AM, mdipierro  wrote:
> No. Only the first.
>
> Massimo
>
> On Jul 31, 10:50 am, David Marko  wrote:
>> ### print db.person(name='john')
>> Does it also return many items when many items matches the condition?
>>
>> David
>>
>> On 31 čnc, 13:57, mdipierro  wrote:
>>
>> > given
>>
>> >   db.define_table('person',Field('name'))
>> >   id = db.person.insert(name='john')
>>
>> > You can now do
>>
>> >   print db.person(id)
>> >   print db.person(db.person.name=='john')
>> >   print db.person(name='john')
>> >   print db.person(id,name='john')
>>
>> > they all return the same record 'john'. On failure (record does not
>> > exist) they return None. This allows the following syntax:
>>
>> >   record = db.person(request.args(0)) or redirect(URL('error'))
>>
>> > this is better than
>>
>> >   record = db.person[request.args(0)] or redirect(URL('error'))
>>
>> > since the latter raises an exception in case request.args(0) is not
>> > None or an int.
>


Re: [web2py] Re: fun with metaclasses

2010-07-31 Thread Thadeus Burgess
The book is not released as open source. Massimo can only post it
online through a loophole with his publisher.

any community based documentation will need to be started from the
ground up, and not taking anything from the book.

--
Thadeus





On Sat, Jul 31, 2010 at 12:56 PM, Scott  wrote:
> I support community contributions but there still needs to be an
> "editor" or someone ultimately responsible for the changes.
>
> On Jul 31, 11:27 am, VP  wrote:
>> I completely support these ideas.  It seems the book is Massimo's
>> effort, not a community's effort.  Documentation needs to be a
>> community effort; look at Django, Drupal.
>>
>> On Jul 30, 11:03 pm, Bruno Rocha  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > I completelly agree with Jonathan, I also want to have a deeper explanation
>> > on DAL backgrounds.
>>
>> > web2py is Agile enough for me and for my development team, but, sometimes 
>> > we
>> > spent more time trying to figure out "how to" to some things, and testing
>> > alternatives than developing real solutions.
>>
>> > The book is very good when we need to solve common and trivial things,
>> > otherwise when we need to go further. The only solution has been testing,
>> > looking for examples, using this list, or in many cases reading the source
>> > code and trying to understand what is happening behind the scenes. It costs
>> > a great time.
>>
>> > As was mentioned in the "why I hate Django" video, using frameworks you 
>> > gain
>> > time in the early stages, but lost much more in that we need to refine and
>> > tune up applications.
>>
>> > For this reason I support a forum , IMHO, until we have a
>> > broader and deeper documentation, a forum would be much more usable than
>> > this list, and the DRY concept could be applied more easily to posts in a
>> > forum, rather than messages in this list.
>> > Forum can do things like a good search engine, sintax highlighting,
>> > screenshots embeded in to the context
>> > and yet it is possible to create mechanisms for threads to be followed by
>> > email, and people could start new threads by email as well.  Perhaps using
>> > markmin syntax to include files, highlight the code, and things ... more
>>
>> > This type of platform could be better used to build further documentation.
>>
>> > why not support and start an official web2py forum?
>>
>> > 2010/7/30 Jonathan Lundell 
>>
>> > > On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
>>
>> > > > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
>> > > >> On Jul 30, 2010, at 9:19 AM, VP wrote:
>> > > >>> On Jul 30, 9:35 am, mdipierro  wrote:
>>
>> > >http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>>
>> > > >>> This is really nice.  Please do more of this.
>>
>> > > >> My initial reaction is the opposite. The result might be more 
>> > > >> readable,
>> > > but it doesn't strike me as more writable.
>>
>> > > >> What would be most helpful for me would be a deeper explanation (in 
>> > > >> the
>> > > book) of what's going on behind the existing DAL "magic" syntax, rather 
>> > > than
>> > > adding yet another layer of magic.
>>
>> > > > You make a good point, Jonathan. And I think there is a underlying
>> > > > question here. Which kind of audience is web2py targeting to?  If for
>> > > > developers, the existing DAL syntax is already powerful and magical
>> > > > enough (the document is also good, here it is.
>> > >http://web2py.com/book/default/chapter/06
>> > > > ). Developers don't need another layer which is more fancy but not
>> > > > more powerful.
>>
>> > > I'm not satisfied with the treatment in the book. I'd like to see each of
>> > > the DAL objects more completely described, especially as to the 
>> > > underlying
>> > > Python types and the operations that they implicitly support. Several of
>> > > them IIRC are polymorphic wrt their argument types, and you either have 
>> > > to
>> > > divine this telepathically or read the source in detail. Likewise 
>> > > operator
>> > > overloading.
>>
>> > > I'm sure it's second nature to Massimo, but for most of us, we have to 
>> > > hunt
>> > > around for an example that matches our situation, and blindly copy & 
>> > > paste.
>> > > Either that or experiment until it stops raising exceptions
>>
>> > --
>>
>> >http://rochacbruno.com.br
>


Re: [web2py] Re: Getting Eclipse / Pydev running

2010-07-31 Thread Thadeus Burgess
Something wrong with your setup, probably due to the fact your on a
Mac, they are not the friendliest for python development.

Have you tried installing the official python .dmg from python.org?


--
Thadeus





On Sat, Jul 31, 2010 at 12:05 PM, pabloest  wrote:
> Thanks, Rob.
>
> That's what I figured. I tried downloading and reinstalling, forcing
> the interpreter to be python 2.5 and 2.4, but no luck.
> The netstat command didn't reveal anything, but thanks for the tip.
>
> One final thing: does it matter which flavor of Eclipse is used? I
> have tried the javascript and classic bundles. I assume at least the
> classic should be ok.
>
> Pablo
>
> On Jul 30, 9:47 pm, Rob  wrote:
>> I have no issues with eclipse/pydev - sounds like from your initial
>> message that maybe your eclipse/pydev install is broken - maybe try to
>> redownload?
>>
>> Do you have something else running on that port?
>>
>> netstat -atun | grep 51530
>>
>> Good luck!
>>
>> On Jul 30, 9:18 pm, pabloest  wrote:
>>
>>
>>
>> > well, I guess I will go with Wing, as it seems something is wrong with
>> > my method or setup...
>>
>> > pablo
>>
>> > On Jul 29, 2:08 pm, pabloest  wrote:
>>
>> > > Thanks, Christopher.
>>
>> > > At some point it may make sense for me to contribute my learnings to
>> > > the wiki. However, for now I'm just trying to get off the ground so I
>> > > can't provide much value.
>>
>> > > On Jul 29, 1:58 pm, Christopher Steel  wrote:
>>
>> > > > Hi Pabloest,
>>
>> > > > We have started a Wiki with Web2py Eclipse and Maven Stuff where we
>> > > > publish working configurations. It may be helpful. If you want to
>> > > > contribute any additional info let me know.
>>
>> > > >http://code.google.com/p/voa-web2py2eclipse/
>>
>> > > > Cheer,
>>
>> > > > Christopher Steel
>>
>> > > > Voice of Access
>>
>> > > >http://code.google.com/p/voa-web2py2eclipse/
>>
>> > > > On 29 juil, 13:26, pabloest  wrote:
>>
>> > > > > thanks.
>> > > > > normally I do, but I'm not sure where to do so in Eclipse.  Similarly
>> > > > > with the port and address (127.0.0.1).  I checked the debug config
>> > > > > parameters and variables and tried a bit there, but it didn't lead
>> > > > > anywhere.
>>
>> > > > > On Jul 29, 9:54 am, Bruno Rocha  wrote:
>>
>> > > > > > did you provide password parameter to run web2py.py?
>>
>> > > > > > 2010/7/29 pabloest 
>>
>> > > > > > > Hi,
>>
>> > > > > > > I'm having some trouble simply getting started with Eclipse and 
>> > > > > > > Pydev
>> > > > > > > for web2py development.
>> > > > > > > I can't get into a debugging mode with web2py.py and the web 
>> > > > > > > server
>> > > > > > > will not even start. When I right-click and select Debug As > 
>> > > > > > > Python
>> > > > > > > Run, I get error messages that say:
>> > > > > > > -unexpected error setting up the debugger: socket closed
>> > > > > > > -pydev debugger: starting
>> > > > > > > Could not connect to localhost: 51530
>> > > > > > > Traceback (most recent call last):
>> > > > > > >  File "/Applications/eclipse/plugins/
>> > > > > > > org.python.pydev.debug_1.6.0.2010071813/pysrc/pydevd_comm.py", 
>> > > > > > > line
>> > > > > > > 341, in StartClient
>> > > > > > >    s.connect((host, port))
>> > > > > > >  File "", line 1, in connect
>> > > > > > > gaierror: (8, 'nodename nor servname provided, or not known')
>>
>> > > > > > > I haven't modified my db.py files from the default.
>> > > > > > > It seems I am missing something quite basic as I haven't found
>> > > > > > > anything on this message board or others to indicate this is a 
>> > > > > > > normal
>> > > > > > > problem.
>>
>> > > > > > > I'm running Eclipse IDE for Javascript Developers (by the way, 
>> > > > > > > does it
>> > > > > > > matter which Eclipse? I also tried with Eclipse Classic and got 
>> > > > > > > the
>> > > > > > > same results).
>> > > > > > > Eclipse v1.3.0.2
>> > > > > > > Eclipse Platform SDK v3.0.6
>> > > > > > > PyDev for Eclipse 1.6.0.2
>> > > > > > > PyDev Mylyn Integration 0.3.0
>>
>> > > > > > > I'm on a Mac 10.5.8 and Python 2.6.5.
>> > > > > > > Any hints?
>> > > > > > > Thanks much.
>>
>> > > > > > --
>>
>> > > > > >http://rochacbruno.com.br
>


Re: [web2py] Re: block problem in 1.81.5

2010-07-31 Thread Thadeus Burgess
>.<





On Sat, Jul 31, 2010 at 2:52 AM, mdipierro  wrote:
> ?
>
> On Jul 31, 1:02 am, BearXu  wrote:
>> report block is not defined
>


[web2py] Re: Getting Eclipse / Pydev running

2010-07-31 Thread pabloest
Hi Thadeus,

Yes, I tried that also. Same result.

Pablo

On Jul 31, 11:48 am, Thadeus Burgess  wrote:
> Something wrong with your setup, probably due to the fact your on a
> Mac, they are not the friendliest for python development.
>
> Have you tried installing the official python .dmg from python.org?
>
> --
> Thadeus
>
>
>
> On Sat, Jul 31, 2010 at 12:05 PM, pabloest  wrote:
> > Thanks, Rob.
>
> > That's what I figured. I tried downloading and reinstalling, forcing
> > the interpreter to be python 2.5 and 2.4, but no luck.
> > The netstat command didn't reveal anything, but thanks for the tip.
>
> > One final thing: does it matter which flavor of Eclipse is used? I
> > have tried the javascript and classic bundles. I assume at least the
> > classic should be ok.
>
> > Pablo
>
> > On Jul 30, 9:47 pm, Rob  wrote:
> >> I have no issues with eclipse/pydev - sounds like from your initial
> >> message that maybe your eclipse/pydev install is broken - maybe try to
> >> redownload?
>
> >> Do you have something else running on that port?
>
> >> netstat -atun | grep 51530
>
> >> Good luck!
>
> >> On Jul 30, 9:18 pm, pabloest  wrote:
>
> >> > well, I guess I will go with Wing, as it seems something is wrong with
> >> > my method or setup...
>
> >> > pablo
>
> >> > On Jul 29, 2:08 pm, pabloest  wrote:
>
> >> > > Thanks, Christopher.
>
> >> > > At some point it may make sense for me to contribute my learnings to
> >> > > the wiki. However, for now I'm just trying to get off the ground so I
> >> > > can't provide much value.
>
> >> > > On Jul 29, 1:58 pm, Christopher Steel  wrote:
>
> >> > > > Hi Pabloest,
>
> >> > > > We have started a Wiki with Web2py Eclipse and Maven Stuff where we
> >> > > > publish working configurations. It may be helpful. If you want to
> >> > > > contribute any additional info let me know.
>
> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> >> > > > Cheer,
>
> >> > > > Christopher Steel
>
> >> > > > Voice of Access
>
> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> >> > > > On 29 juil, 13:26, pabloest  wrote:
>
> >> > > > > thanks.
> >> > > > > normally I do, but I'm not sure where to do so in Eclipse.  
> >> > > > > Similarly
> >> > > > > with the port and address (127.0.0.1).  I checked the debug config
> >> > > > > parameters and variables and tried a bit there, but it didn't lead
> >> > > > > anywhere.
>
> >> > > > > On Jul 29, 9:54 am, Bruno Rocha  wrote:
>
> >> > > > > > did you provide password parameter to run web2py.py?
>
> >> > > > > > 2010/7/29 pabloest 
>
> >> > > > > > > Hi,
>
> >> > > > > > > I'm having some trouble simply getting started with Eclipse 
> >> > > > > > > and Pydev
> >> > > > > > > for web2py development.
> >> > > > > > > I can't get into a debugging mode with web2py.py and the web 
> >> > > > > > > server
> >> > > > > > > will not even start. When I right-click and select Debug As > 
> >> > > > > > > Python
> >> > > > > > > Run, I get error messages that say:
> >> > > > > > > -unexpected error setting up the debugger: socket closed
> >> > > > > > > -pydev debugger: starting
> >> > > > > > > Could not connect to localhost: 51530
> >> > > > > > > Traceback (most recent call last):
> >> > > > > > >  File "/Applications/eclipse/plugins/
> >> > > > > > > org.python.pydev.debug_1.6.0.2010071813/pysrc/pydevd_comm.py", 
> >> > > > > > > line
> >> > > > > > > 341, in StartClient
> >> > > > > > >    s.connect((host, port))
> >> > > > > > >  File "", line 1, in connect
> >> > > > > > > gaierror: (8, 'nodename nor servname provided, or not known')
>
> >> > > > > > > I haven't modified my db.py files from the default.
> >> > > > > > > It seems I am missing something quite basic as I haven't found
> >> > > > > > > anything on this message board or others to indicate this is a 
> >> > > > > > > normal
> >> > > > > > > problem.
>
> >> > > > > > > I'm running Eclipse IDE for Javascript Developers (by the way, 
> >> > > > > > > does it
> >> > > > > > > matter which Eclipse? I also tried with Eclipse Classic and 
> >> > > > > > > got the
> >> > > > > > > same results).
> >> > > > > > > Eclipse v1.3.0.2
> >> > > > > > > Eclipse Platform SDK v3.0.6
> >> > > > > > > PyDev for Eclipse 1.6.0.2
> >> > > > > > > PyDev Mylyn Integration 0.3.0
>
> >> > > > > > > I'm on a Mac 10.5.8 and Python 2.6.5.
> >> > > > > > > Any hints?
> >> > > > > > > Thanks much.
>
> >> > > > > > --
>
> >> > > > > >http://rochacbruno.com.br


[web2py] Re: App Migration

2010-07-31 Thread Chase Lee
Thanks so much!  That is astonishingly easy.  I've been looking at
working with web2py (coming from Django and Pylons), and I'm quite
convinced now.

Thanks again.

On Jul 31, 4:00 am, mdipierro  wrote:
> From admin click on [pack app] and on the other host admin upload the
> generated w2p file.
>
> Alteranatively
>
> host1:/web2py/applications> zip -r myapp.zip myapp
> host1:/web2py/applications> scp myapp.zip y...@host2:/
> host1:/web2py/applications> ssh y...@host2
> host2:/web2py/applications> sudo -u www-data bash
> host2:/web2py/applications> cd /where/it/is/web2py/applications
> host2:/web2py/applications> unzip ~you/web2py.zip
>
> On Jul 31, 12:46 am, Chase Lee  wrote:
>
>
>
> > What's the process for migrating an app from one host to another or
> > from localhost to a hosted environment?
>
> > Thanks


[web2py] auth_membership problem

2010-07-31 Thread Johann Spies
I am using Web2py  Version 1.81.5 (2010-07-22 23:56:21).

In user_auth I use "username".  I am trying to setup access control
measures.  When I try to add a record to the auth_membership table
using appadmin, I get the following ticket:

Traceback (most recent call last):
  File "/Users/js/Programmeer/zenex/web2py/gluon/restricted.py", line
178, in restricted
exec ccode in environment
  File 
"/Users/js/Programmeer/zenex/web2py/applications/zenex/controllers/appadmin.py",
line 410, in 
  File "/Users/js/Programmeer/zenex/web2py/gluon/globals.py", line 96,
in 
self._caller = lambda f: f()
  File 
"/Users/js/Programmeer/zenex/web2py/applications/zenex/controllers/appadmin.py",
line 124, in insert
form = SQLFORM(db[table], ignore_rw=ignore_rw)
  File "/Users/js/Programmeer/zenex/web2py/gluon/sqlhtml.py", line
706, in __init__
inp = self.widgets.options.widget(field, default)
  File "/Users/js/Programmeer/zenex/web2py/gluon/sqlhtml.py", line
187, in widget
options = requires[0].options()
  File "/Users/js/Programmeer/zenex/web2py/gluon/validators.py", line
422, in options
self.build_set()
  File "/Users/js/Programmeer/zenex/web2py/gluon/validators.py", line
406, in build_set
records = self.dbset.select(*self.fields, **dd)
  File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3144, in select
return self.parse(db,rows,self.colnames,SetClass=Set)
  File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3166, in parse
field = table[fieldname]
  File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 1592,
in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'first_name'

Is this a bug?

Regards
Johann

-- 
    "Be not deceived; God is not mocked: for whatsoever a
     man soweth, that shall he also reap."
                                  Galatians 6:7


Re: [web2py] Re: Getting Eclipse / Pydev running

2010-07-31 Thread Thadeus Burgess
Odd. I am using eclipse classic with pydev on ubuntu. Debug works fine
for me. There is something wrong with the installation paths.

I'm thinking that now you have so many different versions of python on
your mac that it is causing even more issues =/
--
Thadeus





On Sat, Jul 31, 2010 at 2:42 PM, pabloest  wrote:
> Hi Thadeus,
>
> Yes, I tried that also. Same result.
>
> Pablo
>
> On Jul 31, 11:48 am, Thadeus Burgess  wrote:
>> Something wrong with your setup, probably due to the fact your on a
>> Mac, they are not the friendliest for python development.
>>
>> Have you tried installing the official python .dmg from python.org?
>>
>> --
>> Thadeus
>>
>>
>>
>> On Sat, Jul 31, 2010 at 12:05 PM, pabloest  wrote:
>> > Thanks, Rob.
>>
>> > That's what I figured. I tried downloading and reinstalling, forcing
>> > the interpreter to be python 2.5 and 2.4, but no luck.
>> > The netstat command didn't reveal anything, but thanks for the tip.
>>
>> > One final thing: does it matter which flavor of Eclipse is used? I
>> > have tried the javascript and classic bundles. I assume at least the
>> > classic should be ok.
>>
>> > Pablo
>>
>> > On Jul 30, 9:47 pm, Rob  wrote:
>> >> I have no issues with eclipse/pydev - sounds like from your initial
>> >> message that maybe your eclipse/pydev install is broken - maybe try to
>> >> redownload?
>>
>> >> Do you have something else running on that port?
>>
>> >> netstat -atun | grep 51530
>>
>> >> Good luck!
>>
>> >> On Jul 30, 9:18 pm, pabloest  wrote:
>>
>> >> > well, I guess I will go with Wing, as it seems something is wrong with
>> >> > my method or setup...
>>
>> >> > pablo
>>
>> >> > On Jul 29, 2:08 pm, pabloest  wrote:
>>
>> >> > > Thanks, Christopher.
>>
>> >> > > At some point it may make sense for me to contribute my learnings to
>> >> > > the wiki. However, for now I'm just trying to get off the ground so I
>> >> > > can't provide much value.
>>
>> >> > > On Jul 29, 1:58 pm, Christopher Steel  wrote:
>>
>> >> > > > Hi Pabloest,
>>
>> >> > > > We have started a Wiki with Web2py Eclipse and Maven Stuff where we
>> >> > > > publish working configurations. It may be helpful. If you want to
>> >> > > > contribute any additional info let me know.
>>
>> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>>
>> >> > > > Cheer,
>>
>> >> > > > Christopher Steel
>>
>> >> > > > Voice of Access
>>
>> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>>
>> >> > > > On 29 juil, 13:26, pabloest  wrote:
>>
>> >> > > > > thanks.
>> >> > > > > normally I do, but I'm not sure where to do so in Eclipse.  
>> >> > > > > Similarly
>> >> > > > > with the port and address (127.0.0.1).  I checked the debug config
>> >> > > > > parameters and variables and tried a bit there, but it didn't lead
>> >> > > > > anywhere.
>>
>> >> > > > > On Jul 29, 9:54 am, Bruno Rocha  wrote:
>>
>> >> > > > > > did you provide password parameter to run web2py.py?
>>
>> >> > > > > > 2010/7/29 pabloest 
>>
>> >> > > > > > > Hi,
>>
>> >> > > > > > > I'm having some trouble simply getting started with Eclipse 
>> >> > > > > > > and Pydev
>> >> > > > > > > for web2py development.
>> >> > > > > > > I can't get into a debugging mode with web2py.py and the web 
>> >> > > > > > > server
>> >> > > > > > > will not even start. When I right-click and select Debug As > 
>> >> > > > > > > Python
>> >> > > > > > > Run, I get error messages that say:
>> >> > > > > > > -unexpected error setting up the debugger: socket closed
>> >> > > > > > > -pydev debugger: starting
>> >> > > > > > > Could not connect to localhost: 51530
>> >> > > > > > > Traceback (most recent call last):
>> >> > > > > > >  File "/Applications/eclipse/plugins/
>> >> > > > > > > org.python.pydev.debug_1.6.0.2010071813/pysrc/pydevd_comm.py",
>> >> > > > > > >  line
>> >> > > > > > > 341, in StartClient
>> >> > > > > > >    s.connect((host, port))
>> >> > > > > > >  File "", line 1, in connect
>> >> > > > > > > gaierror: (8, 'nodename nor servname provided, or not known')
>>
>> >> > > > > > > I haven't modified my db.py files from the default.
>> >> > > > > > > It seems I am missing something quite basic as I haven't found
>> >> > > > > > > anything on this message board or others to indicate this is 
>> >> > > > > > > a normal
>> >> > > > > > > problem.
>>
>> >> > > > > > > I'm running Eclipse IDE for Javascript Developers (by the 
>> >> > > > > > > way, does it
>> >> > > > > > > matter which Eclipse? I also tried with Eclipse Classic and 
>> >> > > > > > > got the
>> >> > > > > > > same results).
>> >> > > > > > > Eclipse v1.3.0.2
>> >> > > > > > > Eclipse Platform SDK v3.0.6
>> >> > > > > > > PyDev for Eclipse 1.6.0.2
>> >> > > > > > > PyDev Mylyn Integration 0.3.0
>>
>> >> > > > > > > I'm on a Mac 10.5.8 and Python 2.6.5.
>> >> > > > > > > Any hints?
>> >> > > > > > > Thanks much.
>>
>> >> > > > > > --
>>
>> >> > > > > >http://rochacbruno.com.br
>


[web2py] Re: epub version of official book?

2010-07-31 Thread Joe Barnhart
+1

I have the sony reader and epub should work great with that!  I have
the PDF, but the spacing and such does not lend itself to the small
reader format.

-- Joe

On Jul 25, 2:43 pm, Donald Hughes  wrote:
> Any chance of getting an epub version of the official book in addition
> to the pdf?  I would gladly pay $12.50 for that.


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Scott
In essence your argument is that it would take too much time and you
could change the hmac key monthly to prevent an attack.  I understand
and respect that signed cookies are one way to solve the problem, but
I do not believe they are the "most correct" way.

My analogy would be the difference between a handheld portable safe
(signed cookie) and a bank (server-side session).  If your money is
stored in the bank, it's a lot harder to steal it because a thief
would need to break into the bank whereas a thief has all the time in
the world with a portable safe (which are also a lot easier to
break).  With computer processing speed and algorithms (particularly
distributed computing) I am not sure that signed cookies will remain
as "safe" as they are today.  With regard to changing the hmac key,
you are right they should be periodically changed although this would
need to be carefully planned as it essentially invalidates sessions
when it changes.  I believe it would also would invalidate stored
encrypted data unless you use a one-time method to decrypt then re-
encrypt the data using the new hmac key.

In summary, I believe server-side sessions to be more secure than
client-side cookies, period.

On Jul 31, 2:39 pm, Thadeus Burgess  wrote:
> To crack a signed cookie you need the secret hmac key that is usually
> stored within the application. Brute forcing an hmac key will take
> more time than any hacker has, especially if you change it once a
> month or so.
>
> --
> Thadeus
>
> On Sat, Jul 31, 2010 at 1:00 PM, Armin Ronacher
>
>
>
>
>
>
>
>  wrote:
> > That is incorrect. That is indeed true for a regular cookie, bit that
> > has all kimds of problems. I was referring to actual signed cookies.
>
> > On Jul 31, 9:56 am, mdipierro  wrote:
> >> There is a difference.
>
> >> If you have a uuid sessions cookie and a serverside session and an
> >> attacker hijacks the cookie, he can only get access to the account of
> >> the compromised user.
>
> >> If the session is stored client side and the attackers hijacks the
> >> cookie, he can tamper with the data in the session and, depending on
> >> what the session cookie stores, may get access to more than data of
> >> the compromised user.
>
> >> Massimo
>
> >> On Jul 31, 1:58 am, Armin Ronacher 
> >> wrote:
>
> >> > Hi,
>
> >> > On Jul 31, 2:38 am, Scott  wrote:> I do not agree 
> >> > with item 1.  Session data should never be stored
> >> > > client-side as it opens a rather large attack vector.
>
> >> > Which attack vector exists for signed cookies with a signed timeout
> >> > compared to just session IDs in cookies? Both can be hijacked by a man
> >> > in the middle.
>
> >> > Regards,
> >> > Armin


[web2py] Re: new in trunk: clone.py

2010-07-31 Thread Joe Barnhart
No, he is NOT right.

I need tools EXACTLY like clone.py.  Right now I'm working on a web2py
version of a site I OWN.  I want to make the look and feel as close as
possible to the old existing site so my users won't notice the
change.  (Except the change from going from a pile of PHP to a real
database-driven site.)

Can clone.py be used for nefarious purposes?  Sure.  Does that make
the TOOL evil?  NO NO NO!!!  That is like saying that "bittorrent is
evil" because a lot of filesharing is illegal.  A hell of a lot of
filesharing is VERY legal and we use bt protocol every day for non-
infringing uses.

-- Joe B.

On Jul 24, 5:30 pm, mdipierro  wrote:
> You are absolutely right. I removed it.
>
> Massimo
>
> On Jul 24, 7:22 pm, Pepe  wrote:
>
> > This makes easier to steal the work of others ... what a great tool?
> > no?
>
> > i didn't agree,
> > what's the point?
>
> > "hey I learnt to make a super great weapon to kill all the people at
> > world" Should I build it?
> > hummm, but wait, under certain conditions it is illegal to kill
> > people. please use it only when is allowed.
>
> > :)
>
> > On Jul 24, 9:27 am, Phyo Arkar  wrote:
>
> > > Intranet Is ok. And if you remove all the graphics , replace with your own
> > > stuff , should be fine.
>
> > > On Sat, Jul 24, 2010 at 7:44 PM, Scott  wrote:
> > > > Personally, I think this is a great idea particularly when designing
> > > > Intranet sites.  This makes it very easy to implement your company's
> > > > look and feel without having to go through a lot of hoops.  I say put
> > > > in a warning or caveat that must be accepted when using the script to
> > > > absolve web2py of liability, and let people use it.
>
> > > > On Jul 23, 3:41 am, mdipierro  wrote:
> > > > > Let's say you have a web2py application "myapp" and you want it to
> > > > > look like a existing web site, for example "http://www.reddit.com";,
> > > > > here is what you do from the web2py/ folder:
>
> > > > > ./scripts/clone.py -m '.tabmenu' -c '.content' -u 
> > > > > 'http://www.reddit.com'-o
> > > > applications/myapp/views/layout.html
>
> > > > > Done!
>
> > > > > In the script above:
> > > > > -m '.tabmenu' is the class of the UL menu (. for class and # for id,
> > > > > jQuery notation)
> > > > > -c '.content' is the class of DIV that contains the main page
> > > > > content.
> > > > > -u is the url of the page you want to clone and
> > > > > -o is the file you want to generate (a web2py layout).
>
> > > > > You will need to look at the page first (possibly with firebug) to
> > > > > figure out the -m and -c values for the specific page you intend to
> > > > > clone.
>
> > > > > The script converts the page into a web2py layout by inserting web2py
> > > > > tags in the proper places. It does not download linked static files
> > > > > but fixes links so that they do not break.
>
> > > > > It does not work on non-utf8 pages.
>
> > > > > I am not sure this is going to stay but I could use feedback on
> > > > > whether this is useful or not. If somebody could help fix it for non
> > > > > utf8 pages it would be great.
>
> > > > > The script is in trunk now. If you do not use trunk, just get this
> > > > > file
>
> > > > >    http://web2py.googlecode.com/hg/scripts/clone.py
>
> > > > > and store it in web2py/scripts.
>
> > > > > DISCLAIMER: Under certain conditions it is illegal to make a page look
> > > > > too similar to an existing page because it may be considered phishing.
> > > > > The code provided can help you for a quick demo but it should not be
> > > > > used to generate production web sites unless the layout of the site
> > > > > you are cloning explicitly allows it.
>
> > > > > Massimo


Re: [web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Jonathan Lundell
On Jul 31, 2010, at 5:09 PM, Scott wrote:

> In essence your argument is that it would take too much time and you
> could change the hmac key monthly to prevent an attack.  I understand
> and respect that signed cookies are one way to solve the problem, but
> I do not believe they are the "most correct" way.
> 
> My analogy would be the difference between a handheld portable safe
> (signed cookie) and a bank (server-side session).  If your money is
> stored in the bank, it's a lot harder to steal it because a thief
> would need to break into the bank whereas a thief has all the time in
> the world with a portable safe (which are also a lot easier to
> break).  With computer processing speed and algorithms (particularly
> distributed computing) I am not sure that signed cookies will remain
> as "safe" as they are today.  With regard to changing the hmac key,
> you are right they should be periodically changed although this would
> need to be carefully planned as it essentially invalidates sessions
> when it changes.  I believe it would also would invalidate stored
> encrypted data unless you use a one-time method to decrypt then re-
> encrypt the data using the new hmac key.
> 
> In summary, I believe server-side sessions to be more secure than
> client-side cookies, period.

As a practical matter, I don't think it's much of an issue. A SHA-1 based HMAC, 
or SHA-2 if you're feeling especially paranoid, is not going to be cracked 
within the lifetime of a session. Notice that unlike encryption of sensitive 
data, cracking the session HMAC has no value once the session has expired. So 
the ability to attack it for months offline isn't of much use. 

The expiration problem could be handled by having two keys active at any given 
time, with their valid-time overlapped, so you have an 'old' key and a 'new' 
key. If someone comes in with an old key, replace the HMAC with a new version.

Re: [web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Thadeus Burgess
@Scott, I think your argument is based on assuming a bad programming
design. If you have any type of data that needs to be secure to that
detail, I hope to god your not storing them in the session in the
first place! I mean, if I somehow copy your sites cookie from a user,
I now have access to the entire site anyways.

You should only be storing data in a session that won't compromise
your data in the first place. Userid doesn't mean anything even if the
cookie was cracked (though on todays hardware would take 900 trillion
years to crack a good hmac key). If your storing an encrypted tree of
credit cards in the session, don't you think it would be appropriate
to redesign your application and store that in the database instead?

Not to mention, google, facebook, twitter, microsoft, quicken, chase,
capitalone, visa, etc. etc.. all use signed cookies... They are the
"most correct" way to do it on todays hardware, and todays software,
and todays browsers. Perhaps when we have flying cars it won't be the
best way anymore, but until then =)

--
Thadeus





On Sat, Jul 31, 2010 at 7:28 PM, Jonathan Lundell  wrote:
> On Jul 31, 2010, at 5:09 PM, Scott wrote:
>
>> In essence your argument is that it would take too much time and you
>> could change the hmac key monthly to prevent an attack.  I understand
>> and respect that signed cookies are one way to solve the problem, but
>> I do not believe they are the "most correct" way.
>>
>> My analogy would be the difference between a handheld portable safe
>> (signed cookie) and a bank (server-side session).  If your money is
>> stored in the bank, it's a lot harder to steal it because a thief
>> would need to break into the bank whereas a thief has all the time in
>> the world with a portable safe (which are also a lot easier to
>> break).  With computer processing speed and algorithms (particularly
>> distributed computing) I am not sure that signed cookies will remain
>> as "safe" as they are today.  With regard to changing the hmac key,
>> you are right they should be periodically changed although this would
>> need to be carefully planned as it essentially invalidates sessions
>> when it changes.  I believe it would also would invalidate stored
>> encrypted data unless you use a one-time method to decrypt then re-
>> encrypt the data using the new hmac key.
>>
>> In summary, I believe server-side sessions to be more secure than
>> client-side cookies, period.
>
> As a practical matter, I don't think it's much of an issue. A SHA-1 based 
> HMAC, or SHA-2 if you're feeling especially paranoid, is not going to be 
> cracked within the lifetime of a session. Notice that unlike encryption of 
> sensitive data, cracking the session HMAC has no value once the session has 
> expired. So the ability to attack it for months offline isn't of much use.
>
> The expiration problem could be handled by having two keys active at any 
> given time, with their valid-time overlapped, so you have an 'old' key and a 
> 'new' key. If someone comes in with an old key, replace the HMAC with a new 
> version.


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Scott
True, the PCI-DSS mandates things like that, such as tokenizing credit
cards and only passing the tokens, using a centralized secure database
to store the data, etc.  WRT the site cookie, you'd have access to
what that user has been authorized to see, sure.  There are other
standard-practice methods like associating the IP address to the
session (again, built into web2py)...  I just happen to be paranoid
about these types of things and would rather give out as little
information as humanly possible to the client.  That is to say, only
the session token.  Call it the Principle of Least Information =)  WRT
this not being an issue on today's hardware, sure I agree.  I have a
tendency to look for what not only works today but works for the
future to prevent having to redesign the system a few years down the
road.  I'd rather do the hard work now to pay dividends down the
road.

So how about a compromise - let's switch to using secure, HTTPOnly,
signed and encrypted cookies which store the session token and give
the programmer the option to store some data in the cookie if
required.  Just put a caveat that the least amount should be stored
(and in any case, less than the 4k limit).

On Jul 31, 8:38 pm, Thadeus Burgess  wrote:
> @Scott, I think your argument is based on assuming a bad programming
> design. If you have any type of data that needs to be secure to that
> detail, I hope to god your not storing them in the session in the
> first place! I mean, if I somehow copy your sites cookie from a user,
> I now have access to the entire site anyways.
>
> You should only be storing data in a session that won't compromise
> your data in the first place. Userid doesn't mean anything even if the
> cookie was cracked (though on todays hardware would take 900 trillion
> years to crack a good hmac key). If your storing an encrypted tree of
> credit cards in the session, don't you think it would be appropriate
> to redesign your application and store that in the database instead?
>
> Not to mention, google, facebook, twitter, microsoft, quicken, chase,
> capitalone, visa, etc. etc.. all use signed cookies... They are the
> "most correct" way to do it on todays hardware, and todays software,
> and todays browsers. Perhaps when we have flying cars it won't be the
> best way anymore, but until then =)
>
> --
> Thadeus
>
>
>
>
>
>
>
> On Sat, Jul 31, 2010 at 7:28 PM, Jonathan Lundell  wrote:
> > On Jul 31, 2010, at 5:09 PM, Scott wrote:
>
> >> In essence your argument is that it would take too much time and you
> >> could change the hmac key monthly to prevent an attack.  I understand
> >> and respect that signed cookies are one way to solve the problem, but
> >> I do not believe they are the "most correct" way.
>
> >> My analogy would be the difference between a handheld portable safe
> >> (signed cookie) and a bank (server-side session).  If your money is
> >> stored in the bank, it's a lot harder to steal it because a thief
> >> would need to break into the bank whereas a thief has all the time in
> >> the world with a portable safe (which are also a lot easier to
> >> break).  With computer processing speed and algorithms (particularly
> >> distributed computing) I am not sure that signed cookies will remain
> >> as "safe" as they are today.  With regard to changing the hmac key,
> >> you are right they should be periodically changed although this would
> >> need to be carefully planned as it essentially invalidates sessions
> >> when it changes.  I believe it would also would invalidate stored
> >> encrypted data unless you use a one-time method to decrypt then re-
> >> encrypt the data using the new hmac key.
>
> >> In summary, I believe server-side sessions to be more secure than
> >> client-side cookies, period.
>
> > As a practical matter, I don't think it's much of an issue. A SHA-1 based 
> > HMAC, or SHA-2 if you're feeling especially paranoid, is not going to be 
> > cracked within the lifetime of a session. Notice that unlike encryption of 
> > sensitive data, cracking the session HMAC has no value once the session has 
> > expired. So the ability to attack it for months offline isn't of much use.
>
> > The expiration problem could be handled by having two keys active at any 
> > given time, with their valid-time overlapped, so you have an 'old' key and 
> > a 'new' key. If someone comes in with an old key, replace the HMAC with a 
> > new version.


Re: [web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread Thadeus Burgess
IP addresses can be faked... well anything sent to the server can be
spoofed. It is much easier to hijack a session token and steal the
users login than it is to crack a signed cookie.

I agree we need both methods in web2py, with the ability to specify
which method we want.

--
Thadeus





On Sat, Jul 31, 2010 at 7:57 PM, Scott  wrote:
> True, the PCI-DSS mandates things like that, such as tokenizing credit
> cards and only passing the tokens, using a centralized secure database
> to store the data, etc.  WRT the site cookie, you'd have access to
> what that user has been authorized to see, sure.  There are other
> standard-practice methods like associating the IP address to the
> session (again, built into web2py)...  I just happen to be paranoid
> about these types of things and would rather give out as little
> information as humanly possible to the client.  That is to say, only
> the session token.  Call it the Principle of Least Information =)  WRT
> this not being an issue on today's hardware, sure I agree.  I have a
> tendency to look for what not only works today but works for the
> future to prevent having to redesign the system a few years down the
> road.  I'd rather do the hard work now to pay dividends down the
> road.
>
> So how about a compromise - let's switch to using secure, HTTPOnly,
> signed and encrypted cookies which store the session token and give
> the programmer the option to store some data in the cookie if
> required.  Just put a caveat that the least amount should be stored
> (and in any case, less than the 4k limit).
>
> On Jul 31, 8:38 pm, Thadeus Burgess  wrote:
>> @Scott, I think your argument is based on assuming a bad programming
>> design. If you have any type of data that needs to be secure to that
>> detail, I hope to god your not storing them in the session in the
>> first place! I mean, if I somehow copy your sites cookie from a user,
>> I now have access to the entire site anyways.
>>
>> You should only be storing data in a session that won't compromise
>> your data in the first place. Userid doesn't mean anything even if the
>> cookie was cracked (though on todays hardware would take 900 trillion
>> years to crack a good hmac key). If your storing an encrypted tree of
>> credit cards in the session, don't you think it would be appropriate
>> to redesign your application and store that in the database instead?
>>
>> Not to mention, google, facebook, twitter, microsoft, quicken, chase,
>> capitalone, visa, etc. etc.. all use signed cookies... They are the
>> "most correct" way to do it on todays hardware, and todays software,
>> and todays browsers. Perhaps when we have flying cars it won't be the
>> best way anymore, but until then =)
>>
>> --
>> Thadeus
>>
>>
>>
>>
>>
>>
>>
>> On Sat, Jul 31, 2010 at 7:28 PM, Jonathan Lundell  wrote:
>> > On Jul 31, 2010, at 5:09 PM, Scott wrote:
>>
>> >> In essence your argument is that it would take too much time and you
>> >> could change the hmac key monthly to prevent an attack.  I understand
>> >> and respect that signed cookies are one way to solve the problem, but
>> >> I do not believe they are the "most correct" way.
>>
>> >> My analogy would be the difference between a handheld portable safe
>> >> (signed cookie) and a bank (server-side session).  If your money is
>> >> stored in the bank, it's a lot harder to steal it because a thief
>> >> would need to break into the bank whereas a thief has all the time in
>> >> the world with a portable safe (which are also a lot easier to
>> >> break).  With computer processing speed and algorithms (particularly
>> >> distributed computing) I am not sure that signed cookies will remain
>> >> as "safe" as they are today.  With regard to changing the hmac key,
>> >> you are right they should be periodically changed although this would
>> >> need to be carefully planned as it essentially invalidates sessions
>> >> when it changes.  I believe it would also would invalidate stored
>> >> encrypted data unless you use a one-time method to decrypt then re-
>> >> encrypt the data using the new hmac key.
>>
>> >> In summary, I believe server-side sessions to be more secure than
>> >> client-side cookies, period.
>>
>> > As a practical matter, I don't think it's much of an issue. A SHA-1 based 
>> > HMAC, or SHA-2 if you're feeling especially paranoid, is not going to be 
>> > cracked within the lifetime of a session. Notice that unlike encryption of 
>> > sensitive data, cracking the session HMAC has no value once the session 
>> > has expired. So the ability to attack it for months offline isn't of much 
>> > use.
>>
>> > The expiration problem could be handled by having two keys active at any 
>> > given time, with their valid-time overlapped, so you have an 'old' key and 
>> > a 'new' key. If someone comes in with an old key, replace the HMAC with a 
>> > new version.
>


[web2py] Re: rewrite url using routes.py

2010-07-31 Thread rochacbruno
taking advantage of the thead, I wonder if has any secret or tip to
make it working on GAE

given:

http://mydomain.appspot.com/application/controller/action/arg1/arg2/

to be:

http://mydomain.appspot.com/action/arg1/arg2

any way to hide "application/controller" part ?

if yes, please show me the code to routes,py

{{=thanks}}


On Jul 30, 2:51 pm, Vasile Ermicioi  wrote:
> rename routes.example.py to routes.py


[web2py] Re: fun with metaclasses

2010-07-31 Thread Iceberg
That is correct. But in practice, it is already labor-intensive to
keep the only official book up with the quick evolution of web2py
code, it will be a waste to have two paralleled document project, one
official and one community-driven.

Unless the community works on a complement project, not a replacement.
Say, web2py-slices, or a wiki (http://wiki.web2py.com). And ideally,
the future book (4th, 5th ... edition) can use content in community-
based document, as long as its latest electronic version is always
available on www.web2py.com/book, will it?

Regards,
Iceberg

On Aug 1, 2:44 am, Thadeus Burgess  wrote:
> The book is not released as open source. Massimo can only post it
> online through a loophole with his publisher.
>
> any community based documentation will need to be started from the
> ground up, and not taking anything from the book.
>
> --
> Thadeus
>
>
>
> On Sat, Jul 31, 2010 at 12:56 PM, Scott  wrote:
> > I support community contributions but there still needs to be an
> > "editor" or someone ultimately responsible for the changes.
>
> > On Jul 31, 11:27 am, VP  wrote:
> >> I completely support these ideas.  It seems the book is Massimo's
> >> effort, not a community's effort.  Documentation needs to be a
> >> community effort; look at Django, Drupal.
>
> >> On Jul 30, 11:03 pm, Bruno Rocha  wrote:
>
> >> > I completelly agree with Jonathan, I also want to have a deeper 
> >> > explanation
> >> > on DAL backgrounds.
>
> >> > web2py is Agile enough for me and for my development team, but, 
> >> > sometimes we
> >> > spent more time trying to figure out "how to" to some things, and testing
> >> > alternatives than developing real solutions.
>
> >> > The book is very good when we need to solve common and trivial things,
> >> > otherwise when we need to go further. The only solution has been testing,
> >> > looking for examples, using this list, or in many cases reading the 
> >> > source
> >> > code and trying to understand what is happening behind the scenes. It 
> >> > costs
> >> > a great time.
>
> >> > As was mentioned in the "why I hate Django" video, using frameworks you 
> >> > gain
> >> > time in the early stages, but lost much more in that we need to refine 
> >> > and
> >> > tune up applications.
>
> >> > For this reason I support a forum , IMHO, until we have a
> >> > broader and deeper documentation, a forum would be much more usable than
> >> > this list, and the DRY concept could be applied more easily to posts in a
> >> > forum, rather than messages in this list.
> >> > Forum can do things like a good search engine, sintax highlighting,
> >> > screenshots embeded in to the context
> >> > and yet it is possible to create mechanisms for threads to be followed by
> >> > email, and people could start new threads by email as well.  Perhaps 
> >> > using
> >> > markmin syntax to include files, highlight the code, and things ... more
>
> >> > This type of platform could be better used to build further 
> >> > documentation.
>
> >> > why not support and start an official web2py forum?
>
> >> > 2010/7/30 Jonathan Lundell 
>
> >> > > On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
>
> >> > > > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
> >> > > >> On Jul 30, 2010, at 9:19 AM, VP wrote:
> >> > > >>> On Jul 30, 9:35 am, mdipierro  wrote:
>
> >> > >http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
>
> >> > > >>> This is really nice.  Please do more of this.
>
> >> > > >> My initial reaction is the opposite. The result might be more 
> >> > > >> readable,
> >> > > but it doesn't strike me as more writable.
>
> >> > > >> What would be most helpful for me would be a deeper explanation (in 
> >> > > >> the
> >> > > book) of what's going on behind the existing DAL "magic" syntax, 
> >> > > rather than
> >> > > adding yet another layer of magic.
>
> >> > > > You make a good point, Jonathan. And I think there is a underlying
> >> > > > question here. Which kind of audience is web2py targeting to?  If for
> >> > > > developers, the existing DAL syntax is already powerful and magical
> >> > > > enough (the document is also good, here it is.
> >> > >http://web2py.com/book/default/chapter/06
> >> > > > ). Developers don't need another layer which is more fancy but not
> >> > > > more powerful.
>
> >> > > I'm not satisfied with the treatment in the book. I'd like to see each 
> >> > > of
> >> > > the DAL objects more completely described, especially as to the 
> >> > > underlying
> >> > > Python types and the operations that they implicitly support. Several 
> >> > > of
> >> > > them IIRC are polymorphic wrt their argument types, and you either 
> >> > > have to
> >> > > divine this telepathically or read the source in detail. Likewise 
> >> > > operator
> >> > > overloading.
>
> >> > > I'm sure it's second nature to Massimo, but for most of us, we have to 
> >> > > hunt
> >> > > around for an example that matches our situation, and blindly copy & 
> >> > > paste.
> >> > > Either

Re: [web2py] Re: fun with metaclasses

2010-07-31 Thread Bruno Rocha
It is impossible not to use the official book as a reference. since the book
is the only official documentation available.
I use it for  writing a series of tutorials and handouts, used for training
that I will give, and I'm also writing a documentation in Portuguese, for
beginners with web2py.

In all cases, the Official Book has been used as a reference, and often
translated and quoted.

I support the creation of a platform for documentation, but once the
incentive does not come through Massimo and development team.

I believe that nobody will feel motivated to get something in the dark.



2010/7/31 Thadeus Burgess 

> The book is not released as open source. Massimo can only post it
> online through a loophole with his publisher.
>
> any community based documentation will need to be started from the
> ground up, and not taking anything from the book.
>
> --
> Thadeus
>
>
>
>
>
> On Sat, Jul 31, 2010 at 12:56 PM, Scott  wrote:
> > I support community contributions but there still needs to be an
> > "editor" or someone ultimately responsible for the changes.
> >
> > On Jul 31, 11:27 am, VP  wrote:
> >> I completely support these ideas.  It seems the book is Massimo's
> >> effort, not a community's effort.  Documentation needs to be a
> >> community effort; look at Django, Drupal.
> >>
> >> On Jul 30, 11:03 pm, Bruno Rocha  wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > I completelly agree with Jonathan, I also want to have a deeper
> explanation
> >> > on DAL backgrounds.
> >>
> >> > web2py is Agile enough for me and for my development team, but,
> sometimes we
> >> > spent more time trying to figure out "how to" to some things, and
> testing
> >> > alternatives than developing real solutions.
> >>
> >> > The book is very good when we need to solve common and trivial things,
> >> > otherwise when we need to go further. The only solution has been
> testing,
> >> > looking for examples, using this list, or in many cases reading the
> source
> >> > code and trying to understand what is happening behind the scenes. It
> costs
> >> > a great time.
> >>
> >> > As was mentioned in the "why I hate Django" video, using frameworks
> you gain
> >> > time in the early stages, but lost much more in that we need to refine
> and
> >> > tune up applications.
> >>
> >> > For this reason I support a forum , IMHO, until we have
> a
> >> > broader and deeper documentation, a forum would be much more usable
> than
> >> > this list, and the DRY concept could be applied more easily to posts
> in a
> >> > forum, rather than messages in this list.
> >> > Forum can do things like a good search engine, sintax highlighting,
> >> > screenshots embeded in to the context
> >> > and yet it is possible to create mechanisms for threads to be followed
> by
> >> > email, and people could start new threads by email as well.  Perhaps
> using
> >> > markmin syntax to include files, highlight the code, and things ...
> more
> >>
> >> > This type of platform could be better used to build further
> documentation.
> >>
> >> > why not support and start an official web2py forum?
> >>
> >> > 2010/7/30 Jonathan Lundell 
> >>
> >> > > On Jul 30, 2010, at 7:22 PM, Iceberg wrote:
> >>
> >> > > > On Jul 31, 1:15 am, Jonathan Lundell  wrote:
> >> > > >> On Jul 30, 2010, at 9:19 AM, VP wrote:
> >> > > >>> On Jul 30, 9:35 am, mdipierro  wrote:
> >>
> >> > >
> http://gluonframework.wordpress.com/2010/07/30/web2py-and-metaclasses/
> >>
> >> > > >>> This is really nice.  Please do more of this.
> >>
> >> > > >> My initial reaction is the opposite. The result might be more
> readable,
> >> > > but it doesn't strike me as more writable.
> >>
> >> > > >> What would be most helpful for me would be a deeper explanation
> (in the
> >> > > book) of what's going on behind the existing DAL "magic" syntax,
> rather than
> >> > > adding yet another layer of magic.
> >>
> >> > > > You make a good point, Jonathan. And I think there is a underlying
> >> > > > question here. Which kind of audience is web2py targeting to?  If
> for
> >> > > > developers, the existing DAL syntax is already powerful and
> magical
> >> > > > enough (the document is also good, here it is.
> >> > >http://web2py.com/book/default/chapter/06
> >> > > > ). Developers don't need another layer which is more fancy but not
> >> > > > more powerful.
> >>
> >> > > I'm not satisfied with the treatment in the book. I'd like to see
> each of
> >> > > the DAL objects more completely described, especially as to the
> underlying
> >> > > Python types and the operations that they implicitly support.
> Several of
> >> > > them IIRC are polymorphic wrt their argument types, and you either
> have to
> >> > > divine this telepathically or read the source in detail. Likewise
> operator
> >> > > overloading.
> >>
> >> > > I'm sure it's second nature to Massimo, but for most of us, we have
> to hunt
> >> > > around for an example that matches our situation, and blindly copy &
> paste.
> >> > > Either that or experi

[web2py] Re: auth_membership problem

2010-07-31 Thread mdipierro
Can I see your model

On 31 Lug, 23:56, Johann Spies  wrote:
> I am using Web2py  Version 1.81.5 (2010-07-22 23:56:21).
>
> In user_auth I use "username".  I am trying to setup access control
> measures.  When I try to add a record to the auth_membership table
> using appadmin, I get the following ticket:
>
> Traceback (most recent call last):
>   File "/Users/js/Programmeer/zenex/web2py/gluon/restricted.py", line
> 178, in restricted
>     exec ccode in environment
>   File 
> "/Users/js/Programmeer/zenex/web2py/applications/zenex/controllers/appadmin 
> .py",
> line 410, in 
>   File "/Users/js/Programmeer/zenex/web2py/gluon/globals.py", line 96,
> in 
>     self._caller = lambda f: f()
>   File 
> "/Users/js/Programmeer/zenex/web2py/applications/zenex/controllers/appadmin 
> .py",
> line 124, in insert
>     form = SQLFORM(db[table], ignore_rw=ignore_rw)
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sqlhtml.py", line
> 706, in __init__
>     inp = self.widgets.options.widget(field, default)
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sqlhtml.py", line
> 187, in widget
>     options = requires[0].options()
>   File "/Users/js/Programmeer/zenex/web2py/gluon/validators.py", line
> 422, in options
>     self.build_set()
>   File "/Users/js/Programmeer/zenex/web2py/gluon/validators.py", line
> 406, in build_set
>     records = self.dbset.select(*self.fields, **dd)
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3144, in select
>     return self.parse(db,rows,self.colnames,SetClass=Set)
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 3166, in parse
>     field = table[fieldname]
>   File "/Users/js/Programmeer/zenex/web2py/gluon/sql.py", line 1592,
> in __getitem__
>     return dict.__getitem__(self, str(key))
> KeyError: 'first_name'
>
> Is this a bug?
>
> Regards
> Johann
>
> --
>     "Be not deceived; God is not mocked: for whatsoever a
>      man soweth, that shall he also reap."
>                                   Galatians 6:7


[web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread mdipierro
You have db(...).select()
This new syntax is a shortcut for  db().select().first()

On 31 Lug, 20:40, Thadeus Burgess  wrote:
> If there are multiple records we need to know about it =/
>
> --
> Thadeus
>
>
>
> On Sat, Jul 31, 2010 at 11:36 AM, mdipierro  wrote:
> > No. Only the first.
>
> > Massimo
>
> > On Jul 31, 10:50 am, David Marko  wrote:
> >> ### print db.person(name='john')
> >> Does it also return many items when many items matches the condition?
>
> >> David
>
> >> On 31 čnc, 13:57, mdipierro  wrote:
>
> >> > given
>
> >> >   db.define_table('person',Field('name'))
> >> >   id = db.person.insert(name='john')
>
> >> > You can now do
>
> >> >   print db.person(id)
> >> >   print db.person(db.person.name=='john')
> >> >   print db.person(name='john')
> >> >   print db.person(id,name='john')
>
> >> > they all return the same record 'john'. On failure (record does not
> >> > exist) they return None. This allows the following syntax:
>
> >> >   record = db.person(request.args(0)) or redirect(URL('error'))
>
> >> > this is better than
>
> >> >   record = db.person[request.args(0)] or redirect(URL('error'))
>
> >> > since the latter raises an exception in case request.args(0) is not
> >> > None or an int.


[web2py] Re: block problem in 1.81.5

2010-07-31 Thread mdipierro
I do not understand what this thread is about

On 31 Lug, 20:49, Thadeus Burgess  wrote:
> >.<
> On Sat, Jul 31, 2010 at 2:52 AM, mdipierro  wrote:
> > ?
>
> > On Jul 31, 1:02 am, BearXu  wrote:
> >> report block is not defined


[web2py] Re: App Migration

2010-07-31 Thread mdipierro
This may also be useful


http://gluonframework.wordpress.com/2010/03/02/shell-only-web2py/

On 31 Lug, 22:56, Chase Lee  wrote:
> Thanks so much!  That is astonishingly easy.  I've been looking at
> working with web2py (coming from Django and Pylons), and I'm quite
> convinced now.
>
> Thanks again.
>
> On Jul 31, 4:00 am, mdipierro  wrote:
>
>
>
> > From admin click on [pack app] and on the other host admin upload the
> > generated w2p file.
>
> > Alteranatively
>
> > host1:/web2py/applications> zip -r myapp.zip myapp
> > host1:/web2py/applications> scp myapp.zip y...@host2:/
> > host1:/web2py/applications> ssh y...@host2
> > host2:/web2py/applications> sudo -u www-data bash
> > host2:/web2py/applications> cd /where/it/is/web2py/applications
> > host2:/web2py/applications> unzip ~you/web2py.zip
>
> > On Jul 31, 12:46 am, Chase Lee  wrote:
>
> > > What's the process for migrating an app from one host to another or
> > > from localhost to a hosted environment?
>
> > > Thanks


[web2py] Re: "Why I hate Django" by Cal Henderson

2010-07-31 Thread mdipierro
I agree we shoud have this as an option.All we need is to add an
option to session.connect(...) Users can decide.

On 1 Ago, 03:07, Thadeus Burgess  wrote:
> IP addresses can be faked... well anything sent to the server can be
> spoofed. It is much easier to hijack a session token and steal the
> users login than it is to crack a signed cookie.
>
> I agree we need both methods in web2py, with the ability to specify
> which method we want.
>
> --
> Thadeus
>
>
>
> On Sat, Jul 31, 2010 at 7:57 PM, Scott  wrote:
> > True, the PCI-DSS mandates things like that, such as tokenizing credit
> > cards and only passing the tokens, using a centralized secure database
> > to store the data, etc.  WRT the site cookie, you'd have access to
> > what that user has been authorized to see, sure.  There are other
> > standard-practice methods like associating the IP address to the
> > session (again, built into web2py)...  I just happen to be paranoid
> > about these types of things and would rather give out as little
> > information as humanly possible to the client.  That is to say, only
> > the session token.  Call it the Principle of Least Information =)  WRT
> > this not being an issue on today's hardware, sure I agree.  I have a
> > tendency to look for what not only works today but works for the
> > future to prevent having to redesign the system a few years down the
> > road.  I'd rather do the hard work now to pay dividends down the
> > road.
>
> > So how about a compromise - let's switch to using secure, HTTPOnly,
> > signed and encrypted cookies which store the session token and give
> > the programmer the option to store some data in the cookie if
> > required.  Just put a caveat that the least amount should be stored
> > (and in any case, less than the 4k limit).
>
> > On Jul 31, 8:38 pm, Thadeus Burgess  wrote:
> >> @Scott, I think your argument is based on assuming a bad programming
> >> design. If you have any type of data that needs to be secure to that
> >> detail, I hope to god your not storing them in the session in the
> >> first place! I mean, if I somehow copy your sites cookie from a user,
> >> I now have access to the entire site anyways.
>
> >> You should only be storing data in a session that won't compromise
> >> your data in the first place. Userid doesn't mean anything even if the
> >> cookie was cracked (though on todays hardware would take 900 trillion
> >> years to crack a good hmac key). If your storing an encrypted tree of
> >> credit cards in the session, don't you think it would be appropriate
> >> to redesign your application and store that in the database instead?
>
> >> Not to mention, google, facebook, twitter, microsoft, quicken, chase,
> >> capitalone, visa, etc. etc.. all use signed cookies... They are the
> >> "most correct" way to do it on todays hardware, and todays software,
> >> and todays browsers. Perhaps when we have flying cars it won't be the
> >> best way anymore, but until then =)
>
> >> --
> >> Thadeus
>
> >> On Sat, Jul 31, 2010 at 7:28 PM, Jonathan Lundell  
> >> wrote:
> >> > On Jul 31, 2010, at 5:09 PM, Scott wrote:
>
> >> >> In essence your argument is that it would take too much time and you
> >> >> could change the hmac key monthly to prevent an attack.  I understand
> >> >> and respect that signed cookies are one way to solve the problem, but
> >> >> I do not believe they are the "most correct" way.
>
> >> >> My analogy would be the difference between a handheld portable safe
> >> >> (signed cookie) and a bank (server-side session).  If your money is
> >> >> stored in the bank, it's a lot harder to steal it because a thief
> >> >> would need to break into the bank whereas a thief has all the time in
> >> >> the world with a portable safe (which are also a lot easier to
> >> >> break).  With computer processing speed and algorithms (particularly
> >> >> distributed computing) I am not sure that signed cookies will remain
> >> >> as "safe" as they are today.  With regard to changing the hmac key,
> >> >> you are right they should be periodically changed although this would
> >> >> need to be carefully planned as it essentially invalidates sessions
> >> >> when it changes.  I believe it would also would invalidate stored
> >> >> encrypted data unless you use a one-time method to decrypt then re-
> >> >> encrypt the data using the new hmac key.
>
> >> >> In summary, I believe server-side sessions to be more secure than
> >> >> client-side cookies, period.
>
> >> > As a practical matter, I don't think it's much of an issue. A SHA-1 
> >> > based HMAC, or SHA-2 if you're feeling especially paranoid, is not going 
> >> > to be cracked within the lifetime of a session. Notice that unlike 
> >> > encryption of sensitive data, cracking the session HMAC has no value 
> >> > once the session has expired. So the ability to attack it for months 
> >> > offline isn't of much use.
>
> >> > The expiration problem could be handled by having two keys active at any 
> >> > given t

[web2py] plugin_wiki suggestions

2010-07-31 Thread Bruno Rocha
Sorry again, I am creating a new thread about plugin_wiki.

I wonder if there is any public place where we can write suggestions,
criticisms, and send questions exclusively about plugin_wiki, markmin and
cube2py?

-- 

http://rochacbruno.com.br


[web2py] Re: plugin_wiki suggestions

2010-07-31 Thread mdipierro
Not yet. You can post here for now. Not sure it needs a new place.

If you have comments please send them asap since I am about to make
some changes and write a book chapter about it tomorrow.

On 1 Ago, 04:55, Bruno Rocha  wrote:
> Sorry again, I am creating a new thread about plugin_wiki.
>
> I wonder if there is any public place where we can write suggestions,
> criticisms, and send questions exclusively about plugin_wiki, markmin and
> cube2py?
>
> --
>
> http://rochacbruno.com.br


[web2py] Re: plugin_wiki suggestions

2010-07-31 Thread mdipierro
Fornow you can post here.Please send your comments asap because I am
about to revise it and write a book chapter about it.

On 1 Ago, 04:55, Bruno Rocha  wrote:
> Sorry again, I am creating a new thread about plugin_wiki.
>
> I wonder if there is any public place where we can write suggestions,
> criticisms, and send questions exclusively about plugin_wiki, markmin and
> cube2py?
>
> --
>
> http://rochacbruno.com.br


[web2py] Re: Getting Eclipse / Pydev running

2010-07-31 Thread pabloest
Yes, that might well be it. I'm not sure the best way to "clean"
everything, or if I really want to as Wing is working fine

Pablo

On Jul 31, 3:11 pm, Thadeus Burgess  wrote:
> Odd. I am using eclipse classic with pydev on ubuntu. Debug works fine
> for me. There is something wrong with the installation paths.
>
> I'm thinking that now you have so many different versions of python on
> your mac that it is causing even more issues =/
> --
> Thadeus
>
>
>
> On Sat, Jul 31, 2010 at 2:42 PM, pabloest  wrote:
> > Hi Thadeus,
>
> > Yes, I tried that also. Same result.
>
> > Pablo
>
> > On Jul 31, 11:48 am, Thadeus Burgess  wrote:
> >> Something wrong with your setup, probably due to the fact your on a
> >> Mac, they are not the friendliest for python development.
>
> >> Have you tried installing the official python .dmg from python.org?
>
> >> --
> >> Thadeus
>
> >> On Sat, Jul 31, 2010 at 12:05 PM, pabloest  wrote:
> >> > Thanks, Rob.
>
> >> > That's what I figured. I tried downloading and reinstalling, forcing
> >> > the interpreter to be python 2.5 and 2.4, but no luck.
> >> > The netstat command didn't reveal anything, but thanks for the tip.
>
> >> > One final thing: does it matter which flavor of Eclipse is used? I
> >> > have tried the javascript and classic bundles. I assume at least the
> >> > classic should be ok.
>
> >> > Pablo
>
> >> > On Jul 30, 9:47 pm, Rob  wrote:
> >> >> I have no issues with eclipse/pydev - sounds like from your initial
> >> >> message that maybe your eclipse/pydev install is broken - maybe try to
> >> >> redownload?
>
> >> >> Do you have something else running on that port?
>
> >> >> netstat -atun | grep 51530
>
> >> >> Good luck!
>
> >> >> On Jul 30, 9:18 pm, pabloest  wrote:
>
> >> >> > well, I guess I will go with Wing, as it seems something is wrong with
> >> >> > my method or setup...
>
> >> >> > pablo
>
> >> >> > On Jul 29, 2:08 pm, pabloest  wrote:
>
> >> >> > > Thanks, Christopher.
>
> >> >> > > At some point it may make sense for me to contribute my learnings to
> >> >> > > the wiki. However, for now I'm just trying to get off the ground so 
> >> >> > > I
> >> >> > > can't provide much value.
>
> >> >> > > On Jul 29, 1:58 pm, Christopher Steel  wrote:
>
> >> >> > > > Hi Pabloest,
>
> >> >> > > > We have started a Wiki with Web2py Eclipse and Maven Stuff where 
> >> >> > > > we
> >> >> > > > publish working configurations. It may be helpful. If you want to
> >> >> > > > contribute any additional info let me know.
>
> >> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> >> >> > > > Cheer,
>
> >> >> > > > Christopher Steel
>
> >> >> > > > Voice of Access
>
> >> >> > > >http://code.google.com/p/voa-web2py2eclipse/
>
> >> >> > > > On 29 juil, 13:26, pabloest  wrote:
>
> >> >> > > > > thanks.
> >> >> > > > > normally I do, but I'm not sure where to do so in Eclipse.  
> >> >> > > > > Similarly
> >> >> > > > > with the port and address (127.0.0.1).  I checked the debug 
> >> >> > > > > config
> >> >> > > > > parameters and variables and tried a bit there, but it didn't 
> >> >> > > > > lead
> >> >> > > > > anywhere.
>
> >> >> > > > > On Jul 29, 9:54 am, Bruno Rocha  wrote:
>
> >> >> > > > > > did you provide password parameter to run web2py.py?
>
> >> >> > > > > > 2010/7/29 pabloest 
>
> >> >> > > > > > > Hi,
>
> >> >> > > > > > > I'm having some trouble simply getting started with Eclipse 
> >> >> > > > > > > and Pydev
> >> >> > > > > > > for web2py development.
> >> >> > > > > > > I can't get into a debugging mode with web2py.py and the 
> >> >> > > > > > > web server
> >> >> > > > > > > will not even start. When I right-click and select Debug As 
> >> >> > > > > > > > Python
> >> >> > > > > > > Run, I get error messages that say:
> >> >> > > > > > > -unexpected error setting up the debugger: socket closed
> >> >> > > > > > > -pydev debugger: starting
> >> >> > > > > > > Could not connect to localhost: 51530
> >> >> > > > > > > Traceback (most recent call last):
> >> >> > > > > > >  File "/Applications/eclipse/plugins/
> >> >> > > > > > > org.python.pydev.debug_1.6.0.2010071813/pysrc/pydevd_comm.py",
> >> >> > > > > > >  line
> >> >> > > > > > > 341, in StartClient
> >> >> > > > > > >    s.connect((host, port))
> >> >> > > > > > >  File "", line 1, in connect
> >> >> > > > > > > gaierror: (8, 'nodename nor servname provided, or not 
> >> >> > > > > > > known')
>
> >> >> > > > > > > I haven't modified my db.py files from the default.
> >> >> > > > > > > It seems I am missing something quite basic as I haven't 
> >> >> > > > > > > found
> >> >> > > > > > > anything on this message board or others to indicate this 
> >> >> > > > > > > is a normal
> >> >> > > > > > > problem.
>
> >> >> > > > > > > I'm running Eclipse IDE for Javascript Developers (by the 
> >> >> > > > > > > way, does it
> >> >> > > > > > > matter which Eclipse? I also tried with Eclipse Classic and 
> >> >> > > > > > > got the
> >> >> > > > > > > same results).
> >> >> > > > > > > Eclipse v1.3.0.2

Re: [web2py] Re: plugin_wiki suggestions

2010-07-31 Thread Bruno Rocha
I am developing and writing a lot with plugin_wiki (cube2py). I already have
some suggestions, observations and have also found some bugs.
As I'm finding more issues, I will posting here in this thread. If someone
else has something to add, enjoy the thread.

I am working now on this page : http://web2pybrasil.appspot.com/cursoweb2py/

*
*
*Bugs I Found:*

-* **Comments Widget*
I noticed that the comments widget is restricted to logged in users, the
code that generates the widget has requires_login (), this is great for
protecting users not logged in to write.
however, as the same widget generates the form for adding a comment, and
also generates a list of comments to display, it is not possible to display
existing comments to a user who is not logged.
I suggest dividing into two widgets, one to generate the form of insertion,
and this would be protected. And another to generate a list of existing
comments, and this would free reading. this last could be used in another
place eg:  to show recent comments for a page.

-* Searches with crud.search and jqgrid on GAE*
I got error using crud.search and jqgrid widgets, as GAE does not allow to
perform LIKE, StartsWIth, EndsWith, Contains, etc, while do not have any
workarround, I think that options should be disabled When it is detected
that is working in GAE


*Suggestions:*( Too many things. Sorry )

- *Widget_Builder:*
Binds the code generated by widget builder direct to the page content
editor, I think it is not hard to do with JavaScript, preventing the
copy-paste when using widget builder

- *Widget* *Messages customization*
Include the total capacity for customize the output messages  in the
standard widgets. "load_action" and "load_url" eg uses AJAX and display the
message "loading", it would be nice to have how to pass as a parameter, a
new message to be displayed, it is usefull for translating.

- *Blank lines, white space:*
Markdown for example set spaces by using two blank spaces at the end of each
line to make a break, I'm developing a lot with plugin_wiki and had to
create a function just to give me white space and blank lines.
``{{=br(2)}}``:template

- *Categories:*
wiki or any other type of page created with plugin_wiki, IMHO, will need
some kind of category management. it is not difficult to implement as
standard, without having to create custom widgets, as I had to do.

- *Search: *
I created a custom widget that performs searches in titles, slugs, and body
of the pages, and it is running on GAE,  I believe this should be used as a
widget placed on the meta-header, or meta-sidebar for example. but could be
part of the plugin itself, considering that this is a basic need of any wiki
page.

- *Link Targets:*
I do not think there is a specific reason not to open external links in a
wiki page, wikipedia does, it would be interesting to receive the parameter
"target" by default in the marking of a [[link]] as [[linktitle
http://linkurl  blank]]

- *Preview and Saving: *
It is very annoying having to submit  the page every time we need to save,
then to have a preview, the saving could happen with AJAX and have option to
view a Preview window.

- *Lists:*
 In ordered and unordered lists creates with - and +, Needs a way to create
sublevels with lists, maybe -- and ++
- A Topic
-- Subtopic of A Topic
--- Subtopic of a subtopic of A Topic
-- Another subtopic of A Topic

+ A Topic
++ Subtopic of A Topic
+++ Subtopic of a subtopic of A Topic
++ Another subtopic of A Topic

- *Page auto reference:*
It would be interesting to have a variable that works as ALIAS to reference
the page itself, when I need to reference the current page into a widget I
use {{= request.args(0)}} would be more interesting to use something like
"THISPAGE"

- *Wiki Pages management: *
Wiki Pages management "plugin_wiki / index" tends to get a little confusing
as the number of existing pages grows, it would be interesting to have
pagination, search, categorization.

- *Meta Pages: *
As a developer I use a lot the page meta-code, but as the code grows, things
start getting difficult to administer, would have the option to create more
pages like meta-code, for example meta-code- xxx, meta-code-something,
meta-code-anynameigive, and they have the same operation of the meta-code.

By Now , that's it. As Im using I will send more thoughts about it.
I am available for any help or tests you need.

{{=thanks}}

---
rochacbruno.com.br
@rochacbruno

2010/8/1 mdipierro 

> Fornow you can post here.Please send your comments asap because I am
> about to revise it and write a book chapter about it.
>
> On 1 Ago, 04:55, Bruno Rocha  wrote:
> > Sorry again, I am creating a new thread about plugin_wiki.
> >
> > I wonder if there is any public place where we can write suggestions,
> > criticisms, and send questions exclusively about plugin_wiki, markmin and
> > cube2py?
> >
> > --
> >
> > http://rochacbruno.com.br
>



-- 

http://rochacbruno.com.br


Re: [web2py] Re: plugin_wiki suggestions

2010-07-31 Thread Bruno Rocha
I Just found one more thing:

take this page by example:
http://web2pybrasil.appspot.com/cursoweb2py/plugin_wiki/page/curso-web2py-002

now add a ".code" to he action

http://web2pybrasil.appspot.com/cursoweb2py/plugin_wiki/page.code/curso-web2py-002

even logged out, you can see the code behind the page, as we pass parameters
to custom widgets, I think this could not happens.

but, it is usefull to still have page.load, page.xml, page.json, and
page.rss functions.


2010/8/1 Bruno Rocha 

> I am developing and writing a lot with plugin_wiki (cube2py). I already
> have some suggestions, observations and have also found some bugs.
> As I'm finding more issues, I will posting here in this thread. If someone
> else has something to add, enjoy the thread.
>
> I am working now on this page :
> http://web2pybrasil.appspot.com/cursoweb2py/
>
> *
> *
> *Bugs I Found:*
>
> -* **Comments Widget*
> I noticed that the comments widget is restricted to logged in users, the
> code that generates the widget has requires_login (), this is great for
> protecting users not logged in to write.
> however, as the same widget generates the form for adding a comment, and
> also generates a list of comments to display, it is not possible to display
> existing comments to a user who is not logged.
> I suggest dividing into two widgets, one to generate the form of insertion,
> and this would be protected. And another to generate a list of existing
> comments, and this would free reading. this last could be used in another
> place eg:  to show recent comments for a page.
>
> -* Searches with crud.search and jqgrid on GAE*
> I got error using crud.search and jqgrid widgets, as GAE does not allow to
> perform LIKE, StartsWIth, EndsWith, Contains, etc, while do not have any
> workarround, I think that options should be disabled When it is detected
> that is working in GAE
>
>
> *Suggestions:*( Too many things. Sorry )
>
> - *Widget_Builder:*
> Binds the code generated by widget builder direct to the page content
> editor, I think it is not hard to do with JavaScript, preventing the
> copy-paste when using widget builder
>
> - *Widget* *Messages customization*
> Include the total capacity for customize the output messages  in the
> standard widgets. "load_action" and "load_url" eg uses AJAX and display
> the message "loading", it would be nice to have how to pass as a parameter,
> a new message to be displayed, it is usefull for translating.
>
> - *Blank lines, white space:*
> Markdown for example set spaces by using two blank spaces at the end of
> each line to make a break, I'm developing a lot with plugin_wiki and had to
> create a function just to give me white space and blank lines.
> ``{{=br(2)}}``:template
>
> - *Categories:*
> wiki or any other type of page created with plugin_wiki, IMHO, will need
> some kind of category management. it is not difficult to implement as
> standard, without having to create custom widgets, as I had to do.
>
> - *Search: *
> I created a custom widget that performs searches in titles, slugs, and body
> of the pages, and it is running on GAE,  I believe this should be used as a
> widget placed on the meta-header, or meta-sidebar for example. but could
> be part of the plugin itself, considering that this is a basic need of any
> wiki page.
>
> - *Link Targets:*
> I do not think there is a specific reason not to open external links in a
> wiki page, wikipedia does, it would be interesting to receive the parameter
> "target" by default in the marking of a [[link]] as [[linktitle
> http://linkurl  blank]]
>
> - *Preview and Saving: *
> It is very annoying having to submit  the page every time we need to save,
> then to have a preview, the saving could happen with AJAX and have option to
> view a Preview window.
>
> - *Lists:*
>  In ordered and unordered lists creates with - and +, Needs a way to create
> sublevels with lists, maybe -- and ++
> - A Topic
> -- Subtopic of A Topic
> --- Subtopic of a subtopic of A Topic
> -- Another subtopic of A Topic
>
> + A Topic
> ++ Subtopic of A Topic
> +++ Subtopic of a subtopic of A Topic
> ++ Another subtopic of A Topic
>
> - *Page auto reference:*
> It would be interesting to have a variable that works as ALIAS to reference
> the page itself, when I need to reference the current page into a widget I
> use {{= request.args(0)}} would be more interesting to use something like
> "THISPAGE"
>
> - *Wiki Pages management: *
> Wiki Pages management "plugin_wiki / index" tends to get a little confusing
> as the number of existing pages grows, it would be interesting to have
> pagination, search, categorization.
>
> - *Meta Pages: *
> As a developer I use a lot the page meta-code, but as the code grows,
> things start getting difficult to administer, would have the option to
> create more pages like meta-code, for example meta-code- xxx,
> meta-code-something, meta-code-anynameigive, and they have the same
> operation of the meta-code.
>
> By Now , that's it. As Im using I

Re: [web2py] Re: plugin_wiki suggestions

2010-07-31 Thread Bruno Rocha
But the ".code" thing, is usefull for editors, so there is a way to ".code"
output be available only to logged in editor users?

its usefull to check the code as in
http://web2pybrasil.appspot.com/cursoweb2py/plugin_wiki/page.code/meta-code


2010/8/1 Bruno Rocha 

> I Just found one more thing:
>
> take this page by example:
>
> http://web2pybrasil.appspot.com/cursoweb2py/plugin_wiki/page/curso-web2py-002
>
> now add a ".code" to he action
>
>
> http://web2pybrasil.appspot.com/cursoweb2py/plugin_wiki/page.code/curso-web2py-002
>
> even logged out, you can see the code behind the page, as we pass
> parameters to custom widgets, I think this could not happens.
>
> but, it is usefull to still have page.load, page.xml, page.json, and
> page.rss functions.
>
>
> 2010/8/1 Bruno Rocha 
>
> I am developing and writing a lot with plugin_wiki (cube2py). I already
>> have some suggestions, observations and have also found some bugs.
>> As I'm finding more issues, I will posting here in this thread. If
>> someone else has something to add, enjoy the thread.
>>
>> I am working now on this page :
>> http://web2pybrasil.appspot.com/cursoweb2py/
>>
>> *
>> *
>> *Bugs I Found:*
>>
>> -* **Comments Widget*
>> I noticed that the comments widget is restricted to logged in users, the
>> code that generates the widget has requires_login (), this is great for
>> protecting users not logged in to write.
>> however, as the same widget generates the form for adding a comment, and
>> also generates a list of comments to display, it is not possible to display
>> existing comments to a user who is not logged.
>> I suggest dividing into two widgets, one to generate the form of
>> insertion, and this would be protected. And another to generate a list of
>> existing comments, and this would free reading. this last could be used in
>> another place eg:  to show recent comments for a page.
>>
>> -* Searches with crud.search and jqgrid on GAE*
>> I got error using crud.search and jqgrid widgets, as GAE does not allow to
>> perform LIKE, StartsWIth, EndsWith, Contains, etc, while do not have any
>> workarround, I think that options should be disabled When it is detected
>> that is working in GAE
>>
>>
>> *Suggestions:*( Too many things. Sorry )
>>
>> - *Widget_Builder:*
>> Binds the code generated by widget builder direct to the page content
>> editor, I think it is not hard to do with JavaScript, preventing the
>> copy-paste when using widget builder
>>
>> - *Widget* *Messages customization*
>> Include the total capacity for customize the output messages  in the
>> standard widgets. "load_action" and "load_url" eg uses AJAX and display
>> the message "loading", it would be nice to have how to pass as a parameter,
>> a new message to be displayed, it is usefull for translating.
>>
>> - *Blank lines, white space:*
>> Markdown for example set spaces by using two blank spaces at the end of
>> each line to make a break, I'm developing a lot with plugin_wiki and had to
>> create a function just to give me white space and blank lines.
>> ``{{=br(2)}}``:template
>>
>> - *Categories:*
>> wiki or any other type of page created with plugin_wiki, IMHO, will need
>> some kind of category management. it is not difficult to implement as
>> standard, without having to create custom widgets, as I had to do.
>>
>> - *Search: *
>> I created a custom widget that performs searches in titles, slugs, and
>> body of the pages, and it is running on GAE,  I believe this should be used
>> as a widget placed on the meta-header, or meta-sidebar for example. but
>> could be part of the plugin itself, considering that this is a basic need of
>> any wiki page.
>>
>> - *Link Targets:*
>> I do not think there is a specific reason not to open external links in a
>> wiki page, wikipedia does, it would be interesting to receive the parameter
>> "target" by default in the marking of a [[link]] as [[linktitle
>> http://linkurl  blank]]
>>
>> - *Preview and Saving: *
>> It is very annoying having to submit  the page every time we need to save,
>> then to have a preview, the saving could happen with AJAX and have option to
>> view a Preview window.
>>
>> - *Lists:*
>>  In ordered and unordered lists creates with - and +, Needs a way to
>> create sublevels with lists, maybe -- and ++
>> - A Topic
>> -- Subtopic of A Topic
>> --- Subtopic of a subtopic of A Topic
>> -- Another subtopic of A Topic
>>
>> + A Topic
>> ++ Subtopic of A Topic
>> +++ Subtopic of a subtopic of A Topic
>> ++ Another subtopic of A Topic
>>
>> - *Page auto reference:*
>> It would be interesting to have a variable that works as ALIAS to
>> reference the page itself, when I need to reference the current page into a
>> widget I use {{= request.args(0)}} would be more interesting to use
>> something like "THISPAGE"
>>
>> - *Wiki Pages management: *
>> Wiki Pages management "plugin_wiki / index" tends to get a little
>> confusing as the number of existing pages grows, it would be interesting to
>> have pagination

Re: [web2py] Re: new syntax in trunk, please check it

2010-07-31 Thread Thadeus Burgess
smells fishy

--
Thadeus





On Sat, Jul 31, 2010 at 9:23 PM, mdipierro  wrote:
> You have db(...).select()
> This new syntax is a shortcut for  db().select().first()
>
> On 31 Lug, 20:40, Thadeus Burgess  wrote:
>> If there are multiple records we need to know about it =/
>>
>> --
>> Thadeus
>>
>>
>>
>> On Sat, Jul 31, 2010 at 11:36 AM, mdipierro  wrote:
>> > No. Only the first.
>>
>> > Massimo
>>
>> > On Jul 31, 10:50 am, David Marko  wrote:
>> >> ### print db.person(name='john')
>> >> Does it also return many items when many items matches the condition?
>>
>> >> David
>>
>> >> On 31 čnc, 13:57, mdipierro  wrote:
>>
>> >> > given
>>
>> >> >   db.define_table('person',Field('name'))
>> >> >   id = db.person.insert(name='john')
>>
>> >> > You can now do
>>
>> >> >   print db.person(id)
>> >> >   print db.person(db.person.name=='john')
>> >> >   print db.person(name='john')
>> >> >   print db.person(id,name='john')
>>
>> >> > they all return the same record 'john'. On failure (record does not
>> >> > exist) they return None. This allows the following syntax:
>>
>> >> >   record = db.person(request.args(0)) or redirect(URL('error'))
>>
>> >> > this is better than
>>
>> >> >   record = db.person[request.args(0)] or redirect(URL('error'))
>>
>> >> > since the latter raises an exception in case request.args(0) is not
>> >> > None or an int.
>


Re: [web2py] Re: block problem in 1.81.5

2010-07-31 Thread Thadeus Burgess
obviously something about no definition for a block of reports =/

--
Thadeus





On Sat, Jul 31, 2010 at 9:25 PM, mdipierro  wrote:
> I do not understand what this thread is about
>
> On 31 Lug, 20:49, Thadeus Burgess  wrote:
>> >.<
>> On Sat, Jul 31, 2010 at 2:52 AM, mdipierro  wrote:
>> > ?
>>
>> > On Jul 31, 1:02 am, BearXu  wrote:
>> >> report block is not defined
>


Re: [web2py] Re: rewrite url using routes.py

2010-07-31 Thread Vasile Ermicioi
routes_in = (
('/(.*)/(.*)/(.*)',   '/$1/$3'),
)

little explanation:
$1 - app
$2 - controller
$3 - action + vars and args

as you see $2 is skipped


Re: [web2py] Re: rewrite url using routes.py

2010-07-31 Thread Vasile Ermicioi
oops, not like that but like this

routes_in = (
('/(.*)/(.*)',   '/$1/yourcontroller/$2'),
)

everything is passed to a controller (e.g. 'default')


Re: [web2py] Re: rewrite url using routes.py

2010-07-31 Thread Thadeus Burgess
Don't forget routes out

routes_out = (
  ('/(.*)/(.*)/(.*)', '/$3'),
)

--
Thadeus





On Sun, Aug 1, 2010 at 1:16 AM, Vasile Ermicioi  wrote:
> oops, not like that but like this
> routes_in = (
>     ('/(.*)/(.*)',   '/$1/yourcontroller/$2'),
> )
> everything is passed to a controller (e.g. 'default')
>