[web2py:34922] Re: Join web2py wave

2009-11-09 Thread Jason Brower

I too would love an invatation. :D
BR,
Jason
On Sun, 2009-11-08 at 13:29 -0800, Richard wrote:
> yeah! - can invite again.
> 
> Have invited:
> denes1...@yahoo.ca
> roger.gicq...@gmail.com
> mbelle...@gmail.com
> whalb...@gmail.com
> debe...@yahoo.com
> digitalcry...@gmail.com
> maxu...@gmail.com
> 
> 
> 
> On Nov 9, 2:35 am, Marat Maksumov  wrote:
> > I am very interested in receiving an invitation to Google Wave...
> >
> > On Nov 7, 10:44 am, Nicolás de la Torre  wrote:
> >
> >
> >
> > > i have sent invites to:
> >
> > > vinc...@vincentdavis.com
> > > thade...@thadeusb.com
> > > szims...@gmail.com
> > > boris.manojlo...@gmail.com
> > > richard_gor...@verizon.net
> > > chris.st...@gmail.com
> > > m.grit...@gmail.com
> > > lapcc...@gmail.com
> > > obutov...@googlemail.com
> >
> > > Pls tell me if someone is missing.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34923] Re: Using web2py with jython

2009-11-09 Thread Vasile Ermicioi
I have to convince someone that python is better than Java (and even can
work with Java) -
Jython+Web2py is my best argument :)

On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  wrote:

>
> I changed it in trunk so that it is automatic and now (again) web2py
> works with Jython out of the box. I have email the author of
> wsgiserver hoping this is fixed in the official distribution.
>
>
> On Nov 8, 1:56 pm, mdipierro  wrote:
> > jython does not seem to support socket option no_delay. In gluon/
> > wsgiserver.py replace
> >
> >  nodelay = True
> >
> > with
> >
> >  nodelay = False
> >
> > Massimo
> >
> > On Nov 8, 1:48 pm, Nik  wrote:
> >
> > > Hi folks,
> >
> > > For testing web2py with jython I have started it
> > > by executing  "jython web2py.py" and got the following
> > > error message:
> >
> > > ==
> > > saturn:web2py_1.71.2 nik$ jython web2py.py
> > > WARNING:root:no file locking
> > > WARNING:root:unable to import dbhash
> > > WARNING:root:GUI not available because Tk library is not installed
> > > default applications appear to be installed already
> > > web2py Enterprise Web Framework
> > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > Version 1.71.2 (2009-11-04 15:48:54)
> > > Database drivers available:
> > > Starting cron...
> > > choose a password:
> > > please visit:
> > >http://127.0.0.1:8000
> > > use "kill -SIGTERM 949" to shutdown the web2py server
> > > Traceback (most recent call last):
> > >   File "web2py.py", line 20, in 
> > > gluon.widget.start(cron=True)
> > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > in start
> > > server.start()
> > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > in start
> > > server.start()
> > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/main.py", line 710, in
> > > start
> > > self.server.start()
> > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py", line
> > > 1884, in start
> > > self.socket.listen(self.request_queue_size)
> > >   File "", line 1, in listen
> > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > in listen
> > > self._config()
> > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > in listen
> > > self._config()
> > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 763,
> > > in _config
> > > self.sock_impl.setsockopt(level, optname, self.pending_options
> > > [ (level, optname) ])
> > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 282,
> > > in setsockopt
> > > raise error(errno.ENOPROTOOPT, "Socket option '%s' (level '%s')
> > > not supported on socket(%s)" % (_constant_to_name(option),
> > > _constant_to_name(level), str(self.jsocket)))
> > > socket.error: (42, "Socket option 'TCP_NODELAY' (level 'IPPROTO_TCP')
> > > not supported on socket(ServerSocket[addr=/
> > > 127.0.0.1,localport=8000])")
> > > ==
> >
> > > Am I missing something here?
> >
> > > Regards
> > > Nik
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34924] Re: T2 and Empty Flash Messages

2009-11-09 Thread jensk_dk



On Nov 9, 12:20 am, mdipierro  wrote:
> On Nov 8, 4:43 pm, jensk_dk  wrote:

> > By the way, is T2 still being maintained?
>
> No. Sorry. Something better coming out soon.

Hi Massimo

Thanks for the prompt reply - and your work on web2py.

I read your answer as if I shouldn't use T2 at all and hence it is
unsupported - can you confirm?
Can you shed some light on the upcoming "replacement"? Has web2py
developed so much since T2 was written that it actually implements
some of the higH level patterns that T2 implements?
If use of T2 is deprecated, would you consider adding that info to
relevant T2 pages like the Launchpad site if that is the official
place for T2 - just to save ppl. from messing around with a deprecated
solution?

BR Jens Kristian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34925] Apache vs Cherokee vs all the rest

2009-11-09 Thread David

I recently setup a VPS host over at Santrex.net for testing web2py.
It took me about two shifts to get Cherokee installed and running with
Web2Py.  What a pain.  For those others that seemed to miss
"libcherokee-mod-libssl" that was a painful  lesson that could have
been remarked elsewhere and saved a lot of time.

One of the things I noticed was that while working on the server that
sometimes I could get the HTML source output starting with a "0"
followed by the headers and then the page content.  Ultimately this
would cause an error and the page would fail to load.   I noticed this
happened about every 10th request or sooner depending on the speed at
which I was moving through the site.

Fed up with this problem, I decided to install Apache server and
configure a VirtualHost.  This installation took about 20 minutes
including apt-get, ssl gen, and virtualhost setup etc.  It also works
flawlessly even though it is a touch slower for what I am working on
right now.

Do any other people here use Cherokee?  Is it worth my time to chase
down this page display problem?  The only drawbacks for Apache with me
are the default memory configuration issues (it's a pig out of the box
on a vps and limited if your memory is limited) and that it happens to
be the slowest, as far as I can see, based on performance reports.
That being said it's still rock solid when it comes to working with
Web2Py.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34926] Re: problem with web2py with Postgresql on OS/X 10.5

2009-11-09 Thread David

Hi Steve,

The biggest headache for me while setting up my Mac was the
pythonpath.  Even though I had Python in OSX, for some reason I had
also Python from MacPorts installed and the two different
installations were confusing me.

I resorted to setting it in .bashrc so every time I launched a
terminal it would get set and I'd be done with it.

- David

On Nov 8, 5:20 pm, mdipierro  wrote:
> Make sure you run web2py source (not binary) and use the same Python
> version that you installed psycopg2 for.
>
> On Nov 8, 5:14 pm, Steve  wrote:
>
> > After some initial success with Web2py on a PC, I set it up on a
> > Macbook Pro.  It worked but had problems with the database being
> > locked when multiple web requests came in and compute times were long
> > (running student game agents online).  So I installed Postgresql and
> > psycopg2.  However, I am having a problem getting gluon to find it.
> > I have my db=DAL('postgres://myacct:mypas...@localhost:5432/
> > aitourney')
>
> > The error I get is this:
> > NameError: global name 'psycopg2' is not defined
>
> > The traceback says this is in line 902 of gluon/sql.py in 
>
> > How do I get past this error?  Is there a particular config file where
> > I have to indicate how to find psycopg2?.
> > How is that done?  I used Macports to install psycopg2 in the default
> > location.
>
> > Thanks.  Web2py generally seems to be an awesome tool.
>
> > --Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34927] Re: Join web2py wave

2009-11-09 Thread Richard

oh right

On Nov 9, 10:01 am, hcvst  wrote:
> Hi Richard,
>
> in fact you can write 
> athttp://wavedirectory.appspot.com/init/default/wave/676f6f676c65776176...
> too. Unfortunately you need to be logged into wave (to read or write).
> The embed mechanism (an iframe) requires
> that.
>
> HC
>
> On Nov 8, 11:41 pm, Richard  wrote:
>
>
>
> > there is already a web2py wave - see if this link 
> > works:https://wave.google.com/wave/#restored:wave:googlewave.com%2521w%252B...
> > And if you don't have your invite yet there is a readonly version
> > here:http://wavedirectory.appspot.com/init/default/wave/676f6f676c65776176...
>
> > On Nov 8, 11:00 am, Thadeus Burgess  wrote:
>
> > > I think we should all start a public web2py wave! :)
>
> > > -Thadeus
>
> > > On Sat, Nov 7, 2009 at 3:54 PM, mdipierro  wrote:
>
> > > > I have account. I just have not figured out what I am supposed to do
> > > > with it.
>
> > > > On Nov 7, 3:08 pm, Nicolás de la Torre  wrote:
> > > > > Invited:
>
> > > > > debe...@yahoo.com
> > > > > kuo...@gmail.com
> > > > > murxun...@googlemail.com
> > > > > jorgeh...@gmail.com
>
> > > > > I have 5 invites left. Just ask.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34928] Creating Models the Web2Py way

2009-11-09 Thread David

So I have the following code and it's not generating tables but
perhaps my thinking isn't quite clear on this.  I can't link two
tables unless one exists previously and that table cannot reference
any other table that is not created unless a reference is used
explain why this gives me "Tables do not exist" errors no matter which
order I use...

db.define_table('product',
Field('date_added', 'datetime'),
Field('date_available', 'datetime'),
Field('name', length=55),
Field('quantity', 'integer'),
Field('price', length=10),
Field('description', 'reference db.product_description'),
Field('image', 'reference db.image'),
Field('review', 'reference db.review'))

db.define_table('image',
Field('product_id', 'reference db.product'),
Field('name'),
Field('file', 'upload'))

db.define_table('product_description',
Field('prduct_id', 'reference db.product'),
Field('description', 'text'))

db.define_table('review',
Field('product_id', 'reference db.product'),
Field('rating'),
Field('review', 'text'))


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34929] Re: cron and permissions

2009-11-09 Thread mika

I have no idea for such condition.
Maybe it is possible to add support for built-in user 'cron',
so calling functions from cron would be called as user 'cron'?


On Nov 6, 6:29 pm, mdipierro  wrote:
> You cannot do
>
> @auth.requires_membership()
>
> and call it from cron because there is no user to check permissions
> against. You can do
>
> @auth.requires(auth.has_membership(...) or condition)
>
> where condition is something that determines whether it is being
> called by CRON. I cannot think of anything that defines condition.
> Perhaps something missing in request.env? This needs to be tested. If
> you do any test, please let us know.
>
> On Nov 6, 4:58 am,mika wrote:
>
>
>
> > hi!
>
> > I noticed that if I decorate a function with a
> > @auth.requires_membership,
> > the function call from cron not work and give the:
> > WARNING:root:WEB2PY CRON Call returned code 1: No error message
> > available
>
> > what I need to enable calling such functions from cron?
>
> > my cron looks like:
> > */5 * * * *             root *control/dec_function
>
> > best regards,
> >mika
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34930] Re: Creating Models the Web2Py way

2009-11-09 Thread Mladen Milankovic

Hi.

When using reference you don't need the db. part. Only the name of the table.

Like:
Field('description', 'reference product_description'),

It uses the same database as the table you are just creating.

regards
mmlado

On Monday 09 November 2009 13:51:05 David wrote:
> So I have the following code and it's not generating tables but
> perhaps my thinking isn't quite clear on this.  I can't link two
> tables unless one exists previously and that table cannot reference
> any other table that is not created unless a reference is used
> explain why this gives me "Tables do not exist" errors no matter which
> order I use...
> 
> db.define_table('product',
> Field('date_added', 'datetime'),
> Field('date_available', 'datetime'),
> Field('name', length=55),
> Field('quantity', 'integer'),
> Field('price', length=10),
> Field('description', 'reference db.product_description'),
> Field('image', 'reference db.image'),
> Field('review', 'reference db.review'))
> 
> db.define_table('image',
> Field('product_id', 'reference db.product'),
> Field('name'),
> Field('file', 'upload'))
> 
> db.define_table('product_description',
> Field('prduct_id', 'reference db.product'),
> Field('description', 'text'))
> 
> db.define_table('review',
> Field('product_id', 'reference db.product'),
> Field('rating'),
> Field('review', 'text'))
> 
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34931] Re: Creating Models the Web2Py way

2009-11-09 Thread David

Ok so I removed the db. from all the references.  I am still getting a
similar error about tables not existing.

==
Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 184, in restricted
exec ccode in environment
  File "/var/www/web2py/applications/inventory/models/db.py", line 74,
in 
Field('review', 'reference review'))
  File "/var/www/web2py/gluon/sql.py", line 1195, in define_table
t._create_references()
  File "/var/www/web2py/gluon/sql.py", line 1454, in
_create_references
raise SyntaxError, 'Table: table \'%s\'does not exist' %
referenced
SyntaxError: Table: table 'product_description'does not exist

=

On Nov 9, 6:55 am, Mladen Milankovic  wrote:
> Hi.
>
> When using reference you don't need the db. part. Only the name of the table.
>
> Like:
> Field('description', 'reference product_description'),
>
> It uses the same database as the table you are just creating.
>
> regards
> mmlado
>
> On Monday 09 November 2009 13:51:05 David wrote:
>
> > So I have the following code and it's not generating tables but
> > perhaps my thinking isn't quite clear on this.  I can't link two
> > tables unless one exists previously and that table cannot reference
> > any other table that is not created unless a reference is used
> > explain why this gives me "Tables do not exist" errors no matter which
> > order I use...
>
> > db.define_table('product',
> >     Field('date_added', 'datetime'),
> >     Field('date_available', 'datetime'),
> >     Field('name', length=55),
> >     Field('quantity', 'integer'),
> >     Field('price', length=10),
> >     Field('description', 'reference db.product_description'),
> >     Field('image', 'reference db.image'),
> >     Field('review', 'reference db.review'))
>
> > db.define_table('image',
> >     Field('product_id', 'reference db.product'),
> >     Field('name'),
> >     Field('file', 'upload'))
>
> > db.define_table('product_description',
> >     Field('prduct_id', 'reference db.product'),
> >     Field('description', 'text'))
>
> > db.define_table('review',
> >     Field('product_id', 'reference db.product'),
> >     Field('rating'),
> >     Field('review', 'text'))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34932] Re: Creating Models the Web2Py way

2009-11-09 Thread Mladen Milankovic

Hi.

Please, explain why you need a separate description table, and why is it 
referencing product while the same time product references description table.
I think something is wrong with the database design. I didn't come across any 
database that would need this kind of referencing. If you write more about 
what you want to accomplish, we can help easier.
Should this be a many-to-many connection?

You can reference only tables that are defined before the table from where you 
are creating the reference.

regards
mmlado

On Monday 09 November 2009 14:16:56 David wrote:
> Ok so I removed the db. from all the references.  I am still getting a
> similar error about tables not existing.
> 
> ==
> Traceback (most recent call last):
>   File "/var/www/web2py/gluon/restricted.py", line 184, in restricted
> exec ccode in environment
>   File "/var/www/web2py/applications/inventory/models/db.py", line 74,
> in 
> Field('review', 'reference review'))
>   File "/var/www/web2py/gluon/sql.py", line 1195, in define_table
> t._create_references()
>   File "/var/www/web2py/gluon/sql.py", line 1454, in
> _create_references
> raise SyntaxError, 'Table: table \'%s\'does not exist' %
> referenced
> SyntaxError: Table: table 'product_description'does not exist
> 
> =
> 
> On Nov 9, 6:55 am, Mladen Milankovic  wrote:
> > Hi.
> >
> > When using reference you don't need the db. part. Only the name of the
> > table.
> >
> > Like:
> > Field('description', 'reference product_description'),
> >
> > It uses the same database as the table you are just creating.
> >
> > regards
> > mmlado
> >
> > On Monday 09 November 2009 13:51:05 David wrote:
> > > So I have the following code and it's not generating tables but
> > > perhaps my thinking isn't quite clear on this.  I can't link two
> > > tables unless one exists previously and that table cannot reference
> > > any other table that is not created unless a reference is used
> > > explain why this gives me "Tables do not exist" errors no matter which
> > > order I use...
> > >
> > > db.define_table('product',
> > > Field('date_added', 'datetime'),
> > > Field('date_available', 'datetime'),
> > > Field('name', length=55),
> > > Field('quantity', 'integer'),
> > > Field('price', length=10),
> > > Field('description', 'reference db.product_description'),
> > > Field('image', 'reference db.image'),
> > > Field('review', 'reference db.review'))
> > >
> > > db.define_table('image',
> > > Field('product_id', 'reference db.product'),
> > > Field('name'),
> > > Field('file', 'upload'))
> > >
> > > db.define_table('product_description',
> > > Field('prduct_id', 'reference db.product'),
> > > Field('description', 'text'))
> > >
> > > db.define_table('review',
> > > Field('product_id', 'reference db.product'),
> > > Field('rating'),
> > > Field('review', 'text'))
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34933] Re: Creating Models the Web2Py way

2009-11-09 Thread David

It was before coffee.  I see where my thinking went astray.

The product doesn't need to reference multiple objects but should have
a relationship with many pictures and reviews etc.  I removed those
references and it works ok.

I am not sure at this point if I need multiple description tables or
not.   I will have to think about this design a little more as I am
still learning MVC and Web2Py.   In my PHP app multiple descriptions
gave me the ability to host different formats of content for a single
product.  I could do plaintext and html descriptions for use in two
different places.


On Nov 9, 7:29 am, Mladen Milankovic  wrote:
> Hi.
>
> Please, explain why you need a separate description table, and why is it
> referencing product while the same time product references description table.
> I think something is wrong with the database design. I didn't come across any
> database that would need this kind of referencing. If you write more about
> what you want to accomplish, we can help easier.
> Should this be a many-to-many connection?
>
> You can reference only tables that are defined before the table from where you
> are creating the reference.
>
> regards
> mmlado
>
> On Monday 09 November 2009 14:16:56 David wrote:
>
> > Ok so I removed the db. from all the references.  I am still getting a
> > similar error about tables not existing.
>
> > ==
> > Traceback (most recent call last):
> >   File "/var/www/web2py/gluon/restricted.py", line 184, in restricted
> >     exec ccode in environment
> >   File "/var/www/web2py/applications/inventory/models/db.py", line 74,
> > in 
> >     Field('review', 'reference review'))
> >   File "/var/www/web2py/gluon/sql.py", line 1195, in define_table
> >     t._create_references()
> >   File "/var/www/web2py/gluon/sql.py", line 1454, in
> > _create_references
> >     raise SyntaxError, 'Table: table \'%s\'does not exist' %
> > referenced
> > SyntaxError: Table: table 'product_description'does not exist
>
> > =
>
> > On Nov 9, 6:55 am, Mladen Milankovic  wrote:
> > > Hi.
>
> > > When using reference you don't need the db. part. Only the name of the
> > > table.
>
> > > Like:
> > > Field('description', 'reference product_description'),
>
> > > It uses the same database as the table you are just creating.
>
> > > regards
> > > mmlado
>
> > > On Monday 09 November 2009 13:51:05 David wrote:
> > > > So I have the following code and it's not generating tables but
> > > > perhaps my thinking isn't quite clear on this.  I can't link two
> > > > tables unless one exists previously and that table cannot reference
> > > > any other table that is not created unless a reference is used
> > > > explain why this gives me "Tables do not exist" errors no matter which
> > > > order I use...
>
> > > > db.define_table('product',
> > > >     Field('date_added', 'datetime'),
> > > >     Field('date_available', 'datetime'),
> > > >     Field('name', length=55),
> > > >     Field('quantity', 'integer'),
> > > >     Field('price', length=10),
> > > >     Field('description', 'reference db.product_description'),
> > > >     Field('image', 'reference db.image'),
> > > >     Field('review', 'reference db.review'))
>
> > > > db.define_table('image',
> > > >     Field('product_id', 'reference db.product'),
> > > >     Field('name'),
> > > >     Field('file', 'upload'))
>
> > > > db.define_table('product_description',
> > > >     Field('prduct_id', 'reference db.product'),
> > > >     Field('description', 'text'))
>
> > > > db.define_table('review',
> > > >     Field('product_id', 'reference db.product'),
> > > >     Field('rating'),
> > > >     Field('review', 'text'))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34934] Re: Using web2py with jython

2009-11-09 Thread Timbo

Jython does support TCP_NODELAY, but it does so in the Java
fashion...that is to say only on a client socket.  The short story is
this: most platforms allow you to set socket options to server
(accepting) sockets and the accepted (client) sockets that come from
them inherit the options from the server socket.  This varies based on
platform.  Some platforms inherit all options, some just TCP_NODELAY.
Java is a little different in that it inherits none and consequently
it does not allow setting TCP_NODELAY to a server socket.

The good news is that it does support it on the client socket it just
that you have to socket.setsockopt() on the client connection after
you accept it.  This behavior is currently up for debate right now
with Jython.  See http://bugs.jython.org/issue1309

Now the blocker that I ran into with Jython + web2py is the template
module.  web2py templates rely heavily on regexps.  This is great
because it makes them fast...but Jython does something different with
cPython such that everytime I try to render a template, I get a
"Recursion limit exceeded error".  Maybe Regexps are not the same in
Java as in Python (Perl).  This is one I haven't been able to track
down.

Java (and hence Jython) is great from a concurrency perspective since
it is fully multi-threaded whereas cPython has the GIL to deal with.
It would be awesome if we could find a happy marriage between web2py
templates and Jython.

-tim

On Nov 9, 3:04 am, Vasile Ermicioi  wrote:
> I have to convince someone that python is better than Java (and even can
> work with Java) -
> Jython+Web2py is my best argument :)
>
> On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  wrote:
>
> > I changed it in trunk so that it is automatic and now (again) web2py
> > works with Jython out of the box. I have email the author of
> > wsgiserver hoping this is fixed in the official distribution.
>
> > On Nov 8, 1:56 pm, mdipierro  wrote:
> > > jython does not seem to support socket option no_delay. In gluon/
> > > wsgiserver.py replace
>
> > >  nodelay = True
>
> > > with
>
> > >  nodelay = False
>
> > > Massimo
>
> > > On Nov 8, 1:48 pm, Nik  wrote:
>
> > > > Hi folks,
>
> > > > For testing web2py with jython I have started it
> > > > by executing  "jython web2py.py" and got the following
> > > > error message:
>
> > > > ==
> > > > saturn:web2py_1.71.2 nik$ jython web2py.py
> > > > WARNING:root:no file locking
> > > > WARNING:root:unable to import dbhash
> > > > WARNING:root:GUI not available because Tk library is not installed
> > > > default applications appear to be installed already
> > > > web2py Enterprise Web Framework
> > > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > > Version 1.71.2 (2009-11-04 15:48:54)
> > > > Database drivers available:
> > > > Starting cron...
> > > > choose a password:
> > > > please visit:
> > > >        http://127.0.0.1:8000
> > > > use "kill -SIGTERM 949" to shutdown the web2py server
> > > > Traceback (most recent call last):
> > > >   File "web2py.py", line 20, in 
> > > >     gluon.widget.start(cron=True)
> > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > > in start
> > > >     server.start()
> > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > > in start
> > > >     server.start()
> > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/main.py", line 710, in
> > > > start
> > > >     self.server.start()
> > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py", line
> > > > 1884, in start
> > > >     self.socket.listen(self.request_queue_size)
> > > >   File "", line 1, in listen
> > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > > in listen
> > > >     self._config()
> > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > > in listen
> > > >     self._config()
> > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 763,
> > > > in _config
> > > >     self.sock_impl.setsockopt(level, optname, self.pending_options
> > > > [ (level, optname) ])
> > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 282,
> > > > in setsockopt
> > > >     raise error(errno.ENOPROTOOPT, "Socket option '%s' (level '%s')
> > > > not supported on socket(%s)" % (_constant_to_name(option),
> > > > _constant_to_name(level), str(self.jsocket)))
> > > > socket.error: (42, "Socket option 'TCP_NODELAY' (level 'IPPROTO_TCP')
> > > > not supported on socket(ServerSocket[addr=/
> > > > 127.0.0.1,localport=8000])")
> > > > ==
>
> > > > Am I missing something here?
>
> > > > Regards
> > > > Nik
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send 

[web2py:34935] Re: Creating Models the Web2Py way

2009-11-09 Thread Mladen Milankovic

Hi.

In case of different descriptions for one product, one-to-many, I would 
recommend leaving out description reference in the product. This way one 
product can have multiple entries in description table, which are identified by 
the product id. This  should be enough.
I can imagine a need for reference in the product to the description, like 
default description. In this can u can use an integer field and do the changes 
manually.

regards
mmlado

On Monday 09 November 2009 14:44:59 David wrote:
> It was before coffee.  I see where my thinking went astray.
> 
> The product doesn't need to reference multiple objects but should have
> a relationship with many pictures and reviews etc.  I removed those
> references and it works ok.
> 
> I am not sure at this point if I need multiple description tables or
> not.   I will have to think about this design a little more as I am
> still learning MVC and Web2Py.   In my PHP app multiple descriptions
> gave me the ability to host different formats of content for a single
> product.  I could do plaintext and html descriptions for use in two
> different places.
> 
> On Nov 9, 7:29 am, Mladen Milankovic  wrote:
> > Hi.
> >
> > Please, explain why you need a separate description table, and why is it
> > referencing product while the same time product references description
> > table. I think something is wrong with the database design. I didn't come
> > across any database that would need this kind of referencing. If you
> > write more about what you want to accomplish, we can help easier.
> > Should this be a many-to-many connection?
> >
> > You can reference only tables that are defined before the table from
> > where you are creating the reference.
> >
> > regards
> > mmlado
> >
> > On Monday 09 November 2009 14:16:56 David wrote:
> > > Ok so I removed the db. from all the references.  I am still getting a
> > > similar error about tables not existing.
> > >
> > > ==
> > > Traceback (most recent call last):
> > >   File "/var/www/web2py/gluon/restricted.py", line 184, in restricted
> > > exec ccode in environment
> > >   File "/var/www/web2py/applications/inventory/models/db.py", line 74,
> > > in 
> > > Field('review', 'reference review'))
> > >   File "/var/www/web2py/gluon/sql.py", line 1195, in define_table
> > > t._create_references()
> > >   File "/var/www/web2py/gluon/sql.py", line 1454, in
> > > _create_references
> > > raise SyntaxError, 'Table: table \'%s\'does not exist' %
> > > referenced
> > > SyntaxError: Table: table 'product_description'does not exist
> > >
> > > =
> > >
> > > On Nov 9, 6:55 am, Mladen Milankovic  wrote:
> > > > Hi.
> > > >
> > > > When using reference you don't need the db. part. Only the name of
> > > > the table.
> > > >
> > > > Like:
> > > > Field('description', 'reference product_description'),
> > > >
> > > > It uses the same database as the table you are just creating.
> > > >
> > > > regards
> > > > mmlado
> > > >
> > > > On Monday 09 November 2009 13:51:05 David wrote:
> > > > > So I have the following code and it's not generating tables but
> > > > > perhaps my thinking isn't quite clear on this.  I can't link two
> > > > > tables unless one exists previously and that table cannot reference
> > > > > any other table that is not created unless a reference is used
> > > > > explain why this gives me "Tables do not exist" errors no matter
> > > > > which order I use...
> > > > >
> > > > > db.define_table('product',
> > > > > Field('date_added', 'datetime'),
> > > > > Field('date_available', 'datetime'),
> > > > > Field('name', length=55),
> > > > > Field('quantity', 'integer'),
> > > > > Field('price', length=10),
> > > > > Field('description', 'reference db.product_description'),
> > > > > Field('image', 'reference db.image'),
> > > > > Field('review', 'reference db.review'))
> > > > >
> > > > > db.define_table('image',
> > > > > Field('product_id', 'reference db.product'),
> > > > > Field('name'),
> > > > > Field('file', 'upload'))
> > > > >
> > > > > db.define_table('product_description',
> > > > > Field('prduct_id', 'reference db.product'),
> > > > > Field('description', 'text'))
> > > > >
> > > > > db.define_table('review',
> > > > > Field('product_id', 'reference db.product'),
> > > > > Field('rating'),
> > > > > Field('review', 'text'))
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34936] Re: testing a SQLFORM with doctest

2009-11-09 Thread mdipierro

There are some doctests at the bottom of gluon/sqlhtml.py you may be
able to find some examples there.

On Nov 9, 1:25 am, Ahmed Soliman  wrote:
> Yes, I would like to hear the answer of that too, what if I want to
> prepare a SQLFORM variables to be passed during doctest, how can
> possible this happen as we don't know the key that is generated during
> form creation?
>
> On Oct 28, 10:44 am, Hamadaaway  wrote:
>
> > Supposing I've a method like :
>
> > def test():
> >     '''
> >     This is a docstring. The following 3 lines are adoctest:
> >     >>> request.vars.name='Max'
> >     >>> contactForm1 = SQLFORM(db.demo)
> >     >>> test()
> >     {'name': 'Max' ,'contactForm':contactForm1}
> >     '''
> >     contactForm = SQLFORM(db.demo)
> >     return dict(contactForm=contactForm,name=request.vars.name)
>
> > how can I test the SQLFORM usingdoctest, since the previous code
> > fails in testing?
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34937] Re: T2 and Empty Flash Messages

2009-11-09 Thread mdipierro



On Nov 9, 5:16 am, jensk_dk  wrote:
> On Nov 9, 12:20 am, mdipierro  wrote:
>
> > On Nov 8, 4:43 pm, jensk_dk  wrote:
> > > By the way, is T2 still being maintained?
>
> > No. Sorry. Something better coming out soon.
>
> Hi Massimo
>
> Thanks for the prompt reply - and your work on web2py.
>
> I read your answer as if I shouldn't use T2 at all and hence it is
> unsupported - can you confirm?
> Can you shed some light on the upcoming "replacement"? Has web2py
> developed so much since T2 was written that it actually implements
> some of the higH level patterns that T2 implements?

Almost everything in T2 but the wiki and widgets is not in gluon/
tools.py and implementedmuch better in web2py core.

> If use of T2 is deprecated, would you consider adding that info to
> relevant T2 pages like the Launchpad site if that is the official
> place for T2 - just to save ppl. from messing around with a deprecated
> solution?

I will do it asap. I forgot there was a launchpad t2.

> BR Jens Kristian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34938] Re: cron and permissions

2009-11-09 Thread mdipierro

Need to think about this one.

On Nov 9, 6:53 am, mika  wrote:
> I have no idea for such condition.
> Maybe it is possible to add support for built-in user 'cron',
> so calling functions from cron would be called as user 'cron'?
>
> On Nov 6, 6:29 pm, mdipierro  wrote:
>
> > You cannot do
>
> > @auth.requires_membership()
>
> > and call it from cron because there is no user to check permissions
> > against. You can do
>
> > @auth.requires(auth.has_membership(...) or condition)
>
> > where condition is something that determines whether it is being
> > called by CRON. I cannot think of anything that defines condition.
> > Perhaps something missing in request.env? This needs to be tested. If
> > you do any test, please let us know.
>
> > On Nov 6, 4:58 am,mika wrote:
>
> > > hi!
>
> > > I noticed that if I decorate a function with a
> > > @auth.requires_membership,
> > > the function call from cron not work and give the:
> > > WARNING:root:WEB2PY CRON Call returned code 1: No error message
> > > available
>
> > > what I need to enable calling such functions from cron?
>
> > > my cron looks like:
> > > */5 * * * *             root *control/dec_function
>
> > > best regards,
> > >mika
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34939] Re: Using web2py with jython

2009-11-09 Thread mdipierro

Can you send me the view that creates the regex problem in Jython. I
have seen it before and I thought it was fixed.

On Nov 9, 7:53 am, Timbo  wrote:
> Jython does support TCP_NODELAY, but it does so in the Java
> fashion...that is to say only on a client socket.  The short story is
> this: most platforms allow you to set socket options to server
> (accepting) sockets and the accepted (client) sockets that come from
> them inherit the options from the server socket.  This varies based on
> platform.  Some platforms inherit all options, some just TCP_NODELAY.
> Java is a little different in that it inherits none and consequently
> it does not allow setting TCP_NODELAY to a server socket.
>
> The good news is that it does support it on the client socket it just
> that you have to socket.setsockopt() on the client connection after
> you accept it.  This behavior is currently up for debate right now
> with Jython.  Seehttp://bugs.jython.org/issue1309
>
> Now the blocker that I ran into with Jython + web2py is the template
> module.  web2py templates rely heavily on regexps.  This is great
> because it makes them fast...but Jython does something different with
> cPython such that everytime I try to render a template, I get a
> "Recursion limit exceeded error".  Maybe Regexps are not the same in
> Java as in Python (Perl).  This is one I haven't been able to track
> down.
>
> Java (and hence Jython) is great from a concurrency perspective since
> it is fully multi-threaded whereas cPython has the GIL to deal with.
> It would be awesome if we could find a happy marriage between web2py
> templates and Jython.
>
> -tim
>
> On Nov 9, 3:04 am, Vasile Ermicioi  wrote:
>
> > I have to convince someone that python is better than Java (and even can
> > work with Java) -
> > Jython+Web2py is my best argument :)
>
> > On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  wrote:
>
> > > I changed it in trunk so that it is automatic and now (again) web2py
> > > works with Jython out of the box. I have email the author of
> > > wsgiserver hoping this is fixed in the official distribution.
>
> > > On Nov 8, 1:56 pm, mdipierro  wrote:
> > > > jython does not seem to support socket option no_delay. In gluon/
> > > > wsgiserver.py replace
>
> > > >  nodelay = True
>
> > > > with
>
> > > >  nodelay = False
>
> > > > Massimo
>
> > > > On Nov 8, 1:48 pm, Nik  wrote:
>
> > > > > Hi folks,
>
> > > > > For testing web2py with jython I have started it
> > > > > by executing  "jython web2py.py" and got the following
> > > > > error message:
>
> > > > > ==
> > > > > saturn:web2py_1.71.2 nik$ jython web2py.py
> > > > > WARNING:root:no file locking
> > > > > WARNING:root:unable to import dbhash
> > > > > WARNING:root:GUI not available because Tk library is not installed
> > > > > default applications appear to be installed already
> > > > > web2py Enterprise Web Framework
> > > > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > > > Version 1.71.2 (2009-11-04 15:48:54)
> > > > > Database drivers available:
> > > > > Starting cron...
> > > > > choose a password:
> > > > > please visit:
> > > > >        http://127.0.0.1:8000
> > > > > use "kill -SIGTERM 949" to shutdown the web2py server
> > > > > Traceback (most recent call last):
> > > > >   File "web2py.py", line 20, in 
> > > > >     gluon.widget.start(cron=True)
> > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > > > in start
> > > > >     server.start()
> > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 852,
> > > > > in start
> > > > >     server.start()
> > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/main.py", line 710, in
> > > > > start
> > > > >     self.server.start()
> > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py", line
> > > > > 1884, in start
> > > > >     self.socket.listen(self.request_queue_size)
> > > > >   File "", line 1, in listen
> > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > > > in listen
> > > > >     self._config()
> > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 824,
> > > > > in listen
> > > > >     self._config()
> > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 763,
> > > > > in _config
> > > > >     self.sock_impl.setsockopt(level, optname, self.pending_options
> > > > > [ (level, optname) ])
> > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 282,
> > > > > in setsockopt
> > > > >     raise error(errno.ENOPROTOOPT, "Socket option '%s' (level '%s')
> > > > > not supported on socket(%s)" % (_constant_to_name(option),
> > > > > _constant_to_name(level), str(self.jsocket)))
> > > > > socket.error: (42, "Socket option 'TCP_NODELAY' (level 'IPPROTO_TCP')
> > > > > not supported on socket(ServerSocket[addr=/
> > > > > 127.0.0.1,localport=8000])")
> > > > > 

[web2py:34940] Re: Accents in URL's and Actions / Functions

2009-11-09 Thread Christopher Steel

Thank you M.

I ran a URL test on another Python based app and noticed that creating
a URL with accents results in a non-accented URL. So for example
creating a folder called "Marie-Josée" results in a folder titled
Marie-Josée (with the URL "marie-josee"). I am guessing they have a
little conversion script that takes care of this somewhere in that
towering stack of code, or that Python has a built in utility for
this.

Just for fun I tried searching for "é" via the Plone ZMI admin
interface results in this:

We're sorry, but there seems to be an error…
Since you are a site administrator, you can see the full error message
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module App.special_dtml, line 178, in _exec
  Module DocumentTemplate.DT_With, line 61, in render
  Module DocumentTemplate.DT_Util, line 196, in eval
   - __traceback_info__: _
  Module , line 0, in ?
  Module OFS.FindSupport, line 163, in ZopeFind
  Module OFS.FindSupport, line 163, in ZopeFind
  Module OFS.FindSupport, line 124, in ZopeFind
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
0: ordinal not in range(128)  <<=

I am going to try a search for "unicode" next and see what it has to
say.

C

On Nov 6, 8:11 pm, mdipierro  wrote:
> Python 2.x does not allow special chars in function names. I think 3.x
> does.
>
> On Nov 6, 5:48 pm, Christopher Steel  wrote:
>
> > I am having some users do accessibility testing for an "alpha" site
> > and we seem to be having an issue withaccentsinURL's. In addition I
> > noticed thataccentsdo not work as the name foractions.
>
> > Functions is not such a big deal for me but it would be really nice to
> > be able to useaccentsinurl's.
>
> > The links are our alpha access testing app if anyone wants to try it.
> > The site is a slight modification of the GAE mini wiki video demo by
> > MP!
>
> >URL's
>
> >    http://myvishpala.appspot.com/init/default/index/Marie-José
>
> > You can try it with a working link with noaccents, such as:
>
> >    http://myvishpala.appspot.com/init/default/index/MyPage
>
> > and it should work just fine.
>
> > In the default.py controller something like
>
> > def josé():
> >     return dict(form=auth())
>
> > will not work either (does not "show up" in the controllers list of
> >actions)
>
> > Thank you,
>
> > Christopher Steel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34941] Re: Accents in URL's and Actions / Functions

2009-11-09 Thread Christopher Steel

One possible solution ?

http://www.diveintopython.org/xml_processing/unicode.html

On Nov 6, 8:11 pm, mdipierro  wrote:
> Python 2.x does not allow special chars in function names. I think 3.x
> does.
>
> On Nov 6, 5:48 pm, Christopher Steel  wrote:
>
> > I am having some users do accessibility testing for an "alpha" site
> > and we seem to be having an issue withaccentsinURL's. In addition I
> > noticed thataccentsdo not work as the name foractions.
>
> > Functions is not such a big deal for me but it would be really nice to
> > be able to useaccentsinurl's.
>
> > The links are our alpha access testing app if anyone wants to try it.
> > The site is a slight modification of the GAE mini wiki video demo by
> > MP!
>
> >URL's
>
> >    http://myvishpala.appspot.com/init/default/index/Marie-José
>
> > You can try it with a working link with noaccents, such as:
>
> >    http://myvishpala.appspot.com/init/default/index/MyPage
>
> > and it should work just fine.
>
> > In the default.py controller something like
>
> > def josé():
> >     return dict(form=auth())
>
> > will not work either (does not "show up" in the controllers list of
> >actions)
>
> > Thank you,
>
> > Christopher Steel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34942] Re: problem with web2py with Postgresql on OS/X 10.5

2009-11-09 Thread Steve

David and Pierro,  Thank you both for these suggestions.
I'm pretty sure you both have identified my problem.  I think
I have three Python installations now what with the original, then
an old install of IDLE and its Python, and now MacPorts.
I think when I used MacPorts to install psycopg2 it defaulted
to 2.4.  I've since then tried to repeat the MacPorts install but
asking for py25-psycopg2 and it almost works, fetching and
building a lot of things, but then fails before finishing.
I'm thinking of trying a different machine or somehow
uninstalling most of my Python code and starting again.
 Thanks again for your help.
--Steve

On Nov 9, 3:53 am, David  wrote:
> Hi Steve,
>
> The biggest headache for me while setting up my Mac was the
> pythonpath.  Even though I had Python in OSX, for some reason I had
> also Python from MacPorts installed and the two different
> installations were confusing me.
>
> I resorted to setting it in .bashrc so every time I launched a
> terminal it would get set and I'd be done with it.
>
> - David
>
> On Nov 8, 5:20 pm, mdipierro  wrote:
>
> > Make sure you run web2py source (not binary) and use the same Python
> > version that you installed psycopg2 for.
>
> > On Nov 8, 5:14 pm, Steve  wrote:
>
> > > After some initial success with Web2py on a PC, I set it up on a
> > > Macbook Pro.  It worked but had problems with the database being
> > > locked when multiple web requests came in and compute times were long
> > > (running student game agents online).  So I installed Postgresql and
> > > psycopg2.  However, I am having a problem getting gluon to find it.
> > > I have my db=DAL('postgres://myacct:mypas...@localhost:5432/
> > > aitourney')
>
> > > The error I get is this:
> > > NameError: global name 'psycopg2' is not defined
>
> > > The traceback says this is in line 902 of gluon/sql.py in 
>
> > > How do I get past this error?  Is there a particular config file where
> > > I have to indicate how to find psycopg2?.
> > > How is that done?  I used Macports to install psycopg2 in the default
> > > location.
>
> > > Thanks.  Web2py generally seems to be an awesome tool.
>
> > > --Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34943] SQLFORM problem

2009-11-09 Thread Sophie

Hi, in my controller i create a SQLFORM. I am using the slyce of the
"add link". It works perfectly, tnnx renatocaliari.

I made a demo to do a multicombo, thnx Massimo for you help.

So i want to do this, i dont know if this is possible. I want to get
the combos that are in the SQLFORM, in the view so if i select a
country, it appears the state, if i select a state it appear the
city.

If i can make it from the view i wont lose the "add link", because it
only works with the SQLFORM.

Somebody can help me with this?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34944] Re: Join web2py wave

2009-11-09 Thread Massimiliano
thank you Richard :D

On Sun, Nov 8, 2009 at 10:29 PM, Richard  wrote:

>
> yeah! - can invite again.
>
> Have invited:
> denes1...@yahoo.ca
> roger.gicq...@gmail.com
> mbelle...@gmail.com
> whalb...@gmail.com
> debe...@yahoo.com
> digitalcry...@gmail.com
> maxu...@gmail.com
>
>
>
> On Nov 9, 2:35 am, Marat Maksumov  wrote:
> > I am very interested in receiving an invitation to Google Wave...
> >
> > On Nov 7, 10:44 am, Nicolás de la Torre  wrote:
> >
> >
> >
> > > i have sent invites to:
> >
> > > vinc...@vincentdavis.com
> > > thade...@thadeusb.com
> > > szims...@gmail.com
> > > boris.manojlo...@gmail.com
> > > richard_gor...@verizon.net
> > > chris.st...@gmail.com
> > > m.grit...@gmail.com
> > > lapcc...@gmail.com
> > > obutov...@googlemail.com
> >
> > > Pls tell me if someone is missing.
> >
>


-- 
Massimiliano

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34945] flexible routes

2009-11-09 Thread eggy_

Hello,

I want to divide my controller logic up into packages, where the
controller part will be 'package/subpackage/module' instead of just
'module'. Currently, I can only use a module as the controller, and
the corresponding view will be a directory with the module's name,
containing a bunch of views that correspond with the request functions
in the controller. In this case I want the view files corresponding
with the request functions in 'module' to be located in 'applications/
myapp/views/package/subpackage/module/'.

regards,

Mark

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34946] template inheritance controller super()

2009-11-09 Thread eggy_

Hello,

when I have two templates, A and B, where A extends B. How can I call
"super" from A's request function. With "super" I mean "execute the
controller that corresponds with B and optionally have its dict
automatically merge with the dict that is returned from A's request
function".
I'm currently using a decorator to do this. It optionally takes the
request, response and sesson objects and passes them to the other
controller via exec_environment. It then executes B's request
function, then A's request function, and merges and returns the
result. However, I think there should be an easier and better way to
do this.

Mark

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34947] Re: Join web2py wave

2009-11-09 Thread gkalab

I would be grateful if I'd receive an invitation, too.

Thanks,
Gerhard

On Nov 8, 7:15 am, Roger Gicquel  wrote:
> +1 pls.
>
> On Nov 8, 4:37 am, DenesL  wrote:
>
> > I will take one. Thank you.
>
> > On 7 nov, 16:08, Nicolás de la Torre  wrote:
>
> > > Invited:
>
> > > debe...@yahoo.com
> > > kuo...@gmail.com
> > > murxun...@googlemail.com
> > > jorgeh...@gmail.com
>
> > > I have 5 invites left. Just ask.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34948] Validators during db.insert

2009-11-09 Thread Frederik Wagner

Hi .*,

is there a way of making web2py run the validators configured in the
model on a dataset inserted via a direct db.table.insert statement? It
looks like I'm able to insert any kind of data, it's validated...

Thanks and Bye,
Frederik

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34949] Validators during db.insert

2009-11-09 Thread fnerdwq

Hi .*,

is there a way of making web2py run the validators configured in the
model on a dataset inserted via a direct db.table.insert statement? It
looks like I'm able to insert any kind of data, it's validated...

Thanks and Bye,
Frederik

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34950] Re: cron and permissions

2009-11-09 Thread mdipierro

Can you try:

@auth.requires(auth.has_membership(...) or not request.env)

On Nov 9, 6:53 am, mika  wrote:
> I have no idea for such condition.
> Maybe it is possible to add support for built-in user 'cron',
> so calling functions from cron would be called as user 'cron'?
>
> On Nov 6, 6:29 pm, mdipierro  wrote:
>
> > You cannot do
>
> > @auth.requires_membership()
>
> > and call it from cron because there is no user to check permissions
> > against. You can do
>
> > @auth.requires(auth.has_membership(...) or condition)
>
> > where condition is something that determines whether it is being
> > called by CRON. I cannot think of anything that defines condition.
> > Perhaps something missing in request.env? This needs to be tested. If
> > you do any test, please let us know.
>
> > On Nov 6, 4:58 am,mika wrote:
>
> > > hi!
>
> > > I noticed that if I decorate a function with a
> > > @auth.requires_membership,
> > > the function call from cron not work and give the:
> > > WARNING:root:WEB2PY CRON Call returned code 1: No error message
> > > available
>
> > > what I need to enable calling such functions from cron?
>
> > > my cron looks like:
> > > */5 * * * *             root *control/dec_function
>
> > > best regards,
> > >mika
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34951] Re: SQLFORM problem

2009-11-09 Thread mdipierro

Sorry Sophie. I am not sure I understand how this is different from
what you have.

Massimo

On Nov 9, 9:15 am, Sophie  wrote:
> Hi, in my controller i create a SQLFORM. I am using the slyce of the
> "add link". It works perfectly, tnnx renatocaliari.
>
> I made a demo to do a multicombo, thnx Massimo for you help.
>
> So i want to do this, i dont know if this is possible. I want to get
> the combos that are in the SQLFORM, in the view so if i select a
> country, it appears the state, if i select a state it appear the
> city.
>
> If i can make it from the view i wont lose the "add link", because it
> only works with the SQLFORM.
>
> Somebody can help me with this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34952] Re: flexible routes

2009-11-09 Thread mdipierro

Not sure I understand. You can put modules in modules/ and you can
have a subfolder structure.
You can also have a subfolder structure in views but your actions have
to be explicit on which view to use (response.view="html").

controllers have to be files without a subfolder structure.

On Nov 9, 4:18 am, eggy_  wrote:
> Hello,
>
> I want to divide my controller logic up into packages, where the
> controller part will be 'package/subpackage/module' instead of just
> 'module'. Currently, I can only use a module as the controller, and
> the corresponding view will be a directory with the module's name,
> containing a bunch of views that correspond with the request functions
> in the controller. In this case I want the view files corresponding
> with the request functions in 'module' to be located in 'applications/
> myapp/views/package/subpackage/module/'.
>
> regards,
>
> Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34953] Re: template inheritance controller super()

2009-11-09 Thread mdipierro

{{include ...}} end {{extend ...}} cannot be conditional because they
would prevent bytecode compilation. I would be interesting in seeing
how you are using decorators now. It may give us ideas for
improvement.

On Nov 9, 4:31 am, eggy_  wrote:
> Hello,
>
> when I have two templates, A and B, where A extends B. How can I call
> "super" from A's request function. With "super" I mean "execute the
> controller that corresponds with B and optionally have its dict
> automatically merge with the dict that is returned from A's request
> function".
> I'm currently using a decorator to do this. It optionally takes the
> request, response and sesson objects and passes them to the other
> controller via exec_environment. It then executes B's request
> function, then A's request function, and merges and returns the
> result. However, I think there should be an easier and better way to
> do this.
>
> Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34954] Newbie on web2py

2009-11-09 Thread giotech27

Hi guys.

I'm new to web2py. I need a tutorial site for first timers. Please
help. T.Y.

Gio

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34955] Re: Validators during db.insert

2009-11-09 Thread mdipierro

Validators apply to forms only not database insert. This is for speed
but also because the workflow would be unclear: how would error be
reported? As exceptions?

I guess you can define your own insert function that validates before
insert and throws an exception on failed validation.

Massimo



On Nov 9, 7:48 am, fnerdwq  wrote:
> Hi .*,
>
> is there a way of making web2py run the validators configured in the
> model on a dataset inserted via a direct db.table.insert statement? It
> looks like I'm able to insert any kind of data, it's validated...
>
> Thanks and Bye,
> Frederik
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34956] Re: Using web2py with jython

2009-11-09 Thread Timbo

No need, it blows up for me on the admin interface.  I have no special
customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.

On Nov 9, 8:34 am, mdipierro  wrote:
> Can you send me the view that creates the regex problem in Jython. I
> have seen it before and I thought it was fixed.
>
> On Nov 9, 7:53 am, Timbo  wrote:
>
> > Jython does support TCP_NODELAY, but it does so in the Java
> > fashion...that is to say only on a client socket.  The short story is
> > this: most platforms allow you to set socket options to server
> > (accepting) sockets and the accepted (client) sockets that come from
> > them inherit the options from the server socket.  This varies based on
> > platform.  Some platforms inherit all options, some just TCP_NODELAY.
> > Java is a little different in that it inherits none and consequently
> > it does not allow setting TCP_NODELAY to a server socket.
>
> > The good news is that it does support it on the client socket it just
> > that you have to socket.setsockopt() on the client connection after
> > you accept it.  This behavior is currently up for debate right now
> > with Jython.  Seehttp://bugs.jython.org/issue1309
>
> > Now the blocker that I ran into with Jython + web2py is the template
> > module.  web2py templates rely heavily on regexps.  This is great
> > because it makes them fast...but Jython does something different with
> > cPython such that everytime I try to render a template, I get a
> > "Recursion limit exceeded error".  Maybe Regexps are not the same in
> > Java as in Python (Perl).  This is one I haven't been able to track
> > down.
>
> > Java (and hence Jython) is great from a concurrency perspective since
> > it is fully multi-threaded whereas cPython has the GIL to deal with.
> > It would be awesome if we could find a happy marriage between web2py
> > templates and Jython.
>
> > -tim
>
> > On Nov 9, 3:04 am, Vasile Ermicioi  wrote:
>
> > > I have to convince someone that python is better than Java (and even can
> > > work with Java) -
> > > Jython+Web2py is my best argument :)
>
> > > On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  wrote:
>
> > > > I changed it in trunk so that it is automatic and now (again) web2py
> > > > works with Jython out of the box. I have email the author of
> > > > wsgiserver hoping this is fixed in the official distribution.
>
> > > > On Nov 8, 1:56 pm, mdipierro  wrote:
> > > > > jython does not seem to support socket option no_delay. In gluon/
> > > > > wsgiserver.py replace
>
> > > > >  nodelay = True
>
> > > > > with
>
> > > > >  nodelay = False
>
> > > > > Massimo
>
> > > > > On Nov 8, 1:48 pm, Nik  wrote:
>
> > > > > > Hi folks,
>
> > > > > > For testing web2py with jython I have started it
> > > > > > by executing  "jython web2py.py" and got the following
> > > > > > error message:
>
> > > > > > ==
> > > > > > saturn:web2py_1.71.2 nik$ jython web2py.py
> > > > > > WARNING:root:no file locking
> > > > > > WARNING:root:unable to import dbhash
> > > > > > WARNING:root:GUI not available because Tk library is not installed
> > > > > > default applications appear to be installed already
> > > > > > web2py Enterprise Web Framework
> > > > > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > > > > Version 1.71.2 (2009-11-04 15:48:54)
> > > > > > Database drivers available:
> > > > > > Starting cron...
> > > > > > choose a password:
> > > > > > please visit:
> > > > > >        http://127.0.0.1:8000
> > > > > > use "kill -SIGTERM 949" to shutdown the web2py server
> > > > > > Traceback (most recent call last):
> > > > > >   File "web2py.py", line 20, in 
> > > > > >     gluon.widget.start(cron=True)
> > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 
> > > > > > 852,
> > > > > > in start
> > > > > >     server.start()
> > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 
> > > > > > 852,
> > > > > > in start
> > > > > >     server.start()
> > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/main.py", line 710, 
> > > > > > in
> > > > > > start
> > > > > >     self.server.start()
> > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py", line
> > > > > > 1884, in start
> > > > > >     self.socket.listen(self.request_queue_size)
> > > > > >   File "", line 1, in listen
> > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > 824,
> > > > > > in listen
> > > > > >     self._config()
> > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > 824,
> > > > > > in listen
> > > > > >     self._config()
> > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > 763,
> > > > > > in _config
> > > > > >     self.sock_impl.setsockopt(level, optname, self.pending_options
> > > > > > [ (level, optname) ])
> > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > 282,
> 

[web2py:34957] Other new DAL features in trunk

2009-11-09 Thread mdipierro

Thanks to Michael Fig we have two new important features in trunk

1) to deal with legacy databases

  db.define_table('mytable',Field('myfield','id'),Field
('otherfield'))

allows to redefine the name of the 'id' field.

2) If you mess up .table files you ca try:

 delete all .table files
 db.define_table(,make_migrate=True)

The latter will rebuild missing .table files. Only works if table
defintions and db tables are consistent.

Let me know if test any of this.

Massimo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34958] Re: flexible routes

2009-11-09 Thread Timbo

Because web2py exec()s controllers rather than importing them,
packages are not currently an option.  Whats you're reason for needing
packages?  Maybe we can help you find a better solution.

On Nov 9, 4:18 am, eggy_  wrote:
> Hello,
>
> I want to divide my controller logic up into packages, where the
> controller part will be 'package/subpackage/module' instead of just
> 'module'. Currently, I can only use a module as the controller, and
> the corresponding view will be a directory with the module's name,
> containing a bunch of views that correspond with the request functions
> in the controller. In this case I want the view files corresponding
> with the request functions in 'module' to be located in 'applications/
> myapp/views/package/subpackage/module/'.
>
> regards,
>
> Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34959] Re: web2py and keyed tables

2009-11-09 Thread Timbo

You are my hero. If you ever make your way down to Oklahoma I'll take
you out for a steak dinner or something.

On Nov 8, 8:46 am, mdipierro  wrote:
> Denese. You did a fanstatic job. This was needed for some time.
>
> On Nov 8, 7:38 am, DenesL  wrote:
>
> > A) What are they?
>
> > Keyed tables are usually legacy tables that don't follow the
> > traditional hidden 'id' field construct of web2py tables.
> > Instead they define one or more fields as primary key.
> > Currently web2py supports keyed tables on DB2, MS SQL, Ingres (thanks
> > Chris Clark) and Informix (after pending patch, thanks Hans Murx).
> > To add support for other DB engines see at the bottom of this info.
>
> > B) How do you create keyed tables?
>
> > Using the same define_table as before but with one difference, the
> > table has a 'primarykey' attribute.
>
> > db.define_table('kperson',
> >     Field('name','string'),
> >     primarykey=['name'],
> >     migrate=False # for legacy tables
> > )
>
> > db.define_table('kdog',
> >     Field('name','string'),
> >     Field('owner','reference kperson.name'),
> >     primarykey=['name'],
> >     migrate=False # for legacy tables
> > )
>
> > Notes:
> > 1) primarykey is a list of the field names that make up the primary
> > key
> > 2) all primarykey fields will have NOT NULL set even if not specified
> > 3) references are to other keyed tables only
> > 4) references must use tablename.fieldname format, as shown above
> > 5) update_record function is not available
> > 6) web2py rev.1354 (or higher) has appadmin support for keyed tables.
>
> > C) How to use keyed tables?
>
> > They behave almost the same way, the differences are explained below.
>
> > >>> db.kperson.insert(name='Dave')
>
> > {'name': 'Dave'}
>
> > note: insert returns the primary key of the inserted record or None if
> > the record was not inserted
>
> > After some more inserts:
>
> > >>> print db(db.kperson.name!='').select()
>
> > kperson.name
> > Anna
> > Bart
> > Cody
> > Dave
>
> > >>> db.kdog.insert(name='Rex',owner='Cody')
>
> > {'name': 'Rex'}
>
> > >>> db.kdog.insert(name='Fido',owner='Anna')
>
> > {'name': 'Fido'}
>
> > >>> db.kdog.insert(name='Rover',owner='Cody')
>
> > {'name': 'Rover'}
>
> > >>> print db(db.kdog.name!='').select()
>
> > kdog.name,kdog.owner
> > Fido,Anna
> > Rex,Cody
> > Rover,Cody
>
> > >>> print db(db.kdog.owner=='Cody').select()
>
> > kdog.name,kdog.owner
> > Rex,Cody
> > Rover,Cody
>
> > >>> db.kdog.insert(name='Spot',owner='Bart')
>
> > {'name': 'Spot'}
>
> > >>> db(db.kdog.name=='Spot').delete()
>
> > 1
>
> > >>> db(db.kdog.name=='Lassie').delete()
>
> > 0
>
> > note: successful operations return 1, 0 otherwise
>
> > >>> db(db.kdog.name=='Rover').update(owner='Bart')
>
> > 1
>
> > >>> print db(db.kdog.name!='').select()
>
> > kdog.name,kdog.owner
> > Fido,Anna
> > Rex,Cody
> > Rover,Bart
>
> > >>> print 
> > >>> db((db.kdog.owner==db.kperson.name)&(db.kdog.name.like('R%'))).select()
>
> > kdog.name,kdog.owner,kperson.name
> > Rex,Cody,Cody
> > Rover,Bart,Bart
>
> > D) About compound (multiple) keys.
>
> > Compound keys can be defined and used in regular operations by passing
> > a dictionary.
>
> > db.define_table('mperson',
> >   Field('name1'),
> >   Field('name2'),
> >   primarykey=['name1','name2'])
>
> > >>> print db.mperson.insert(name1='Bart',name2='Simpson')
>
> > {'name2': 'Simpson', 'name1': 'Bart'}
>
> > or the equivalent>>> k={'name1': 'Lisa', 'name2':'Simpson'}
> > >>> print db.mperson.insert(**k)
>
> > {'name2': 'Simpson', 'name1': 'Lisa'}
>
> > >>> print db(db.mperson.name1!='').select()
>
> > mperson.name1,mperson.name2
> > Bart,Simpson
> > Lisa,Simpson
>
> > But references are only to single key, for now.
> > Field('x','reference mperson.name2')
>
> > For selects you have to split the key manually.
> > db((db.mperson.name1=='Bart')&(db.mperson.name2=='Simpson')).select()
>
> > E) How can I add support for DB xxx?
>
> > Glad to hear that you want to help, we can use your expertise on xxx.
> > It is not that complicated.
>
> > Step 1:
> > In gluon/sql.py look for SQL_DIALECTS.
> > It is a dictionary of command "translations" for all supported DBs.
> > Now look for the key that represent the DB you want to help adding in.
> > We need two new entries in there, one with key 'reference FK' for
> > field level foreign key and another key 'reference TFK' for table
> > level foreign key.
> > Use the entries under 'mssql' as a guide.
>
> > Step 2:
> > In the same file look for the definition of the insert function for
> > keyed tables (near line 2250 in the latest trunk).
> > Add your DB to the list in the if statement and add an exception using
> > the ones already there as a reference.
>
> > Step 3:
> > Test, test, test...
>
> > ** NOTE **: this is a work in progress.
> > Please report any problems to the group.
> > Ideas for improvement are welcome too.
>
> > Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google

[web2py:34960] Re: Using web2py with jython

2009-11-09 Thread mdipierro

I cannot reproduce this with jython2.5rc3 on mac.

On Nov 9, 9:52 am, Timbo  wrote:
> No need, it blows up for me on the admin interface.  I have no special
> customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> On Nov 9, 8:34 am, mdipierro  wrote:
>
> > Can you send me the view that creates the regex problem in Jython. I
> > have seen it before and I thought it was fixed.
>
> > On Nov 9, 7:53 am, Timbo  wrote:
>
> > > Jython does support TCP_NODELAY, but it does so in the Java
> > > fashion...that is to say only on a client socket.  The short story is
> > > this: most platforms allow you to set socket options to server
> > > (accepting) sockets and the accepted (client) sockets that come from
> > > them inherit the options from the server socket.  This varies based on
> > > platform.  Some platforms inherit all options, some just TCP_NODELAY.
> > > Java is a little different in that it inherits none and consequently
> > > it does not allow setting TCP_NODELAY to a server socket.
>
> > > The good news is that it does support it on the client socket it just
> > > that you have to socket.setsockopt() on the client connection after
> > > you accept it.  This behavior is currently up for debate right now
> > > with Jython.  Seehttp://bugs.jython.org/issue1309
>
> > > Now the blocker that I ran into with Jython + web2py is the template
> > > module.  web2py templates rely heavily on regexps.  This is great
> > > because it makes them fast...but Jython does something different with
> > > cPython such that everytime I try to render a template, I get a
> > > "Recursion limit exceeded error".  Maybe Regexps are not the same in
> > > Java as in Python (Perl).  This is one I haven't been able to track
> > > down.
>
> > > Java (and hence Jython) is great from a concurrency perspective since
> > > it is fully multi-threaded whereas cPython has the GIL to deal with.
> > > It would be awesome if we could find a happy marriage between web2py
> > > templates and Jython.
>
> > > -tim
>
> > > On Nov 9, 3:04 am, Vasile Ermicioi  wrote:
>
> > > > I have to convince someone that python is better than Java (and even can
> > > > work with Java) -
> > > > Jython+Web2py is my best argument :)
>
> > > > On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  
> > > > wrote:
>
> > > > > I changed it in trunk so that it is automatic and now (again) web2py
> > > > > works with Jython out of the box. I have email the author of
> > > > > wsgiserver hoping this is fixed in the official distribution.
>
> > > > > On Nov 8, 1:56 pm, mdipierro  wrote:
> > > > > > jython does not seem to support socket option no_delay. In gluon/
> > > > > > wsgiserver.py replace
>
> > > > > >  nodelay = True
>
> > > > > > with
>
> > > > > >  nodelay = False
>
> > > > > > Massimo
>
> > > > > > On Nov 8, 1:48 pm, Nik  wrote:
>
> > > > > > > Hi folks,
>
> > > > > > > For testing web2py with jython I have started it
> > > > > > > by executing  "jython web2py.py" and got the following
> > > > > > > error message:
>
> > > > > > > ==
> > > > > > > saturn:web2py_1.71.2 nik$ jython web2py.py
> > > > > > > WARNING:root:no file locking
> > > > > > > WARNING:root:unable to import dbhash
> > > > > > > WARNING:root:GUI not available because Tk library is not installed
> > > > > > > default applications appear to be installed already
> > > > > > > web2py Enterprise Web Framework
> > > > > > > Created by Massimo Di Pierro, Copyright 2007-2009
> > > > > > > Version 1.71.2 (2009-11-04 15:48:54)
> > > > > > > Database drivers available:
> > > > > > > Starting cron...
> > > > > > > choose a password:
> > > > > > > please visit:
> > > > > > >        http://127.0.0.1:8000
> > > > > > > use "kill -SIGTERM 949" to shutdown the web2py server
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "web2py.py", line 20, in 
> > > > > > >     gluon.widget.start(cron=True)
> > > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 
> > > > > > > 852,
> > > > > > > in start
> > > > > > >     server.start()
> > > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/widget.py", line 
> > > > > > > 852,
> > > > > > > in start
> > > > > > >     server.start()
> > > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/main.py", line 
> > > > > > > 710, in
> > > > > > > start
> > > > > > >     self.server.start()
> > > > > > >   File "/Users/nik/work/web/web2py_1.71.2/gluon/wsgiserver.py", 
> > > > > > > line
> > > > > > > 1884, in start
> > > > > > >     self.socket.listen(self.request_queue_size)
> > > > > > >   File "", line 1, in listen
> > > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > > 824,
> > > > > > > in listen
> > > > > > >     self._config()
> > > > > > >   File "/Users/nik/Applications/jython2.5.1/Lib/socket.py", line 
> > > > > > > 824,
> > > > > > > in listen
> > > > > > >     self._config()
> > > > > > >   File "/Users/nik/

[web2py:34961] Re: Newbie on web2py

2009-11-09 Thread mdipierro

Consider the web2py book here: http://web2py.com/examples/default/docs

If you know python skip chapter 2. Chapter 3 is a gentle intro.

Massimo

On Nov 9, 9:37 am, giotech27  wrote:
> Hi guys.
>
> I'm new to web2py. I need a tutorial site for first timers. Please
> help. T.Y.
>
> Gio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34962] Re: flexible routes

2009-11-09 Thread mdipierro

I do not understand what you mean by "packages". You can use python
"import whatevermodule.py"

On Nov 9, 9:56 am, Timbo  wrote:
> Because web2py exec()s controllers rather than importing them,
> packages are not currently an option.  Whats you're reason for needing
> packages?  Maybe we can help you find a better solution.
>
> On Nov 9, 4:18 am, eggy_  wrote:
>
> > Hello,
>
> > I want to divide my controller logic up into packages, where the
> > controller part will be 'package/subpackage/module' instead of just
> > 'module'. Currently, I can only use a module as the controller, and
> > the corresponding view will be a directory with the module's name,
> > containing a bunch of views that correspond with the request functions
> > in the controller. In this case I want the view files corresponding
> > with the request functions in 'module' to be located in 'applications/
> > myapp/views/package/subpackage/module/'.
>
> > regards,
>
> > Mark
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34963] Re: Apache vs Cherokee vs all the rest

2009-11-09 Thread Thadeus Burgess
I use apache on virtualhost at slicehost running multiple web2py
virtualhosts.

With one web2py instance, my server stands at around 90MB average for
memory, it *might* spike up to 115MB if I start some ram caching, however my
reports have never reported anything higher. I am running apache with
mod_wsgi. Also I havn't seen anything faster :) I would say it's a toss up
between "Just Working" and "A couple more microseconds".

-Thadeus




On Mon, Nov 9, 2009 at 5:45 AM, David  wrote:

>
> I recently setup a VPS host over at Santrex.net for testing web2py.
> It took me about two shifts to get Cherokee installed and running with
> Web2Py.  What a pain.  For those others that seemed to miss
> "libcherokee-mod-libssl" that was a painful  lesson that could have
> been remarked elsewhere and saved a lot of time.
>
> One of the things I noticed was that while working on the server that
> sometimes I could get the HTML source output starting with a "0"
> followed by the headers and then the page content.  Ultimately this
> would cause an error and the page would fail to load.   I noticed this
> happened about every 10th request or sooner depending on the speed at
> which I was moving through the site.
>
> Fed up with this problem, I decided to install Apache server and
> configure a VirtualHost.  This installation took about 20 minutes
> including apt-get, ssl gen, and virtualhost setup etc.  It also works
> flawlessly even though it is a touch slower for what I am working on
> right now.
>
> Do any other people here use Cherokee?  Is it worth my time to chase
> down this page display problem?  The only drawbacks for Apache with me
> are the default memory configuration issues (it's a pig out of the box
> on a vps and limited if your memory is limited) and that it happens to
> be the slowest, as far as I can see, based on performance reports.
> That being said it's still rock solid when it comes to working with
> Web2Py.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34964] Re: Join web2py wave

2009-11-09 Thread Thadeus Burgess
When will those of us who have been invited be able to invite?

-Thadeus




On Mon, Nov 9, 2009 at 6:01 AM, gkalab  wrote:

>
> I would be grateful if I'd receive an invitation, too.
>
> Thanks,
> Gerhard
>
> On Nov 8, 7:15 am, Roger Gicquel  wrote:
> > +1 pls.
> >
> > On Nov 8, 4:37 am, DenesL  wrote:
> >
> > > I will take one. Thank you.
> >
> > > On 7 nov, 16:08, Nicolás de la Torre  wrote:
> >
> > > > Invited:
> >
> > > > debe...@yahoo.com
> > > > kuo...@gmail.com
> > > > murxun...@googlemail.com
> > > > jorgeh...@gmail.com
> >
> > > > I have 5 invites left. Just ask.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34965] Re: Creating Models the Web2Py way

2009-11-09 Thread Dominic

Actually,

you don't need the link from product to product_description in this DB
structure as you define a 1:N join (multiple descriptions per product)
in the product_description table.

Maybe you want one product_description designated as the "current
description" of the product, in which case you should put this as an
attribute into product_description rather, otherwise the backlink
could lead to inconsistencies (meaning: the reference in product could
point to a description that doesn't point back to the product).

Dominic

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34966] Howto to make your own layouts

2009-11-09 Thread mdipierro

Assuming the 408 layouts in http://web2py.com/layouts are not enough
you can use this:

http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_make.py

It would be nice if somebody where to start a business of hosting
web2py layouts. ;-)

Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34967] Re: web2py and keyed tables

2009-11-09 Thread DenesL

@ mr.freeze: you are welcome
@ Massimo: thanks for merging it into web2py
@ Timbo: LOL, maybe someday.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34968] Re: Howto to make your own layouts

2009-11-09 Thread david bain
Massimo,
This is very useful. An excellent start to the plugin system.

On Mon, Nov 9, 2009 at 11:55 AM, mdipierro  wrote:

>
> Assuming the 408 layouts in http://web2py.com/layouts are not enough
> you can use this:
>
> http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_make.py
>
> It would be nice if somebody where to start a business of hosting
> web2py layouts. ;-)
>
> Massimo
> >
>


-- 
SplashStart - Professional Websites. Starting Now.
http://www.splashstart.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34969] Re: Using web2py with jython

2009-11-09 Thread Timbo

OK so I downloaded fresh versions of both.  If put in the above
workaroudn for the TCP_NODELAY issue.  And upon running I get:

C:\jython2.5.1>jython.bat \web2py2\web2py.py
WARNING:root:no file locking
WARNING:root:unable to import dbhash
WARNING:root:GUI not available because Tk library is not installed
unpacking apps; this may take a few seconds...
Traceback (most recent call last):
  File "\web2py2\web2py.py", line 20, in 
gluon.widget.start(cron=True)
  File "C:\web2py2\gluon\widget.py", line 726, in start
(options, args) = console()
  File "C:\web2py2\gluon\widget.py", line 699, in console
w2p_unpack('admin.w2p', 'applications/admin/')
  File "C:\web2py2\gluon\fileutils.py", line 189, in w2p_unpack
os.unlink(tarname)
  File "C:\jython2.5.1\Lib\os.py", line 342, in remove
raise OSError(0, "couldn't delete file", path)
OSError: [Errno 0] couldn't delete file: 'admin.tar'

So I wrapped that in a try-block. The next issue to deal with is a
lack of sqlite (Welcome app).  That's not difficult but annoying.
Just delete the db.py model (for now).  And that gets us to the root
issue I can't get past with any template.  Here's the traceback for
the Welcome app main page:

Traceback (most recent call last):
  File "C:\web2py2\gluon\main.py", line 459, in wsgibase
serve_controller(request, response, session)
  File "C:\web2py2\gluon\main.py", line 459, in wsgibase
serve_controller(request, response, session)
  File "C:\web2py2\gluon\main.py", line 206, in serve_controller
run_view_in(response._view_environment)
  File "C:\web2py2\gluon\compileapp.py", line 492, in run_view_in
ccode = parse_template(response.view,
  File "C:\web2py2\gluon\template.py", line 149, in parse_template
return parse(text)
  File "C:\web2py2\gluon\template.py", line 65, in parse
text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
  File "C:\web2py2\gluon\template.py", line 77, in replace
for item in regex.finditer(text, i):
RuntimeError: maximum recursion depth exceeded

This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
changes I've mentioned in this post.  There are no bugs for this in
Jython as the answer has always been "just increase the recursion
depth". I've tried setting the recursion depth to something
ridiculously high and that made no difference.

Can anyone else confirm/deny this?  I'm testing on Windows, can we get
a Linux user to test this?

-tim

On Nov 9, 10:00 am, mdipierro  wrote:
> I cannot reproduce this with jython2.5rc3 on mac.
>
> On Nov 9, 9:52 am, Timbo  wrote:
>
> > No need, it blows up for me on the admin interface.  I have no special
> > customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> > On Nov 9, 8:34 am, mdipierro  wrote:
>
> > > Can you send me the view that creates the regex problem in Jython. I
> > > have seen it before and I thought it was fixed.
>
> > > On Nov 9, 7:53 am, Timbo  wrote:
>
> > > > Jython does support TCP_NODELAY, but it does so in the Java
> > > > fashion...that is to say only on a client socket.  The short story is
> > > > this: most platforms allow you to set socket options to server
> > > > (accepting) sockets and the accepted (client) sockets that come from
> > > > them inherit the options from the server socket.  This varies based on
> > > > platform.  Some platforms inherit all options, some just TCP_NODELAY.
> > > > Java is a little different in that it inherits none and consequently
> > > > it does not allow setting TCP_NODELAY to a server socket.
>
> > > > The good news is that it does support it on the client socket it just
> > > > that you have to socket.setsockopt() on the client connection after
> > > > you accept it.  This behavior is currently up for debate right now
> > > > with Jython.  Seehttp://bugs.jython.org/issue1309
>
> > > > Now the blocker that I ran into with Jython + web2py is the template
> > > > module.  web2py templates rely heavily on regexps.  This is great
> > > > because it makes them fast...but Jython does something different with
> > > > cPython such that everytime I try to render a template, I get a
> > > > "Recursion limit exceeded error".  Maybe Regexps are not the same in
> > > > Java as in Python (Perl).  This is one I haven't been able to track
> > > > down.
>
> > > > Java (and hence Jython) is great from a concurrency perspective since
> > > > it is fully multi-threaded whereas cPython has the GIL to deal with.
> > > > It would be awesome if we could find a happy marriage between web2py
> > > > templates and Jython.
>
> > > > -tim
>
> > > > On Nov 9, 3:04 am, Vasile Ermicioi  wrote:
>
> > > > > I have to convince someone that python is better than Java (and even 
> > > > > can
> > > > > work with Java) -
> > > > > Jython+Web2py is my best argument :)
>
> > > > > On Mon, Nov 9, 2009 at 8:38 AM, mdipierro  
> > > > > wrote:
>
> > > > > > I changed it in trunk so that it is automatic and now (again) web2py
> > > > > > works with Jython out of the

[web2py:34970] Re: Using web2py with jython

2009-11-09 Thread mdipierro

The first problem is because you did not upgraded admin in a while ;-)

cd applications/admin
tar zxvf ../../admin.w2p

The second error. Can you help me fix it?

Try each one of these models?

{{='hello world'}

{{='''hello world'''}

{{="hello world"}

{{="""hello world"""}

which ones break? Any, none? Please email me privately.

Massimo

On Nov 9, 11:07 am, Timbo  wrote:
> OK so I downloaded fresh versions of both.  If put in the above
> workaroudn for the TCP_NODELAY issue.  And upon running I get:
>
> C:\jython2.5.1>jython.bat \web2py2\web2py.py
> WARNING:root:no file locking
> WARNING:root:unable to import dbhash
> WARNING:root:GUI not available because Tk library is not installed
> unpacking apps; this may take a few seconds...
> Traceback (most recent call last):
>   File "\web2py2\web2py.py", line 20, in 
>     gluon.widget.start(cron=True)
>   File "C:\web2py2\gluon\widget.py", line 726, in start
>     (options, args) = console()
>   File "C:\web2py2\gluon\widget.py", line 699, in console
>     w2p_unpack('admin.w2p', 'applications/admin/')
>   File "C:\web2py2\gluon\fileutils.py", line 189, in w2p_unpack
>     os.unlink(tarname)
>   File "C:\jython2.5.1\Lib\os.py", line 342, in remove
>     raise OSError(0, "couldn't delete file", path)
> OSError: [Errno 0] couldn't delete file: 'admin.tar'
>
> So I wrapped that in a try-block. The next issue to deal with is a
> lack of sqlite (Welcome app).  That's not difficult but annoying.
> Just delete the db.py model (for now).  And that gets us to the root
> issue I can't get past with any template.  Here's the traceback for
> the Welcome app main page:
>
> Traceback (most recent call last):
>   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
>     serve_controller(request, response, session)
>   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
>     serve_controller(request, response, session)
>   File "C:\web2py2\gluon\main.py", line 206, in serve_controller
>     run_view_in(response._view_environment)
>   File "C:\web2py2\gluon\compileapp.py", line 492, in run_view_in
>     ccode = parse_template(response.view,
>   File "C:\web2py2\gluon\template.py", line 149, in parse_template
>     return parse(text)
>   File "C:\web2py2\gluon\template.py", line 65, in parse
>     text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
>   File "C:\web2py2\gluon\template.py", line 77, in replace
>     for item in regex.finditer(text, i):
> RuntimeError: maximum recursion depth exceeded
>
> This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
> changes I've mentioned in this post.  There are no bugs for this in
> Jython as the answer has always been "just increase the recursion
> depth". I've tried setting the recursion depth to something
> ridiculously high and that made no difference.
>
> Can anyone else confirm/deny this?  I'm testing on Windows, can we get
> a Linux user to test this?
>
> -tim
>
> On Nov 9, 10:00 am, mdipierro  wrote:
>
> > I cannot reproduce this with jython2.5rc3 on mac.
>
> > On Nov 9, 9:52 am, Timbo  wrote:
>
> > > No need, it blows up for me on the admin interface.  I have no special
> > > customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> > > On Nov 9, 8:34 am, mdipierro  wrote:
>
> > > > Can you send me the view that creates the regex problem in Jython. I
> > > > have seen it before and I thought it was fixed.
>
> > > > On Nov 9, 7:53 am, Timbo  wrote:
>
> > > > > Jython does support TCP_NODELAY, but it does so in the Java
> > > > > fashion...that is to say only on a client socket.  The short story is
> > > > > this: most platforms allow you to set socket options to server
> > > > > (accepting) sockets and the accepted (client) sockets that come from
> > > > > them inherit the options from the server socket.  This varies based on
> > > > > platform.  Some platforms inherit all options, some just TCP_NODELAY.
> > > > > Java is a little different in that it inherits none and consequently
> > > > > it does not allow setting TCP_NODELAY to a server socket.
>
> > > > > The good news is that it does support it on the client socket it just
> > > > > that you have to socket.setsockopt() on the client connection after
> > > > > you accept it.  This behavior is currently up for debate right now
> > > > > with Jython.  Seehttp://bugs.jython.org/issue1309
>
> > > > > Now the blocker that I ran into with Jython + web2py is the template
> > > > > module.  web2py templates rely heavily on regexps.  This is great
> > > > > because it makes them fast...but Jython does something different with
> > > > > cPython such that everytime I try to render a template, I get a
> > > > > "Recursion limit exceeded error".  Maybe Regexps are not the same in
> > > > > Java as in Python (Perl).  This is one I haven't been able to track
> > > > > down.
>
> > > > > Java (and hence Jython) is great from a concurrency perspective since
> > > > > it is fully multi-threaded whereas cPython has the GIL to deal with.

[web2py:34971] Re: Using web2py with jython

2009-11-09 Thread mdipierro

another test. in gluon/templates.py

can you replace

re_strings = re.compile(r'(?P'
 + r"[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|"
 + r"'([^'\\]|\\.)*'|"
 + r'"""([^"]|"{1,2}(?!"))*"""|'
 + r'"([^"\\]|\\.)*")', re.DOTALL)


with

re_strings = re.compile(r'(?P'
 + r"[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|"
 + r"'([^'\\]|\\.)*'|"
 + r'"""([^"]|"{1,2}(?!"))*"""|'
 + r'"([^"\\]|\\.)*")', re.DOTALL)

Does it make things better?

Massimo
On Nov 9, 11:21 am, mdipierro  wrote:
> The first problem is because you did not upgraded admin in a while ;-)
>
> cd applications/admin
> tar zxvf ../../admin.w2p
>
> The second error. Can you help me fix it?
>
> Try each one of these models?
>
> {{='hello world'}
>
> {{='''hello world'''}
>
> {{="hello world"}
>
> {{="""hello world"""}
>
> which ones break? Any, none? Please email me privately.
>
> Massimo
>
> On Nov 9, 11:07 am, Timbo  wrote:
>
> > OK so I downloaded fresh versions of both.  If put in the above
> > workaroudn for the TCP_NODELAY issue.  And upon running I get:
>
> > C:\jython2.5.1>jython.bat \web2py2\web2py.py
> > WARNING:root:no file locking
> > WARNING:root:unable to import dbhash
> > WARNING:root:GUI not available because Tk library is not installed
> > unpacking apps; this may take a few seconds...
> > Traceback (most recent call last):
> >   File "\web2py2\web2py.py", line 20, in 
> >     gluon.widget.start(cron=True)
> >   File "C:\web2py2\gluon\widget.py", line 726, in start
> >     (options, args) = console()
> >   File "C:\web2py2\gluon\widget.py", line 699, in console
> >     w2p_unpack('admin.w2p', 'applications/admin/')
> >   File "C:\web2py2\gluon\fileutils.py", line 189, in w2p_unpack
> >     os.unlink(tarname)
> >   File "C:\jython2.5.1\Lib\os.py", line 342, in remove
> >     raise OSError(0, "couldn't delete file", path)
> > OSError: [Errno 0] couldn't delete file: 'admin.tar'
>
> > So I wrapped that in a try-block. The next issue to deal with is a
> > lack of sqlite (Welcome app).  That's not difficult but annoying.
> > Just delete the db.py model (for now).  And that gets us to the root
> > issue I can't get past with any template.  Here's the traceback for
> > the Welcome app main page:
>
> > Traceback (most recent call last):
> >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> >     serve_controller(request, response, session)
> >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> >     serve_controller(request, response, session)
> >   File "C:\web2py2\gluon\main.py", line 206, in serve_controller
> >     run_view_in(response._view_environment)
> >   File "C:\web2py2\gluon\compileapp.py", line 492, in run_view_in
> >     ccode = parse_template(response.view,
> >   File "C:\web2py2\gluon\template.py", line 149, in parse_template
> >     return parse(text)
> >   File "C:\web2py2\gluon\template.py", line 65, in parse
> >     text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
> >   File "C:\web2py2\gluon\template.py", line 77, in replace
> >     for item in regex.finditer(text, i):
> > RuntimeError: maximum recursion depth exceeded
>
> > This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
> > changes I've mentioned in this post.  There are no bugs for this in
> > Jython as the answer has always been "just increase the recursion
> > depth". I've tried setting the recursion depth to something
> > ridiculously high and that made no difference.
>
> > Can anyone else confirm/deny this?  I'm testing on Windows, can we get
> > a Linux user to test this?
>
> > -tim
>
> > On Nov 9, 10:00 am, mdipierro  wrote:
>
> > > I cannot reproduce this with jython2.5rc3 on mac.
>
> > > On Nov 9, 9:52 am, Timbo  wrote:
>
> > > > No need, it blows up for me on the admin interface.  I have no special
> > > > customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> > > > On Nov 9, 8:34 am, mdipierro  wrote:
>
> > > > > Can you send me the view that creates the regex problem in Jython. I
> > > > > have seen it before and I thought it was fixed.
>
> > > > > On Nov 9, 7:53 am, Timbo  wrote:
>
> > > > > > Jython does support TCP_NODELAY, but it does so in the Java
> > > > > > fashion...that is to say only on a client socket.  The short story 
> > > > > > is
> > > > > > this: most platforms allow you to set socket options to server
> > > > > > (accepting) sockets and the accepted (client) sockets that come from
> > > > > > them inherit the options from the server socket.  This varies based 
> > > > > > on
> > > > > > platform.  Some platforms inherit all options, some just 
> > > > > > TCP_NODELAY.
> > > > > > Java is a little different in that it inherits none and consequently
> > > > > > it does not allow setting TCP_NODELAY to a server socket.
>
> > > > > > The good news is that it does support it on the client socket

[web2py:34972] Re: Join web2py wave

2009-11-09 Thread Vidul Petrov

I got "Internal Error" while trying
http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2521w%252BDPsJaggYA

On Nov 4, 8:54 am, hcvst  wrote:
> http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
>
> A public wave to discuss wave development on web2py.
>
> HC
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34973] Re: flexible routes

2009-11-09 Thread eggy_

I guess the term 'package' is not really applicable. What I meant was
that I want to have the ability to use subdirectories as part of the
controller. So that the controller part basically becomes
'somedirectory/somecontroller'. You can currently only have a
'somecontroller'.

On Nov 9, 5:03 pm, mdipierro  wrote:
> I do not understand what you mean by "packages". You can use python
> "import whatevermodule.py"
>
> On Nov 9, 9:56 am, Timbo  wrote:
>
>
>
> > Because web2py exec()s controllers rather than importing them,
> > packages are not currently an option.  Whats you're reason for needing
> > packages?  Maybe we can help you find a better solution.
>
> > On Nov 9, 4:18 am, eggy_  wrote:
>
> > > Hello,
>
> > > I want to divide my controller logic up into packages, where the
> > > controller part will be 'package/subpackage/module' instead of just
> > > 'module'. Currently, I can only use a module as the controller, and
> > > the corresponding view will be a directory with the module's name,
> > > containing a bunch of views that correspond with the request functions
> > > in the controller. In this case I want the view files corresponding
> > > with the request functions in 'module' to be located in 'applications/
> > > myapp/views/package/subpackage/module/'.
>
> > > regards,
>
> > > Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34974] Re: Howto to make your own layouts

2009-11-09 Thread Vasile Ermicioi
Since web2py already have jquery included why not using jquery UI css
framework ?
http://jqueryui.pbworks.com/jQuery-UI-CSS-Framework
http://jqueryui.com/themeroller/

On Mon, Nov 9, 2009 at 7:06 PM, david bain  wrote:

> Massimo,
> This is very useful. An excellent start to the plugin system.
>
>
> On Mon, Nov 9, 2009 at 11:55 AM, mdipierro wrote:
>
>>
>> Assuming the 408 layouts in http://web2py.com/layouts are not enough
>> you can use this:
>>
>> http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_make.py
>>
>> It would be nice if somebody where to start a business of hosting
>> web2py layouts. ;-)
>>
>> Massimo
>>
>>
>
>
> --
> SplashStart - Professional Websites. Starting Now.
> http://www.splashstart.com
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34975] Re: flexible routes

2009-11-09 Thread mdipierro

This would require a change in the URL convention and could make
dispatching slower.
Why do you need this? I am not saying no but I need to be convinced.


On Nov 9, 12:02 pm, eggy_  wrote:
> I guess the term 'package' is not really applicable. What I meant was
> that I want to have the ability to use subdirectories as part of the
> controller. So that the controller part basically becomes
> 'somedirectory/somecontroller'. You can currently only have a
> 'somecontroller'.
>
> On Nov 9, 5:03 pm, mdipierro  wrote:
>
> > I do not understand what you mean by "packages". You can use python
> > "import whatevermodule.py"
>
> > On Nov 9, 9:56 am, Timbo  wrote:
>
> > > Because web2py exec()s controllers rather than importing them,
> > > packages are not currently an option.  Whats you're reason for needing
> > > packages?  Maybe we can help you find a better solution.
>
> > > On Nov 9, 4:18 am, eggy_  wrote:
>
> > > > Hello,
>
> > > > I want to divide my controller logic up into packages, where the
> > > > controller part will be 'package/subpackage/module' instead of just
> > > > 'module'. Currently, I can only use a module as the controller, and
> > > > the corresponding view will be a directory with the module's name,
> > > > containing a bunch of views that correspond with the request functions
> > > > in the controller. In this case I want the view files corresponding
> > > > with the request functions in 'module' to be located in 'applications/
> > > > myapp/views/package/subpackage/module/'.
>
> > > > regards,
>
> > > > Mark
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34976] Re: Howto to make your own layouts

2009-11-09 Thread mdipierro

I would love to see some layouts using it.
Could you send me some exmaples?

On Nov 9, 12:07 pm, Vasile Ermicioi  wrote:
> Since web2py already have jquery included why not using jquery UI css
> framework 
> ?http://jqueryui.pbworks.com/jQuery-UI-CSS-Frameworkhttp://jqueryui.com/themeroller/
>
> On Mon, Nov 9, 2009 at 7:06 PM, david bain  wrote:
> > Massimo,
> > This is very useful. An excellent start to the plugin system.
>
> > On Mon, Nov 9, 2009 at 11:55 AM, mdipierro wrote:
>
> >> Assuming the 408 layouts inhttp://web2py.com/layoutsare not enough
> >> you can use this:
>
> >>http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_ma...
>
> >> It would be nice if somebody where to start a business of hosting
> >> web2py layouts. ;-)
>
> >> Massimo
>
> > --
> > SplashStart - Professional Websites. Starting Now.
> >http://www.splashstart.com
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34977] Re: Chapter 1 from 2nd edition web2py book in Spanish

2009-11-09 Thread drayco

I think, you need more help in this kind of work.

Buenas tardes. Puedo ayudarlos revisando la traducción, por el
momento. A partir del 15 de Diciembre podría contribuir con uno o dos
capítulos.

Sin embargo, no quisiera dejar pasar la oportunidad para comentar que
existen frases que no refieren explícitamente con el concepto.

¿Eres un hablante nativo del español?

On Nov 8, 4:37 pm, mdipierro  wrote:
> You have been busy! This is great Denes. We have to think of a good
> way to advertise this.
>
> On Nov 8, 10:00 am, DenesL  wrote:
>
> > Chapter 1 from 2nd edition web2py book in Spanish
> > Capítulo 1 del manual web2py 2da edición en Español
>
> >http://drop.io/web2py_DenesL/asset/web2py-libro2-cap1-pdf
>
> > Want to help in translating other chapters?
> > ¿Quiere ayudar con la traducción de otros capítulos?
>
> > Contact me.
> > Contácteme.
>
> > Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34978] Re: template inheritance controller super()

2009-11-09 Thread eggy_

Indeed, the fact that {{include ...}} and {{extend ...}} can't be
conditional is a problem if you need that. But if you meant your
template to be inherited from, it's not really a problem.
This is the decorator I'm currently using: http://paste.pocoo.org/show/149598/
.

You use it (in 'controller') like

@call_super(c='othercontroller')
def somerequestfunc():
return dict(somevar='something')

to have 'somerequestfunc' in 'othercontroller' called and have its
dict merge with this 'somerequestfunc'. You can adjust the
application, controller, request function, and indicate whether to use
the request, response and session object from the current request.

For this to be useful 'theapp/controllers/controller/
somerequestfunc.html' should extend 'theapp/controllers/
othercontroller/somerequestfunc.html'.

On Nov 9, 4:39 pm, mdipierro  wrote:
> {{include ...}} end {{extend ...}} cannot be conditional because they
> would prevent bytecode compilation. I would be interesting in seeing
> how you are using decorators now. It may give us ideas for
> improvement.
>
> On Nov 9, 4:31 am, eggy_  wrote:
>
>
>
> > Hello,
>
> > when I have two templates, A and B, where A extends B. How can I call
> > "super" from A's request function. With "super" I mean "execute the
> > controller that corresponds with B and optionally have its dict
> > automatically merge with the dict that is returned from A's request
> > function".
> > I'm currently using a decorator to do this. It optionally takes the
> > request, response and sesson objects and passes them to the other
> > controller via exec_environment. It then executes B's request
> > function, then A's request function, and merges and returns the
> > result. However, I think there should be an easier and better way to
> > do this.
>
> > Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34979] Re: flexible routes

2009-11-09 Thread eggy_

I don't "need" it as such, but I want to group certain related parts
of the web application that don't necessarily need to be in the same
controller. This would be akin to a python package structure. Of
course, in python code, any program written as a set of packages and
modules can be written as a sole set of modules or even just one
module, but that doesn't mean that would be a good, logical, approach.
The same logic could be applied to web2py controllers.

On Nov 9, 7:10 pm, mdipierro  wrote:
> This would require a change in the URL convention and could make
> dispatching slower.
> Why do you need this? I am not saying no but I need to be convinced.
>
> On Nov 9, 12:02 pm, eggy_  wrote:
>
>
>
> > I guess the term 'package' is not really applicable. What I meant was
> > that I want to have the ability to use subdirectories as part of the
> > controller. So that the controller part basically becomes
> > 'somedirectory/somecontroller'. You can currently only have a
> > 'somecontroller'.
>
> > On Nov 9, 5:03 pm, mdipierro  wrote:
>
> > > I do not understand what you mean by "packages". You can use python
> > > "import whatevermodule.py"
>
> > > On Nov 9, 9:56 am, Timbo  wrote:
>
> > > > Because web2py exec()s controllers rather than importing them,
> > > > packages are not currently an option.  Whats you're reason for needing
> > > > packages?  Maybe we can help you find a better solution.
>
> > > > On Nov 9, 4:18 am, eggy_  wrote:
>
> > > > > Hello,
>
> > > > > I want to divide my controller logic up into packages, where the
> > > > > controller part will be 'package/subpackage/module' instead of just
> > > > > 'module'. Currently, I can only use a module as the controller, and
> > > > > the corresponding view will be a directory with the module's name,
> > > > > containing a bunch of views that correspond with the request functions
> > > > > in the controller. In this case I want the view files corresponding
> > > > > with the request functions in 'module' to be located in 'applications/
> > > > > myapp/views/package/subpackage/module/'.
>
> > > > > regards,
>
> > > > > Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34980] Re: Using web2py with jython

2009-11-09 Thread Timbo

No difference.

I think this is the bug we're dealing with:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

Since it's a wont-fix, our only option is to work around it by relying
less on regexps.  Is that an acceptable solution?

On Nov 9, 11:58 am, mdipierro  wrote:
> another test. in gluon/templates.py
>
> can you replace
>
> re_strings = re.compile(r'(?P'
>                          + r"[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|"
>                          + r"'([^'\\]|\\.)*'|"
>                          + r'"""([^"]|"{1,2}(?!"))*"""|'
>                          + r'"([^"\\]|\\.)*")', re.DOTALL)
>
> with
>
> re_strings = re.compile(r'(?P'
>                          + r"[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|"
>                          + r"'([^'\\]|\\.)*'|"
>                          + r'"""([^"]|"{1,2}(?!"))*"""|'
>                          + r'"([^"\\]|\\.)*")', re.DOTALL)
>
> Does it make things better?
>
> Massimo
> On Nov 9, 11:21 am, mdipierro  wrote:
>
> > The first problem is because you did not upgraded admin in a while ;-)
>
> > cd applications/admin
> > tar zxvf ../../admin.w2p
>
> > The second error. Can you help me fix it?
>
> > Try each one of these models?
>
> > {{='hello world'}
>
> > {{='''hello world'''}
>
> > {{="hello world"}
>
> > {{="""hello world"""}
>
> > which ones break? Any, none? Please email me privately.
>
> > Massimo
>
> > On Nov 9, 11:07 am, Timbo  wrote:
>
> > > OK so I downloaded fresh versions of both.  If put in the above
> > > workaroudn for the TCP_NODELAY issue.  And upon running I get:
>
> > > C:\jython2.5.1>jython.bat \web2py2\web2py.py
> > > WARNING:root:no file locking
> > > WARNING:root:unable to import dbhash
> > > WARNING:root:GUI not available because Tk library is not installed
> > > unpacking apps; this may take a few seconds...
> > > Traceback (most recent call last):
> > >   File "\web2py2\web2py.py", line 20, in 
> > >     gluon.widget.start(cron=True)
> > >   File "C:\web2py2\gluon\widget.py", line 726, in start
> > >     (options, args) = console()
> > >   File "C:\web2py2\gluon\widget.py", line 699, in console
> > >     w2p_unpack('admin.w2p', 'applications/admin/')
> > >   File "C:\web2py2\gluon\fileutils.py", line 189, in w2p_unpack
> > >     os.unlink(tarname)
> > >   File "C:\jython2.5.1\Lib\os.py", line 342, in remove
> > >     raise OSError(0, "couldn't delete file", path)
> > > OSError: [Errno 0] couldn't delete file: 'admin.tar'
>
> > > So I wrapped that in a try-block. The next issue to deal with is a
> > > lack of sqlite (Welcome app).  That's not difficult but annoying.
> > > Just delete the db.py model (for now).  And that gets us to the root
> > > issue I can't get past with any template.  Here's the traceback for
> > > the Welcome app main page:
>
> > > Traceback (most recent call last):
> > >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> > >     serve_controller(request, response, session)
> > >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> > >     serve_controller(request, response, session)
> > >   File "C:\web2py2\gluon\main.py", line 206, in serve_controller
> > >     run_view_in(response._view_environment)
> > >   File "C:\web2py2\gluon\compileapp.py", line 492, in run_view_in
> > >     ccode = parse_template(response.view,
> > >   File "C:\web2py2\gluon\template.py", line 149, in parse_template
> > >     return parse(text)
> > >   File "C:\web2py2\gluon\template.py", line 65, in parse
> > >     text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
> > >   File "C:\web2py2\gluon\template.py", line 77, in replace
> > >     for item in regex.finditer(text, i):
> > > RuntimeError: maximum recursion depth exceeded
>
> > > This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
> > > changes I've mentioned in this post.  There are no bugs for this in
> > > Jython as the answer has always been "just increase the recursion
> > > depth". I've tried setting the recursion depth to something
> > > ridiculously high and that made no difference.
>
> > > Can anyone else confirm/deny this?  I'm testing on Windows, can we get
> > > a Linux user to test this?
>
> > > -tim
>
> > > On Nov 9, 10:00 am, mdipierro  wrote:
>
> > > > I cannot reproduce this with jython2.5rc3 on mac.
>
> > > > On Nov 9, 9:52 am, Timbo  wrote:
>
> > > > > No need, it blows up for me on the admin interface.  I have no special
> > > > > customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> > > > > On Nov 9, 8:34 am, mdipierro  wrote:
>
> > > > > > Can you send me the view that creates the regex problem in Jython. I
> > > > > > have seen it before and I thought it was fixed.
>
> > > > > > On Nov 9, 7:53 am, Timbo  wrote:
>
> > > > > > > Jython does support TCP_NODELAY, but it does so in the Java
> > > > > > > fashion...that is to say only on a client socket.  The short 
> > > > > > > story is
> > > > > > > this: most platforms allow you to set socket options to server
> > > > > > > (accepting) socket

[web2py:34981] Re: Chapter 1 from 2nd edition web2py book in Spanish

2009-11-09 Thread DenesL


On Nov 9, 1:15 pm, drayco  wrote:
> I think, you need more help in this kind of work.
All the help I can get ;-)

> Buenas tardes. Puedo ayudarlos revisando la traducción, por el
> momento. A partir del 15 de Diciembre podría contribuir con uno o dos
> capítulos.
Excelente.

> Sin embargo, no quisiera dejar pasar la oportunidad para comentar que
> existen frases que no refieren explícitamente con el concepto.
>
> ¿Eres un hablante nativo del español?
Si, pero a veces la traducción no es trivial, de todas formas se
aceptan sugerencias.

Denes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34982] Re: Join web2py wave

2009-11-09 Thread DenesL

Same here.

On Nov 9, 12:58 pm, Vidul Petrov  wrote:
> I got "Internal Error" while 
> tryinghttp://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34983] Re: Using web2py with jython

2009-11-09 Thread mdipierro

This is clearly a Java bug. A major one. I love the "won't fix"

On Nov 9, 12:33 pm, Timbo  wrote:
> No difference.
>
> I think this is the bug we're dealing with:
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
>
> Since it's a wont-fix, our only option is to work around it by relying
> less on regexps.  Is that an acceptable solution?
>
> On Nov 9, 11:58 am, mdipierro  wrote:
>
> > another test. in gluon/templates.py
>
> > can you replace
>
> > re_strings = re.compile(r'(?P'
> >                          + r"[uU]?[rR]?'''([^']+|'{1,2}(?!'))*'''|"
> >                          + r"'([^'\\]|\\.)*'|"
> >                          + r'"""([^"]|"{1,2}(?!"))*"""|'
> >                          + r'"([^"\\]|\\.)*")', re.DOTALL)
>
> > with
>
> > re_strings = re.compile(r'(?P'
> >                          + r"[uU]?[rR]?'''([^']|'{1,2}(?!'))*'''|"
> >                          + r"'([^'\\]|\\.)*'|"
> >                          + r'"""([^"]|"{1,2}(?!"))*"""|'
> >                          + r'"([^"\\]|\\.)*")', re.DOTALL)
>
> > Does it make things better?
>
> > Massimo
> > On Nov 9, 11:21 am, mdipierro  wrote:
>
> > > The first problem is because you did not upgraded admin in a while ;-)
>
> > > cd applications/admin
> > > tar zxvf ../../admin.w2p
>
> > > The second error. Can you help me fix it?
>
> > > Try each one of these models?
>
> > > {{='hello world'}
>
> > > {{='''hello world'''}
>
> > > {{="hello world"}
>
> > > {{="""hello world"""}
>
> > > which ones break? Any, none? Please email me privately.
>
> > > Massimo
>
> > > On Nov 9, 11:07 am, Timbo  wrote:
>
> > > > OK so I downloaded fresh versions of both.  If put in the above
> > > > workaroudn for the TCP_NODELAY issue.  And upon running I get:
>
> > > > C:\jython2.5.1>jython.bat \web2py2\web2py.py
> > > > WARNING:root:no file locking
> > > > WARNING:root:unable to import dbhash
> > > > WARNING:root:GUI not available because Tk library is not installed
> > > > unpacking apps; this may take a few seconds...
> > > > Traceback (most recent call last):
> > > >   File "\web2py2\web2py.py", line 20, in 
> > > >     gluon.widget.start(cron=True)
> > > >   File "C:\web2py2\gluon\widget.py", line 726, in start
> > > >     (options, args) = console()
> > > >   File "C:\web2py2\gluon\widget.py", line 699, in console
> > > >     w2p_unpack('admin.w2p', 'applications/admin/')
> > > >   File "C:\web2py2\gluon\fileutils.py", line 189, in w2p_unpack
> > > >     os.unlink(tarname)
> > > >   File "C:\jython2.5.1\Lib\os.py", line 342, in remove
> > > >     raise OSError(0, "couldn't delete file", path)
> > > > OSError: [Errno 0] couldn't delete file: 'admin.tar'
>
> > > > So I wrapped that in a try-block. The next issue to deal with is a
> > > > lack of sqlite (Welcome app).  That's not difficult but annoying.
> > > > Just delete the db.py model (for now).  And that gets us to the root
> > > > issue I can't get past with any template.  Here's the traceback for
> > > > the Welcome app main page:
>
> > > > Traceback (most recent call last):
> > > >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> > > >     serve_controller(request, response, session)
> > > >   File "C:\web2py2\gluon\main.py", line 459, in wsgibase
> > > >     serve_controller(request, response, session)
> > > >   File "C:\web2py2\gluon\main.py", line 206, in serve_controller
> > > >     run_view_in(response._view_environment)
> > > >   File "C:\web2py2\gluon\compileapp.py", line 492, in run_view_in
> > > >     ccode = parse_template(response.view,
> > > >   File "C:\web2py2\gluon\template.py", line 149, in parse_template
> > > >     return parse(text)
> > > >   File "C:\web2py2\gluon\template.py", line 65, in parse
> > > >     text = replace(re_strings, text, lambda x: x.replace('\n', '\\n'))
> > > >   File "C:\web2py2\gluon\template.py", line 77, in replace
> > > >     for item in regex.finditer(text, i):
> > > > RuntimeError: maximum recursion depth exceeded
>
> > > > This is Jython 2.5.1 fresh install, 1.71.2 fresh install with only the
> > > > changes I've mentioned in this post.  There are no bugs for this in
> > > > Jython as the answer has always been "just increase the recursion
> > > > depth". I've tried setting the recursion depth to something
> > > > ridiculously high and that made no difference.
>
> > > > Can anyone else confirm/deny this?  I'm testing on Windows, can we get
> > > > a Linux user to test this?
>
> > > > -tim
>
> > > > On Nov 9, 10:00 am, mdipierro  wrote:
>
> > > > > I cannot reproduce this with jython2.5rc3 on mac.
>
> > > > > On Nov 9, 9:52 am, Timbo  wrote:
>
> > > > > > No need, it blows up for me on the admin interface.  I have no 
> > > > > > special
> > > > > > customizations.  I'm trying this on Sun JRE6/Jython2.5.1 on WinXP.
>
> > > > > > On Nov 9, 8:34 am, mdipierro  wrote:
>
> > > > > > > Can you send me the view that creates the regex problem in 
> > > > > > > Jython. I
> > > > > > > have seen it before and I thought it was fixed.
>
> > > > > > > On

[web2py:34984] Re: Join web2py wave

2009-11-09 Thread Marat Maksumov

Thank you, Richard!

On Nov 9, 12:29 am, Richard  wrote:
> yeah! - can invite again.
>
> Have invited:
> denes1...@yahoo.ca
> roger.gicq...@gmail.com
> mbelle...@gmail.com
> whalb...@gmail.com
> debe...@yahoo.com
> digitalcry...@gmail.com
> maxu...@gmail.com
>
> On Nov 9, 2:35 am, Marat Maksumov  wrote:
>
> > I am very interested in receiving an invitation to Google Wave...
>
> > On Nov 7, 10:44 am, Nicolás de la Torre  wrote:
>
> > > i have sent invites to:
>
> > > vinc...@vincentdavis.com
> > > thade...@thadeusb.com
> > > szims...@gmail.com
> > > boris.manojlo...@gmail.com
> > > richard_gor...@verizon.net
> > > chris.st...@gmail.com
> > > m.grit...@gmail.com
> > > lapcc...@gmail.com
> > > obutov...@googlemail.com
>
> > > Pls tell me if someone is missing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34985] 1.72.1 is OUT

2009-11-09 Thread mdipierro

New stuff:
- bug fix in select(...,cache=)
- bug fix in internationalization with default languages
- better polish and french translations
- better support for KeyedTables (thanks Denes) and alternate names
for 'id' fields (thanks Michael). This allow better support for legacy
databases.

Please give it a try and report any problem.

Massimo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34986] Re: 1.72.1 is OUT

2009-11-09 Thread Wes James

do you mean 1.71.2?

On Mon, Nov 9, 2009 at 1:12 PM, mdipierro  wrote:
>
> New stuff:
> - bug fix in select(...,cache=)
> - bug fix in internationalization with default languages
> - better polish and french translations
> - better support for KeyedTables (thanks Denes) and alternate names
> for 'id' fields (thanks Michael). This allow better support for legacy
> databases.
>
> Please give it a try and report any problem.
>
> Massimo
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34987] video on internationalization

2009-11-09 Thread mdipierro

http://www.vimeo.com/7520812

20 minutes extract from one of the IPD lectures. You need web2py
1.72.1 to use T.current_languages. There was a bug in the previous
versions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34988] Re: 1.72.1 is OUT

2009-11-09 Thread Wes James

nevermind - i see now it's 1.71.1 to 1.72.1  - i was thinking 1.71.1
to 1.71.2

-wes

On Mon, Nov 9, 2009 at 1:15 PM, Wes James  wrote:
> do you mean 1.71.2?
>
> On Mon, Nov 9, 2009 at 1:12 PM, mdipierro  wrote:
>>
>> New stuff:
>> - bug fix in select(...,cache=)
>> - bug fix in internationalization with default languages
>> - better polish and french translations
>> - better support for KeyedTables (thanks Denes) and alternate names
>> for 'id' fields (thanks Michael). This allow better support for legacy
>> databases.
>>
>> Please give it a try and report any problem.
>>
>> Massimo
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34989] Re: Join web2py wave

2009-11-09 Thread hcvst

Hi Vidul,

the wave's now at
http://wavedirectory.appspot.com/init/default/wave/676f6f676c65776176652e636f6d21772b4450734a6167675941

But I guess I should add the old query string method again too.

Regards,
HC


On Nov 9, 7:58 pm, Vidul Petrov  wrote:
> I got "Internal Error" while 
> tryinghttp://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
>
> On Nov 4, 8:54 am, hcvst  wrote:
>
> >http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
>
> > A public wave to discuss wave development on web2py.
>
> > HC
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34990] Re: Join web2py wave

2009-11-09 Thread mdipierro

This is really nice. Hope you do not mind, I posted a link on reddit/
programming.

On Nov 9, 2:41 pm, hcvst  wrote:
> Hi Vidul,
>
> the wave's now 
> athttp://wavedirectory.appspot.com/init/default/wave/676f6f676c65776176...
>
> But I guess I should add the old query string method again too.
>
> Regards,
> HC
>
> On Nov 9, 7:58 pm, Vidul Petrov  wrote:
>
> > I got "Internal Error" while 
> > tryinghttp://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
>
> > On Nov 4, 8:54 am, hcvst  wrote:
>
> > >http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
>
> > > A public wave to discuss wave development on web2py.
>
> > > HC
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34991] Re: Apache vs Cherokee vs all the rest

2009-11-09 Thread Graham Dumpleton



On Nov 10, 3:10 am, Thadeus Burgess  wrote:
> I use apache on virtualhost at slicehost running multiple web2py
> virtualhosts.
>
> With one web2py instance, my server stands at around 90MB average for
> memory, it *might* spike up to 115MB if I start some ram caching, however my
> reports have never reported anything higher. I am running apache with
> mod_wsgi. Also I havn't seen anything faster :) I would say it's a toss up
> between "Just Working" and "A couple more microseconds".

The important thing is to use daemon mode of mod_wsgi on memory
constrained systems and not embedded mode. Although Apache is slower
at serving static files than nginx or Cherokee, if configured
correctly you wouldn't expect to see much difference for your actual
web2py application requests. This is because the underlying web server
isn't going to be the bottleneck. Instead the performance bottleneck
is going to be your web2py code and the database access.

FWIW, a good middle ground is to use nginx as front end to Apache/
mod_wsgi (daemon mode). The nginx server will serve static files and
proxy everything else to Apache. This gives benefit of fast static
file serving from nginx and nginx will also isolate Apache from slow
HTTP clients due to how nginx buffers request/responses. This means
that Apache is only bothered for absolute minimum time required to
handle request and thus can do more with less Apache processes/threads
and thus less memory.

Graham

> On Mon, Nov 9, 2009 at 5:45 AM, David  wrote:
>
> > I recently setup a VPS host over at Santrex.net for testing web2py.
> > It took me about two shifts to get Cherokee installed and running with
> > Web2Py.  What a pain.  For those others that seemed to miss
> > "libcherokee-mod-libssl" that was a painful  lesson that could have
> > been remarked elsewhere and saved a lot of time.
>
> > One of the things I noticed was that while working on the server that
> > sometimes I could get the HTML source output starting with a "0"
> > followed by the headers and then the page content.  Ultimately this
> > would cause an error and the page would fail to load.   I noticed this
> > happened about every 10th request or sooner depending on the speed at
> > which I was moving through the site.
>
> > Fed up with this problem, I decided to install Apache server and
> > configure a VirtualHost.  This installation took about 20 minutes
> > including apt-get, ssl gen, and virtualhost setup etc.  It also works
> > flawlessly even though it is a touch slower for what I am working on
> > right now.
>
> > Do any other people here use Cherokee?  Is it worth my time to chase
> > down this page display problem?  The only drawbacks for Apache with me
> > are the default memory configuration issues (it's a pig out of the box
> > on a vps and limited if your memory is limited) and that it happens to
> > be the slowest, as far as I can see, based on performance reports.
> > That being said it's still rock solid when it comes to working with
> > Web2Py.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34992] Re: Join web2py wave

2009-11-09 Thread David Mitchell
Could you please invite me too?

Thanks

Dave M.

2009/11/10 mdipierro 

>
> This is really nice. Hope you do not mind, I posted a link on reddit/
> programming.
>
> On Nov 9, 2:41 pm, hcvst  wrote:
> > Hi Vidul,
> >
> > the wave's now athttp://
> wavedirectory.appspot.com/init/default/wave/676f6f676c65776176...
> >
> > But I guess I should add the old query string method again too.
> >
> > Regards,
> > HC
> >
> > On Nov 9, 7:58 pm, Vidul Petrov  wrote:
> >
> > > I got "Internal Error" while tryinghttp://
> wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
> >
> > > On Nov 4, 8:54 am, hcvst  wrote:
> >
> > > >
> http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2...
> >
> > > > A public wave to discuss wave development on web2py.
> >
> > > > HC
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34993] Re: Join web2py wave

2009-11-09 Thread Napas

Hey could i get invitation to na...@napas.lt ?

On Nov 5, 6:11 am, Richard  wrote:
> sure. And if anyone else is interested post in this thread.
>
> On Nov 5, 2:19 pm, Thadeus Burgess  wrote:
>
> > Richard, could you keep me in mind when the invites start back up?
>
> > -Thadeus
>
> > On Wed, Nov 4, 2009 at 9:05 PM, Vincent  wrote:
>
> > > I am interested.
> > > Vincent
>
> > > On Nov 4, 6:15 pm, Richard  wrote:
> > > > I would invite you but it seems Google has temporarily disabled
> > > > inviting:
> > >http://www.google.com/support/wave/bin/answer.py?hl=en&answer=162237
>
> > > > On Nov 5, 4:38 am, Thadeus Burgess  wrote:
>
> > > > > I would love to as well if I had an invitation.
>
> > > > > -Thadeus
>
> > > > > On Wed, Nov 4, 2009 at 9:58 AM, hcvst  wrote:
>
> > > > > > Hi Snoogie,
>
> > > > > > I had an invite left. Just added you. Might take a couple of days 
> > > > > > for
> > > > > > Google to
> > > > > > send out the invitation.
>
> > > > > > HC
>
> > > > > > On Nov 4, 4:20 pm, Sebastian Brandt  wrote:
> > > > > > > Hi,
> > > > > > > I would like to join but I didn't receive an invitation fpr wave
> > > > > > > yet :-)
>
> > > > > > > Greets
> > > > > > > Snoogie
>
> > > > > > > On 4 Nov., 07:54, hcvst  wrote:
>
> > >http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2.
> > > > > > ..
>
> > > > > > > > A public wave to discuss wave development on web2py.
>
> > > > > > > > HC

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34994] 2 year moratorium on python syntax changes

2009-11-09 Thread mikech

http://python.org/dev/peps/pep-3003/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34995] Re: Join web2py wave

2009-11-09 Thread mikech

Invite please?

On Nov 7, 4:00 pm, Thadeus Burgess  wrote:
> I think we should all start a public web2py wave! :)
>
> -Thadeus
>
>
>
> On Sat, Nov 7, 2009 at 3:54 PM, mdipierro  wrote:
>
> > I have account. I just have not figured out what I am supposed to do
> > with it.
>
> > On Nov 7, 3:08 pm, Nicolás de la Torre  wrote:
> > > Invited:
>
> > > debe...@yahoo.com
> > > kuo...@gmail.com
> > > murxun...@googlemail.com
> > > jorgeh...@gmail.com
>
> > > I have 5 invites left. Just ask.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34996] installing web2py on Ubuntu

2009-11-09 Thread Massimo Di Pierro
If you have sudo access to a fresh ubuntu install just run this script

sudo setup-web2py.sh

and it will:
1) install a bunch of packages you need including ssh, emacs, apache2,  
python2.5, postgresql
2) download and start web2py on port 8123 as user www-data
3) configure apache to prosy web2py and restarts apache
4) go to

http://hostname/welcome




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



setup-web2py.sh
Description: Binary data


[web2py:34997] Re: T2 and Empty Flash Messages

2009-11-09 Thread jensk_dk



On 9 Nov., 15:26, mdipierro  wrote:
> > Can you shed some light on the upcoming "replacement"? Has web2py
> > developed so much since T2 was written that it actually implements
> > some of the higH level patterns that T2 implements?
>
> Almost everything in T2 but the wiki and widgets is not in gluon/
> tools.py and implementedmuch better in web2py core.

I'm not sure I understand.
Regardless, I replaced e.g. T2.create in my test app with Crud from
gluon.tools, which I assume is the way to go?

I agree that Crud functionally replaces some things in T2. But for
features like STAMP, which I replaced with with default values in the
db fields, I still thinks T2 is more elegant in that the implicit
created_by/on etc. fields are automatically maintained in the forms.
Am I overlooking some basic web2py functionality that implements
STAMP?

Would it make sense to make a list of what T2 features (patterns)
translates into (newly implemented) web2py features/tools?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34998] Re: 1.72.1 is OUT

2009-11-09 Thread drayco

I use MySQL and auth. When i try to login, Web2py 1.72.1 give me this
error. But With Web2py 1.71.1 this dosen't happend.

Traceback (most recent call last):
  File "/media/RESPALDO/web2py/gluon/restricted.py", line 184, in
restricted
exec ccode in environment
  File "/media/RESPALDO/web2py/applications/seccion36/controllers/
default.py", line 1168, in 
  File "/media/RESPALDO/web2py/gluon/globals.py", line 103, in

self._caller = lambda f: f()
  File "/media/RESPALDO/web2py/applications/seccion36/controllers/
default.py", line 33, in user
return dict(form=auth())
  File "/media/RESPALDO/web2py/gluon/tools.py", line 682, in __call__
return self.login()
  File "/media/RESPALDO/web2py/gluon/tools.py", line 1037, in login
self.log_event(log % self.user)
KeyError: 'id'



On 9 nov, 14:12, mdipierro  wrote:
> New stuff:
> - bug fix in select(...,cache=)
> - bug fix in internationalization with default languages
> - better polish and french translations
> - better support for KeyedTables (thanks Denes) and alternate names
> for 'id' fields (thanks Michael). This allow better support for legacy
> databases.
>
> Please give it a try and report any problem.
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34999] Re: Join web2py wave

2009-11-09 Thread Richard

invited:
encomp...@gmail.com
ka...@gmx.net
monch1...@gmail.com
na...@napas.lt
mp.ch...@gmail.com

(4 invites left)


On Nov 10, 9:40 am, mikech  wrote:
> Invite please?
>
> On Nov 7, 4:00 pm, Thadeus Burgess  wrote:
>
> > I think we should all start a public web2py wave! :)
>
> > -Thadeus
>
> > On Sat, Nov 7, 2009 at 3:54 PM, mdipierro  wrote:
>
> > > I have account. I just have not figured out what I am supposed to do
> > > with it.
>
> > > On Nov 7, 3:08 pm, Nicolás de la Torre  wrote:
> > > > Invited:
>
> > > > debe...@yahoo.com
> > > > kuo...@gmail.com
> > > > murxun...@googlemail.com
> > > > jorgeh...@gmail.com
>
> > > > I have 5 invites left. Just ask.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:/] Re: 2 year moratorium on python syntax changes

2009-11-09 Thread mdipierro

http://www.reddit.com/r/programming/comments/a2k4b/pep_3003_python_language_moratorium_is_accepted/c0fk610

My two cents

On Nov 9, 4:38 pm, mikech  wrote:
> http://python.org/dev/peps/pep-3003/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35001] Re: 1.72.1 is OUT -> 1.72.2 is OUT

2009-11-09 Thread mdipierro

please check 1.72.2

On Nov 9, 5:06 pm, drayco  wrote:
> I use MySQL and auth. When i try to login, Web2py 1.72.1 give me this
> error. But With Web2py 1.71.1 this dosen't happend.
>
> Traceback (most recent call last):
>   File "/media/RESPALDO/web2py/gluon/restricted.py", line 184, in
> restricted
>     exec ccode in environment
>   File "/media/RESPALDO/web2py/applications/seccion36/controllers/
> default.py", line 1168, in 
>   File "/media/RESPALDO/web2py/gluon/globals.py", line 103, in
> 
>     self._caller = lambda f: f()
>   File "/media/RESPALDO/web2py/applications/seccion36/controllers/
> default.py", line 33, in user
>     return dict(form=auth())
>   File "/media/RESPALDO/web2py/gluon/tools.py", line 682, in __call__
>     return self.login()
>   File "/media/RESPALDO/web2py/gluon/tools.py", line 1037, in login
>     self.log_event(log % self.user)
> KeyError: 'id'
>
> On 9 nov, 14:12, mdipierro  wrote:
>
> > New stuff:
> > - bug fix in select(...,cache=)
> > - bug fix in internationalization with default languages
> > - better polish and french translations
> > - better support for KeyedTables (thanks Denes) and alternate names
> > for 'id' fields (thanks Michael). This allow better support for legacy
> > databases.
>
> > Please give it a try and report any problem.
>
> > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35002] Re: Join web2py wave

2009-11-09 Thread

Can you send me an invitation please, Richard?

Thanks

2009/11/10 Richard :
>
> invited:
> encomp...@gmail.com
> ka...@gmx.net
> monch1...@gmail.com
> na...@napas.lt
> mp.ch...@gmail.com
>
> (4 invites left)
>

-- 
Luyun Xie
谢路云
http://magefromhell.blogspot.com/
(http://blog.hellmage.info/)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35003] get html content

2009-11-09 Thread MrGoni

Hi guys,

Do any of you know a way to get data from a web table using its url?
Thanks in advance and best regards,

MrGoni

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35004] Re: get html content

2009-11-09 Thread mr.freeze

Something like this?

Controller
--
def call():
session.forget()
return service()

@service.xml
def tableservice():
limitby = (int(request.vars.start),int(request.vars.count))
table = SQLTABLE(db().select(db
[request.vars.table].ALL,limitby=limitby))
return table

URL
---
http://127.0.0.1:8000/app/controller/call/xml/tableservice?start=0&count=10&table=things

This would of course need to be locked down and is just an example.

On Nov 9, 8:06 pm, MrGoni  wrote:
> Hi guys,
>
> Do any of you know a way to get data from a web table using its url?
> Thanks in advance and best regards,
>
> MrGoni
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35005] Re: get html content

2009-11-09 Thread mr.freeze

Whoops, limitby should be:
limitby = (int(request.vars.start),int(request.vars.start)+int
(request.vars.count))

On Nov 9, 9:14 pm, "mr.freeze"  wrote:
> Something like this?
>
> Controller
> --
> def call():
>     session.forget()
>     return service()
>
> @service.xml
> def tableservice():
>     limitby = (int(request.vars.start),int(request.vars.count))
>     table = SQLTABLE(db().select(db
> [request.vars.table].ALL,limitby=limitby))
>     return table
>
> URL
> ---http://127.0.0.1:8000/app/controller/call/xml/tableservice?start=0&co...
>
> This would of course need to be locked down and is just an example.
>
> On Nov 9, 8:06 pm, MrGoni  wrote:
>
> > Hi guys,
>
> > Do any of you know a way to get data from a web table using its url?
> > Thanks in advance and best regards,
>
> > MrGoni
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35006] cron job debug

2009-11-09 Thread

Hi

I've a controller function as a cron job, which fetches some data from
a remote server and updates local db. It runs correctly when accessed
directly from browser. But as a cron job, web2py just keep saying:

WARNING:root:WEB2PY CRON Call returned code 1: No error message available

and no update was performed. What is wrong here? How can I debug it?

Thanks

-- 
Luyun Xie
谢路云
http://magefromhell.blogspot.com/
(http://blog.hellmage.info/)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35007] Re: get html content

2009-11-09 Thread mdipierro

This:

@service.xml
def tableservice():
limitby = (int(request.vars.start),int(request.vars.count))
table = SQLTABLE(db().select(db
[request.vars.table].ALL,limitby=limitby))
return table

should be

@service.xml
def tableservice(start,count):
limitby = (int(start),int(start)+int(count))
return db().select(db
[request.vars.table].ALL,limitby=limitby).as_list()

service functions are supposed to take arguments and they are parsed
automatically from request.vars. Morover they should not return HTML
helpers but primitive serializable structures.

On Nov 9, 9:14 pm, "mr.freeze"  wrote:
> Something like this?
>
> Controller
> --
> def call():
>     session.forget()
>     return service()
>
> @service.xml
> def tableservice():
>     limitby = (int(request.vars.start),int(request.vars.count))
>     table = SQLTABLE(db().select(db
> [request.vars.table].ALL,limitby=limitby))
>     return table
>
> URL
> ---http://127.0.0.1:8000/app/controller/call/xml/tableservice?start=0&co...
>
> This would of course need to be locked down and is just an example.
>
> On Nov 9, 8:06 pm, MrGoni  wrote:
>
> > Hi guys,
>
> > Do any of you know a way to get data from a web table using its url?
> > Thanks in advance and best regards,
>
> > MrGoni
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35008] Re: cron job debug

2009-11-09 Thread mdipierro

I am sorry cron errors need to be improved. You can add some

try:
except Exception,e: print e

in the cron task.


On Nov 9, 9:21 pm, "Xie&Tian"  wrote:
> Hi
>
> I've a controller function as a cron job, which fetches some data from
> a remote server and updates local db. It runs correctly when accessed
> directly from browser. But as a cron job, web2py just keep saying:
>
>     WARNING:root:WEB2PY CRON Call returned code 1: No error message available
>
> and no update was performed. What is wrong here? How can I debug it?
>
> Thanks
>
> --
> Luyun Xie
> 谢路云http://magefromhell.blogspot.com/
> (http://blog.hellmage.info/)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35009] Re: Other new DAL features in trunk

2009-11-09 Thread Iceberg

Off topic.

Recently web2py evolutes with many great enhancement. That is, without
doubt, a good thing. Yet it will be better if the new features are
documented, even roughly mentioned, in some well-known place. So that
people who missed a post in google mail list (and google-maillist-
search sucks) still have a chance to catch up later.

For example, the two features in this post should better be mentioned
in http://www.web2py.com/examples/default/dal


On Nov9, 11:54pm, mdipierro  wrote:
> Thanks to Michael Fig we have two new important features in trunk
>
> 1) to deal with legacy databases
>
>       db.define_table('mytable',Field('myfield','id'),Field
> ('otherfield'))
>
> allows to redefine the name of the 'id' field.
>
> 2) If you mess up .table files you ca try:
>
>      delete all .table files
>      db.define_table(,make_migrate=True)
>
> The latter will rebuild missing .table files. Only works if table
> defintions and db tables are consistent.
>
> Let me know if test any of this.
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35010] Re: Other new DAL features in trunk

2009-11-09 Thread mdipierro

I will update the documentation as soon as possible. If you can send
me a patch it will happen sooner.

On Nov 9, 11:07 pm, Iceberg  wrote:
> Off topic.
>
> Recently web2py evolutes with many great enhancement. That is, without
> doubt, a good thing. Yet it will be better if the new features are
> documented, even roughly mentioned, in some well-known place. So that
> people who missed a post in google mail list (and google-maillist-
> search sucks) still have a chance to catch up later.
>
> For example, the two features in this post should better be mentioned
> inhttp://www.web2py.com/examples/default/dal
>
> On Nov9, 11:54pm, mdipierro  wrote:
>
> > Thanks to Michael Fig we have two new important features in trunk
>
> > 1) to deal with legacy databases
>
> >       db.define_table('mytable',Field('myfield','id'),Field
> > ('otherfield'))
>
> > allows to redefine the name of the 'id' field.
>
> > 2) If you mess up .table files you ca try:
>
> >      delete all .table files
> >      db.define_table(,make_migrate=True)
>
> > The latter will rebuild missing .table files. Only works if table
> > defintions and db tables are consistent.
>
> > Let me know if test any of this.
>
> > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35011] Re: web2py and keyed tables

2009-11-09 Thread Richard

I don't need this right now, but it's great to have this flexibility
in the future.
Thanks


On Nov 10, 3:57 am, DenesL  wrote:
> @ mr.freeze: you are welcome
> @ Massimo: thanks for merging it into web2py
> @ Timbo: LOL, maybe someday.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---