[web2py] Re: new dal

2010-12-04 Thread ron_m
I was away until 10pm, just did an hg update and recopied trunk to a
new work area plus copied dal.py to sql.py in gluon.

The welcome app gets this traceback on the index page after auto start
browser from TK interface.

web2py™ Version 1.89.5 (2010-11-21 16:03:13)
Python  Python 2.6.5: /usr/bin/python

Traceback (most recent call last):
  File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
wsgibase
BaseAdapter.close_all_instances(BaseAdapter.commit)
  File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 169, in
close_all_instances
instance._connection.close()
AttributeError: 'SQLiteAdapter' object has no attribute '_connection'

My own application gets

Traceback (most recent call last):
  File "/home/camcentral/Dev/web2py_hg/gluon/restricted.py", line 188,
in restricted
exec ccode in environment
  File "/home/camcentral/Dev/web2py_hg/applications/ccims/models/
A_db.py", line 19, in 
db = DAL('postgres://ccims:oss3...@localhost/cc_ims') # CamCentral
IMS configuration database
  File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 2402, in
__init__
raise RuntimeError, "Failure to connect, tried 5 times"
RuntimeError: Failure to connect, tried 5 times

Did I do something wrong in the test install copying dal.py over top
of sql.py to install the new dal?

The hg update was compared using meld to the work area from this
morning and I see quite a few changes to dal.py. Just re-ran meld
after I recopied the new trunk to the work area and I don't see the
differences so I am very sure I got the latest as of tonight.


On Dec 4, 9:02 pm, mdipierro  wrote:
> One more test please. I do not have mysql installed here so I did not
> test pooling. This helps a lot. thanks.
>
> On Dec 4, 10:33 pm, "mr.freeze"  wrote:
>
> > Looking closer, there is a syntax error on line 189: COnnectionPool
> > After I fixed that, I get:
> > Traceback (most recent call last):
> >   File "C:\web2py\gluon\main.py", line 488, in wsgibase
> >     BaseAdapter.close_all_instances(BaseAdapter.rollback)
> >   File "C:\web2py\gluon\sql.py", line 163, in close_all_instances
> >     pool = ConnectionPool._pools[instance._uri]
> > AttributeError: 'SQLiteAdapter' object has no attribute '_uri'
>
> > On Dec 4, 10:26 pm, "mr.freeze"  wrote:
>
> > > I get this now:
> > > Traceback (most recent call last):
> > >   File "C:\web2py\gluon\restricted.py", line 188, in restricted
> > >     exec ccode in environment
> > >   File "C:/web2py/applications/main/models/db.py", line 22, in
> > > 
> > >     db = SQLDB(dal_connection,pool_size=10)
> > >   File "C:\web2py\gluon\sql.py", line 2405, in __init__
> > >     raise RuntimeError, "Failure to connect, tried 5 times"
> > > RuntimeError: Failure to connect, tried 5 times
>
> > > On Dec 4, 9:57 pm, mdipierro  wrote:
>
> > > > Can you try delete everything in app/cache/
>
> > > > The error seems in opening the cache file.
>
> > > > On Dec 4, 8:30 pm, "mr.freeze"  wrote:
>
> > > > > I was getting that error. After updating it goes away but now I get
> > > > > the below. I am running it against web2pyslices.com source on a sqlite
> > > > > db with Python 2.5:
>
> > > > > Traceback (most recent call last):
> > > > >   File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
> > > > > 188, in restricted
> > > > >     exec ccode in environment
> > > > >   File "C:/Users/nathan/workspace/web2py/applications/main/models/
> > > > > menu.py", line 115, in 
> > > > >     response.tagcloud =
> > > > > db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
> > > > > 600))
> > > > >   File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
> > > > > select
> > > > >     shutil.copyfileobj(file, dest_file)
> > > > >   File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
> > > > > __call__
> > > > >     storage = shelve.open(self.shelve_name)
> > > > >   File "C:\Python25\lib\shelve.py", line 225, in open
> > > > >     return DbfilenameShelf(filename, flag, protocol, writeback)
> > > > >   File "C:\Python25\lib\shelve.py", line 209, in __init__
> > > > >     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> > > > > writeback)
> > > > >   File "C:\Python25\lib\anydbm.py", line 83, in open
> > > > >     return mod.open(file, flag, mode)
> > > > >   File "C:\Python25\lib\dbhash.py", line 16, in open
> > > > >     return bsddb.hashopen(file, flag, mode)
> > > > >   File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
> > > > >     d.open(file, db.DB_HASH, flags, mode)
> > > > > DBPermissionsError: (1, 'Operation not permitted')
>
> > > > > On Dec 4, 4:00 pm, mdipierro  wrote:
>
> > > > > > can you please try again?
>
> > > > > > Massimo
>
> > > > > > On Dec 4, 12:31 pm, ron_m  wrote:
>
> > > > > > > Describe what I did
>
> > > > > > > Copied the trunk hg area to a work area
> > > > > > > Renamed sql.py to sql-save.py
> > > > > > > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > > >

Re: [web2py] Re: Scalability of web2py?

2010-12-04 Thread Phyo Arkar
If this become a langauge war:

Erlang have many scability advantages , yes , but Langauge Looks
horrible!! almost as readable as C (in my opinion)

I will only choose python .It will  not be  Super Scalable as erlang
but still scalable as proven by google.

sorry for my bad english.

On 12/5/10, Phyo Arkar  wrote:
> This discussion becomes not about comparison of scalability of  web2py
> or scability of web2py vs other framework but web2py vs other
> langauges??
>
>>massimo wrote:
>>ab -n 1 -c 100 http://127.0.0.1:8081/
>>
>>rocket: 0.629 [ms]
>>eventlet:
>
>
> Massimo , does eventlet failed in that test?
>
> On 12/5/10, mdipierro  wrote:
>> This is supposed to be even better
>>
>> # http://code.google.com/p/gevent/source/browse/examples/wsgiserver.py
>> from gevent import wsgi
>>
>>
>> but cannot install on snow leopard.
>>
>> Massimo
>>
>> On Dec 4, 9:19 pm, mdipierro  wrote:
>>> I tried this:
>>>
>>> #http://eventlet.net/doc/examples.html#wsgi-server
>>> import eventlet
>>> from eventlet import wsgi
>>> from rocket import Rocket
>>>
>>> def hello_world(env, start_response):
>>>     if env['PATH_INFO'] != '/':
>>>         start_response('404 Not Found', [('Content-Type', 'text/
>>> plain')])
>>>         return ['Not Found\r\n']
>>>     start_response('200 OK', [('Content-Type', 'text/plain')])
>>>     return ['Hello, World!\r\n']
>>>
>>> if __name__=='__main__':
>>>     if True:
>>>        r=Rocket(('127.0.0.1',8081),'wsgi', {'wsgi_app':hello_world})
>>>        r.start()
>>>     else:
>>>        wsgi.server(eventlet.listen(('127.0.0.1', 8081)), hello_world)
>>>
>>> with
>>>
>>> ab -n 1 -c 10http://127.0.0.1:8081/
>>>
>>> rocket: 0.618 [ms]
>>> eventlet: 0.443 [ms]
>>>
>>> ab -n 1 -c 100http://127.0.0.1:8081/
>>>
>>> rocket: 0.629 [ms]
>>> eventlet:
>>>
>>> Benchmarking 127.0.0.1 (be patient)
>>> Completed 1000 requests
>>> Test aborted after 10 failures
>>> apr_socket_connect(): Connection reset by peer (54)
>>> Total of 1998 requests completed
>>>
>>> On Dec 4, 7:39 pm, Branko Vukelic  wrote:
>>>
>>> > On Sun, Dec 5, 2010 at 1:59 AM, blackthorne 
>>> > wrote:
>>> > > I've read it while ago.
>>> > > The "problem" with that test is the number of processors. It takes a
>>> > > high number of CPUs to bring Erlang benefits.
>>>
>>> > Another 'problem' is that it's not about performance when it comes to
>>> > Erlang. It's about overall robustness. For example, Yaws HTTP server
>>> > may not be the fastest around, but you just cannot kill it. Even if it
>>> > drops a request, it will keep on running, and handling whatever
>>> > requests you throw at it. I guess I had that in mind when I said
>>> > scalability.
>>>
>>> > Also, Erlang has software threads, afaik, not hardware CPU threads,
>>> > and it manages those internally using a supervisor-worker
>>> > architecture. That's something built into the language, and you mostly
>>> > don't have to worry about it.
>>>
>>> > --
>>> > Branko Vukelić
>>>
>>> > bg.bra...@gmail.com
>>> > stu...@brankovukelic.com
>>>
>>> > Check out my blog:http://www.brankovukelic.com/
>>> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>>> > Registered Linux user #438078 (http://counter.li.org/)
>>> > I hang out on identi.ca:http://identi.ca/foxbunny
>>>
>>> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>>>
>>>
>


Re: [web2py] Re: Scalability of web2py?

2010-12-04 Thread Phyo Arkar
This discussion becomes not about comparison of scalability of  web2py
or scability of web2py vs other framework but web2py vs other
langauges??

>massimo wrote:
>ab -n 1 -c 100 http://127.0.0.1:8081/
>
>rocket: 0.629 [ms]
>eventlet:


Massimo , does eventlet failed in that test?

On 12/5/10, mdipierro  wrote:
> This is supposed to be even better
>
> # http://code.google.com/p/gevent/source/browse/examples/wsgiserver.py
> from gevent import wsgi
>
>
> but cannot install on snow leopard.
>
> Massimo
>
> On Dec 4, 9:19 pm, mdipierro  wrote:
>> I tried this:
>>
>> #http://eventlet.net/doc/examples.html#wsgi-server
>> import eventlet
>> from eventlet import wsgi
>> from rocket import Rocket
>>
>> def hello_world(env, start_response):
>>     if env['PATH_INFO'] != '/':
>>         start_response('404 Not Found', [('Content-Type', 'text/
>> plain')])
>>         return ['Not Found\r\n']
>>     start_response('200 OK', [('Content-Type', 'text/plain')])
>>     return ['Hello, World!\r\n']
>>
>> if __name__=='__main__':
>>     if True:
>>        r=Rocket(('127.0.0.1',8081),'wsgi', {'wsgi_app':hello_world})
>>        r.start()
>>     else:
>>        wsgi.server(eventlet.listen(('127.0.0.1', 8081)), hello_world)
>>
>> with
>>
>> ab -n 1 -c 10http://127.0.0.1:8081/
>>
>> rocket: 0.618 [ms]
>> eventlet: 0.443 [ms]
>>
>> ab -n 1 -c 100http://127.0.0.1:8081/
>>
>> rocket: 0.629 [ms]
>> eventlet:
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1000 requests
>> Test aborted after 10 failures
>> apr_socket_connect(): Connection reset by peer (54)
>> Total of 1998 requests completed
>>
>> On Dec 4, 7:39 pm, Branko Vukelic  wrote:
>>
>> > On Sun, Dec 5, 2010 at 1:59 AM, blackthorne 
>> > wrote:
>> > > I've read it while ago.
>> > > The "problem" with that test is the number of processors. It takes a
>> > > high number of CPUs to bring Erlang benefits.
>>
>> > Another 'problem' is that it's not about performance when it comes to
>> > Erlang. It's about overall robustness. For example, Yaws HTTP server
>> > may not be the fastest around, but you just cannot kill it. Even if it
>> > drops a request, it will keep on running, and handling whatever
>> > requests you throw at it. I guess I had that in mind when I said
>> > scalability.
>>
>> > Also, Erlang has software threads, afaik, not hardware CPU threads,
>> > and it manages those internally using a supervisor-worker
>> > architecture. That's something built into the language, and you mostly
>> > don't have to worry about it.
>>
>> > --
>> > Branko Vukelić
>>
>> > bg.bra...@gmail.com
>> > stu...@brankovukelic.com
>>
>> > Check out my blog:http://www.brankovukelic.com/
>> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>> > Registered Linux user #438078 (http://counter.li.org/)
>> > I hang out on identi.ca:http://identi.ca/foxbunny
>>
>> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>>
>>


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Phyo Arkar
yes , all your points are good.

But jq+jqueryui allows to build something really cool stuff like
jqgrid which is superb.I had check and qooxdoo's table is not even
half of jqgrid capabilities.

I just wish it would be really nice if qooxdoo will support jq's
themeroller.. and it will be more than perfect!

I am testing qooxdoo and going to put jqGrid and autocomplete plugins
in it to see how it fits :) I like both of them.

On 12/5/10, Branko Vukelic  wrote:
> It's a framework. It's got its own packaging system, build system, you
> name it. Very powerful stuff. Plus you get an endless collection of
> 'stuff' to build your apps with. Amazing.
>
> On Sun, Dec 5, 2010 at 5:35 AM, Phyo Arkar  wrote:
>> I just check qooxdoo , it seems very powerful.. What jslib it based
>> on? jq? mootoo? or nothing at all?
>>
>> On 12/5/10, Phyo Arkar  wrote:
>>> Why nobody uses JQUI ?
>>> http://jqueryui.com
>>>
>>> yes extJS and other UI frameworks have already build UIs , but if you
>>> want to build something from scratch jqui provide you all the stuff
>>> you need. It have very powerful CSS Framework.
>>> I found it very easy/productive to use, and themeroller rocks!
>>>
>>> On 12/5/10, Branko Vukelic  wrote:
 OMG! I'm definitely using this for admin2! I've just started the Hello
 World tutorial. I can't believe the attention it's been given... /me
 drops jaw

 On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic 
 wrote:
> Awesome feature set.
>
> On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
>> instead of extjs i can happily recommend you using qooxdoo.
>>
>> see: http://qooxdoo.org
>>
>> On Dec 3, 11:10 pm, Branko Vukelic  wrote:
>>> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
>>> > I would be careful on the licensing of Ext JS, wasn't this the one
>>> > that caused some concerns a couple of years ago when they switched
>>> > as
>>> > they became popular with the GWT users?
>>>
>>> They require you to release your _application_ code if you want to
>>> use
>>> Ext.JS with open-source license. It's kind of like GPL on steroids.
>>> :)
>>>
>>> Btw, I've been using Mootools for a while. Very pythonic. I
>>> absolutely
>>> love it.
>>>
>>> --
>>> Branko Vukelić
>>>
>>> bg.bra...@gmail.com
>>> stu...@brankovukelic.com
>>>
>>> Check out my blog:http://www.brankovukelic.com/
>>> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>>> Registered Linux user #438078 (http://counter.li.org/)
>>> I hang out on identi.ca:http://identi.ca/foxbunny
>>>
>>> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>
>
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog: http://www.brankovukelic.com/
> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca: http://identi.ca/foxbunny
>
> Gimp Brushmakers Guild
> http://bit.ly/gbg-group
>



 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog: http://www.brankovukelic.com/
 Check out my portfolio: http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca: http://identi.ca/foxbunny

 Gimp Brushmakers Guild
 http://bit.ly/gbg-group

>>>
>>
>
>
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog: http://www.brankovukelic.com/
> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca: http://identi.ca/foxbunny
>
> Gimp Brushmakers Guild
> http://bit.ly/gbg-group
>


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread RyaneD
Thanks. These are the only error logs I have.

Last 300 Error Log messages in reverse order (newest at the top,
oldest at the bottom):
[Sun Dec 05 00:57:18 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:57:18 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:57:18 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:57:07 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:57:07 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:57:07 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:54:02 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:54:02 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:54:02 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:53:50 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:53:50 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:53:50 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:53:45 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:53:45 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:53:45 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:53:41 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:53:41 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:53:37 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:53:37 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:53:37 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:50:59 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:50:59 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:50:59 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/500.shtml
[Sun Dec 05 00:49:35 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml
[Sun Dec 05 00:49:35 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/favicon.ico
[Sun Dec 05 00:49:35 2010] [error] [client 96.38.69.221] File does not
exist: /home/scadzomb/public_html/404.shtml

Somehow I don't feel like thats the same problem I am seeing.

Alright so to break down my file structure:

Inside of
/home/scadzomb/public_html/
I have,
./web2py/

In the web2py directory I have all the contents of the unzipped and
ran once web2py_src.zip

I have added .htaccess with
-
RewriteEngine On
RewriteBase /
RewriteRule ^web2py\.fcgi/ - [L]
RewriteRule ^(.*)$ web2py.fcgi/$1 [L]
-

I have added routes.py which you can look at here:
http://scadzombies.org/documents/routes.py
This is a direct copy of the file so you can look at it.

And I have web2py.fcgi

-
#!/home/scadzomb/local/bin/python
import sys
from flup.server.fcgi_fork import WSGIServer
import gluon.main
application=gluon.main.wsgibase
## or
# application=gluon.main.wsgibase_with_logging
WSGIServer(application).run()



On Dec 5, 12:52 am, Branko Vukelic  wrote:
> Check the server logs. That usually means there's a bug in your scripts.
>
>
>
>
>
>
>
>
>
> On Sun, Dec 5, 2010 at 3:40 AM, RyaneD  wrote:
> > I fixed the second problem but the first remains. I had messed up in
> > my implementation of routes.py completely user error, forgot a
> > parenthesis. :P As the traceback says.
>
> > So that error is gone, but when I navigate towww.scadzombies.org/web2py
> > I get the same 500 Internal Server Error
>
> > On Dec 4, 9:23 pm, RyaneD  wrote:
> >> I followed the instructions 
> >> onhttp://web2pyslices.com/main/slices/take_slice/68,
> >> which were starting to make sense but I am confounded with this error
> >> when i visithttp://www.scadzombies.com/web2py:
>
> >> --
>
> >> Internal Server Error
>
> >> The server encountered an internal error or misconfiguration and was
> >> unable to complete your request.
>
> >> Please contact the server admini

[web2py] Display XML as HTML web2py

2010-12-04 Thread Andrew Evans
I am trying to display some XML that has been screen scraped I want to
display it as HTML in my code but for some reason its not working. It
appears in the HTML source code but not being displayed any ideas

Controller
-

def guildRoster():
url = 'http://www.wowarmory.com/guild-info.xml?r=Moon+Guard&gn=Zen'
header = { 'User-Agent' : 'Mozilla/5.0 Gecko/20070219 Firefox/2.0.0.2'}
req = urllib2.Request(url, '', header)
return dict(results=XML(urllib2.urlopen(req).read()))

View
-
{{extend 'site_template.html'}}

Guild Roster
{{=results}}




Cheers ty


Re: [web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Branko Vukelic
Check the server logs. That usually means there's a bug in your scripts.

On Sun, Dec 5, 2010 at 3:40 AM, RyaneD  wrote:
> I fixed the second problem but the first remains. I had messed up in
> my implementation of routes.py completely user error, forgot a
> parenthesis. :P As the traceback says.
>
> So that error is gone, but when I navigate to www.scadzombies.org/web2py
> I get the same 500 Internal Server Error
>
> On Dec 4, 9:23 pm, RyaneD  wrote:
>> I followed the instructions 
>> onhttp://web2pyslices.com/main/slices/take_slice/68,
>> which were starting to make sense but I am confounded with this error
>> when i visithttp://www.scadzombies.com/web2py:
>>
>> --
>>
>> Internal Server Error
>>
>> The server encountered an internal error or misconfiguration and was
>> unable to complete your request.
>>
>> Please contact the server administrator, webmas...@scadzombies.org and
>> inform them of the time the error occurred, and anything you might
>> have done that may have caused the error.
>>
>> More information about this error may be available in the server error
>> log.
>>
>> Additionally, a 500 Internal Server Error error was encountered while
>> trying to use an ErrorDocument to handle the request.
>>
>> Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5
>> mod_fcgid/2.3.5 Phusion_Passenger/2.2.15 mod_auth_passthrough/2.1
>> mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server atwww.scadzombies.org
>> Port 80
>>
>> ---
>>
>> I believe this is reminiscent of the error that I get when I try to
>> run web2py through ssh ever since I changed the routes.py script.
>>
>> ---
>>
>> Traceback (most recent call last):
>>   File "web2py.py", line 20, in 
>>     import gluon.widget
>>   File "/home/scadzomb/public_html/web2py/gluon/widget.py", line 25,
>> in 
>>     import main
>>   File "/home/scadzomb/public_html/web2py/gluon/main.py", line 101, in
>> 
>>     rewrite.load()
>>   File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 119,
>> in load
>>     p[sym].append(compile_re(k, v))
>>   File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 83,
>> in compile_re
>>     return (re.compile(k, re.DOTALL), v)
>>   File "/home/scadzomb/local/lib/python2.6/re.py", line 188, in
>> compile
>>     return _compile(pattern, flags)
>>   File "/home/scadzomb/local/lib/python2.6/re.py", line 243, in
>> _compile
>>     raise error, v # invalid expression
>> sre_constants.error: unbalanced parenthesis
>>
>> ---
>>
>> On Dec 4, 7:21 pm, pbreit  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Unfortunately, Python in general is a bit harder to deploy than HTML
>> > and PHP. Site5 has a few different hosting options so to help out it
>> > would be good to know what sort of plan you are on. If it's Shared
>> > Hosting, I think you will want to try the "fastcgi" option. The web2py
>> > book doesn't really provide information on this however.
>>
>> > If you have:
>> > /home/username/public_html
>> > /home/username/web2py
>>
>> > Add and ".htaccess" file at:
>> > /home/username/public_html/.htaccess:
>>
>> > And put this in it:
>>
>> > AddHandler fastcgi-script .fcgi
>> > RewriteEngine On
>> > RewriteCond %{REQUEST_FILENAME} !-f
>> > RewriteRule ^(.*)$ ./web2py/fcgihandler.py/$1 [QSA,L]
>>
>> > There's going to be one major problem in that you can't access
>> > "admin". This page discusses these issues but for 
>> > Dreamhost:http://wiki.dreamhost.com/Web2py
>>
>> > I have had the best luck running the "web2py.ubuntu.sh" script on
>> > fresh installs of Ubuntu 10.04 at Amazon or Rackspace Cloud.



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Branko Vukelic
It's a framework. It's got its own packaging system, build system, you
name it. Very powerful stuff. Plus you get an endless collection of
'stuff' to build your apps with. Amazing.

On Sun, Dec 5, 2010 at 5:35 AM, Phyo Arkar  wrote:
> I just check qooxdoo , it seems very powerful.. What jslib it based
> on? jq? mootoo? or nothing at all?
>
> On 12/5/10, Phyo Arkar  wrote:
>> Why nobody uses JQUI ?
>> http://jqueryui.com
>>
>> yes extJS and other UI frameworks have already build UIs , but if you
>> want to build something from scratch jqui provide you all the stuff
>> you need. It have very powerful CSS Framework.
>> I found it very easy/productive to use, and themeroller rocks!
>>
>> On 12/5/10, Branko Vukelic  wrote:
>>> OMG! I'm definitely using this for admin2! I've just started the Hello
>>> World tutorial. I can't believe the attention it's been given... /me
>>> drops jaw
>>>
>>> On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic 
>>> wrote:
 Awesome feature set.

 On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
> instead of extjs i can happily recommend you using qooxdoo.
>
> see: http://qooxdoo.org
>
> On Dec 3, 11:10 pm, Branko Vukelic  wrote:
>> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
>> > I would be careful on the licensing of Ext JS, wasn't this the one
>> > that caused some concerns a couple of years ago when they switched
>> > as
>> > they became popular with the GWT users?
>>
>> They require you to release your _application_ code if you want to use
>> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>>
>> Btw, I've been using Mootools for a while. Very pythonic. I absolutely
>> love it.
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog:http://www.brankovukelic.com/
>> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca:http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guildhttp://bit.ly/gbg-group



 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog: http://www.brankovukelic.com/
 Check out my portfolio: http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca: http://identi.ca/foxbunny

 Gimp Brushmakers Guild
 http://bit.ly/gbg-group

>>>
>>>
>>>
>>> --
>>> Branko Vukelić
>>>
>>> bg.bra...@gmail.com
>>> stu...@brankovukelic.com
>>>
>>> Check out my blog: http://www.brankovukelic.com/
>>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>>> Registered Linux user #438078 (http://counter.li.org/)
>>> I hang out on identi.ca: http://identi.ca/foxbunny
>>>
>>> Gimp Brushmakers Guild
>>> http://bit.ly/gbg-group
>>>
>>
>



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Branko Vukelic
The difference between frameworks like Dojo, qooxdoo, extJS on one
hand, and jQUI on the other is that the former are complete GUI
toolkits, whereas jQUI is a mere collection widgets. It's a difference
between plastic surgery and makeup.

Some of the stuff jQUI is missing:

* coross-browser form elements (as in looks the same and works the
same across browsers)
* panels and layout modules
* menu bars and context menus
* tree view
* i18 and l10
* (your favourite feature here)

What is worse is that jQUI is not even trying to get there. And before
someone points out a 3rd party plugin that does all of above, my
experience is that such features are better when they are supported by
the main developers. Supported packages tend to be of higher quality
and bugs get squatted faster. So unless jQUI becomes a GUI toolkit, I
don't think jQuery will be a good choice for rapid development of
fat-clients.

On Sun, Dec 5, 2010 at 5:23 AM, Phyo Arkar  wrote:
> Why nobody uses JQUI ?
> http://jqueryui.com
>
> yes extJS and other UI frameworks have already build UIs , but if you
> want to build something from scratch jqui provide you all the stuff
> you need. It have very powerful CSS Framework.
> I found it very easy/productive to use, and themeroller rocks!
>
> On 12/5/10, Branko Vukelic  wrote:
>> OMG! I'm definitely using this for admin2! I've just started the Hello
>> World tutorial. I can't believe the attention it's been given... /me
>> drops jaw
>>
>> On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic  wrote:
>>> Awesome feature set.
>>>
>>> On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
 instead of extjs i can happily recommend you using qooxdoo.

 see: http://qooxdoo.org

 On Dec 3, 11:10 pm, Branko Vukelic  wrote:
> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
> > I would be careful on the licensing of Ext JS, wasn't this the one
> > that caused some concerns a couple of years ago when they switched as
> > they became popular with the GWT users?
>
> They require you to release your _application_ code if you want to use
> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>
> Btw, I've been using Mootools for a while. Very pythonic. I absolutely
> love it.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>>>
>>>
>>>
>>> --
>>> Branko Vukelić
>>>
>>> bg.bra...@gmail.com
>>> stu...@brankovukelic.com
>>>
>>> Check out my blog: http://www.brankovukelic.com/
>>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>>> Registered Linux user #438078 (http://counter.li.org/)
>>> I hang out on identi.ca: http://identi.ca/foxbunny
>>>
>>> Gimp Brushmakers Guild
>>> http://bit.ly/gbg-group
>>>
>>
>>
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog: http://www.brankovukelic.com/
>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca: http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guild
>> http://bit.ly/gbg-group
>>
>



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: strange problem with form

2010-12-04 Thread mdipierro
sorry. print

request.cookies[response.session_id_name].value

and

response.session_id

they should always be the same unless your session is reset.

On Dec 4, 10:21 pm, VP  wrote:
> When there's no problem (don't know when it will show up), this is
> what is shown:
>
> request.session_id is None
> response.session_id is not
>
> what do you meant by "see if they match of a new session is issued
> when the problem appears."?


[web2py] Re: new dal

2010-12-04 Thread mdipierro
One more test please. I do not have mysql installed here so I did not
test pooling. This helps a lot. thanks.

On Dec 4, 10:33 pm, "mr.freeze"  wrote:
> Looking closer, there is a syntax error on line 189: COnnectionPool
> After I fixed that, I get:
> Traceback (most recent call last):
>   File "C:\web2py\gluon\main.py", line 488, in wsgibase
>     BaseAdapter.close_all_instances(BaseAdapter.rollback)
>   File "C:\web2py\gluon\sql.py", line 163, in close_all_instances
>     pool = ConnectionPool._pools[instance._uri]
> AttributeError: 'SQLiteAdapter' object has no attribute '_uri'
>
> On Dec 4, 10:26 pm, "mr.freeze"  wrote:
>
> > I get this now:
> > Traceback (most recent call last):
> >   File "C:\web2py\gluon\restricted.py", line 188, in restricted
> >     exec ccode in environment
> >   File "C:/web2py/applications/main/models/db.py", line 22, in
> > 
> >     db = SQLDB(dal_connection,pool_size=10)
> >   File "C:\web2py\gluon\sql.py", line 2405, in __init__
> >     raise RuntimeError, "Failure to connect, tried 5 times"
> > RuntimeError: Failure to connect, tried 5 times
>
> > On Dec 4, 9:57 pm, mdipierro  wrote:
>
> > > Can you try delete everything in app/cache/
>
> > > The error seems in opening the cache file.
>
> > > On Dec 4, 8:30 pm, "mr.freeze"  wrote:
>
> > > > I was getting that error. After updating it goes away but now I get
> > > > the below. I am running it against web2pyslices.com source on a sqlite
> > > > db with Python 2.5:
>
> > > > Traceback (most recent call last):
> > > >   File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
> > > > 188, in restricted
> > > >     exec ccode in environment
> > > >   File "C:/Users/nathan/workspace/web2py/applications/main/models/
> > > > menu.py", line 115, in 
> > > >     response.tagcloud =
> > > > db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
> > > > 600))
> > > >   File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
> > > > select
> > > >     shutil.copyfileobj(file, dest_file)
> > > >   File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
> > > > __call__
> > > >     storage = shelve.open(self.shelve_name)
> > > >   File "C:\Python25\lib\shelve.py", line 225, in open
> > > >     return DbfilenameShelf(filename, flag, protocol, writeback)
> > > >   File "C:\Python25\lib\shelve.py", line 209, in __init__
> > > >     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> > > > writeback)
> > > >   File "C:\Python25\lib\anydbm.py", line 83, in open
> > > >     return mod.open(file, flag, mode)
> > > >   File "C:\Python25\lib\dbhash.py", line 16, in open
> > > >     return bsddb.hashopen(file, flag, mode)
> > > >   File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
> > > >     d.open(file, db.DB_HASH, flags, mode)
> > > > DBPermissionsError: (1, 'Operation not permitted')
>
> > > > On Dec 4, 4:00 pm, mdipierro  wrote:
>
> > > > > can you please try again?
>
> > > > > Massimo
>
> > > > > On Dec 4, 12:31 pm, ron_m  wrote:
>
> > > > > > Describe what I did
>
> > > > > > Copied the trunk hg area to a work area
> > > > > > Renamed sql.py to sql-save.py
> > > > > > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > > > > > Copied application I am working on to applications directory
> > > > > > Backed up the database
> > > > > > Ran the server as python web2py.py
>
> > > > > > Got this stack trace
> > > > > > Traceback (most recent call last):
> > > > > >   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> > > > > > wsgibase
> > > > > >     BaseAdapter.close_all_instances(BaseAdapter.commit)
> > > > > >   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> > > > > > close_all_instances
> > > > > >     if instance._pool_size:
> > > > > > AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> > > > > > I don't use SQLite as a database but the driver exists through 
> > > > > > default
> > > > > > install, the db line invoking SQLite is commented out.
>
>


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Phyo Arkar
I just check qooxdoo , it seems very powerful.. What jslib it based
on? jq? mootoo? or nothing at all?

On 12/5/10, Phyo Arkar  wrote:
> Why nobody uses JQUI ?
> http://jqueryui.com
>
> yes extJS and other UI frameworks have already build UIs , but if you
> want to build something from scratch jqui provide you all the stuff
> you need. It have very powerful CSS Framework.
> I found it very easy/productive to use, and themeroller rocks!
>
> On 12/5/10, Branko Vukelic  wrote:
>> OMG! I'm definitely using this for admin2! I've just started the Hello
>> World tutorial. I can't believe the attention it's been given... /me
>> drops jaw
>>
>> On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic 
>> wrote:
>>> Awesome feature set.
>>>
>>> On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
 instead of extjs i can happily recommend you using qooxdoo.

 see: http://qooxdoo.org

 On Dec 3, 11:10 pm, Branko Vukelic  wrote:
> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
> > I would be careful on the licensing of Ext JS, wasn't this the one
> > that caused some concerns a couple of years ago when they switched
> > as
> > they became popular with the GWT users?
>
> They require you to release your _application_ code if you want to use
> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>
> Btw, I've been using Mootools for a while. Very pythonic. I absolutely
> love it.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>>>
>>>
>>>
>>> --
>>> Branko Vukelić
>>>
>>> bg.bra...@gmail.com
>>> stu...@brankovukelic.com
>>>
>>> Check out my blog: http://www.brankovukelic.com/
>>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>>> Registered Linux user #438078 (http://counter.li.org/)
>>> I hang out on identi.ca: http://identi.ca/foxbunny
>>>
>>> Gimp Brushmakers Guild
>>> http://bit.ly/gbg-group
>>>
>>
>>
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog: http://www.brankovukelic.com/
>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca: http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guild
>> http://bit.ly/gbg-group
>>
>


[web2py] Re: new dal

2010-12-04 Thread mr.freeze
Looking closer, there is a syntax error on line 189: COnnectionPool
After I fixed that, I get:
Traceback (most recent call last):
  File "C:\web2py\gluon\main.py", line 488, in wsgibase
BaseAdapter.close_all_instances(BaseAdapter.rollback)
  File "C:\web2py\gluon\sql.py", line 163, in close_all_instances
pool = ConnectionPool._pools[instance._uri]
AttributeError: 'SQLiteAdapter' object has no attribute '_uri'

On Dec 4, 10:26 pm, "mr.freeze"  wrote:
> I get this now:
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "C:/web2py/applications/main/models/db.py", line 22, in
> 
>     db = SQLDB(dal_connection,pool_size=10)
>   File "C:\web2py\gluon\sql.py", line 2405, in __init__
>     raise RuntimeError, "Failure to connect, tried 5 times"
> RuntimeError: Failure to connect, tried 5 times
>
> On Dec 4, 9:57 pm, mdipierro  wrote:
>
> > Can you try delete everything in app/cache/
>
> > The error seems in opening the cache file.
>
> > On Dec 4, 8:30 pm, "mr.freeze"  wrote:
>
> > > I was getting that error. After updating it goes away but now I get
> > > the below. I am running it against web2pyslices.com source on a sqlite
> > > db with Python 2.5:
>
> > > Traceback (most recent call last):
> > >   File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
> > > 188, in restricted
> > >     exec ccode in environment
> > >   File "C:/Users/nathan/workspace/web2py/applications/main/models/
> > > menu.py", line 115, in 
> > >     response.tagcloud =
> > > db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
> > > 600))
> > >   File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
> > > select
> > >     shutil.copyfileobj(file, dest_file)
> > >   File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
> > > __call__
> > >     storage = shelve.open(self.shelve_name)
> > >   File "C:\Python25\lib\shelve.py", line 225, in open
> > >     return DbfilenameShelf(filename, flag, protocol, writeback)
> > >   File "C:\Python25\lib\shelve.py", line 209, in __init__
> > >     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> > > writeback)
> > >   File "C:\Python25\lib\anydbm.py", line 83, in open
> > >     return mod.open(file, flag, mode)
> > >   File "C:\Python25\lib\dbhash.py", line 16, in open
> > >     return bsddb.hashopen(file, flag, mode)
> > >   File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
> > >     d.open(file, db.DB_HASH, flags, mode)
> > > DBPermissionsError: (1, 'Operation not permitted')
>
> > > On Dec 4, 4:00 pm, mdipierro  wrote:
>
> > > > can you please try again?
>
> > > > Massimo
>
> > > > On Dec 4, 12:31 pm, ron_m  wrote:
>
> > > > > Describe what I did
>
> > > > > Copied the trunk hg area to a work area
> > > > > Renamed sql.py to sql-save.py
> > > > > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > > > > Copied application I am working on to applications directory
> > > > > Backed up the database
> > > > > Ran the server as python web2py.py
>
> > > > > Got this stack trace
> > > > > Traceback (most recent call last):
> > > > >   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> > > > > wsgibase
> > > > >     BaseAdapter.close_all_instances(BaseAdapter.commit)
> > > > >   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> > > > > close_all_instances
> > > > >     if instance._pool_size:
> > > > > AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> > > > > I don't use SQLite as a database but the driver exists through default
> > > > > install, the db line invoking SQLite is commented out.
>
>


[web2py] Re: new dal

2010-12-04 Thread mr.freeze
I get this now:
Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 188, in restricted
exec ccode in environment
  File "C:/web2py/applications/main/models/db.py", line 22, in

db = SQLDB(dal_connection,pool_size=10)
  File "C:\web2py\gluon\sql.py", line 2405, in __init__
raise RuntimeError, "Failure to connect, tried 5 times"
RuntimeError: Failure to connect, tried 5 times

On Dec 4, 9:57 pm, mdipierro  wrote:
> Can you try delete everything in app/cache/
>
> The error seems in opening the cache file.
>
> On Dec 4, 8:30 pm, "mr.freeze"  wrote:
>
> > I was getting that error. After updating it goes away but now I get
> > the below. I am running it against web2pyslices.com source on a sqlite
> > db with Python 2.5:
>
> > Traceback (most recent call last):
> >   File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
> > 188, in restricted
> >     exec ccode in environment
> >   File "C:/Users/nathan/workspace/web2py/applications/main/models/
> > menu.py", line 115, in 
> >     response.tagcloud =
> > db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
> > 600))
> >   File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
> > select
> >     shutil.copyfileobj(file, dest_file)
> >   File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
> > __call__
> >     storage = shelve.open(self.shelve_name)
> >   File "C:\Python25\lib\shelve.py", line 225, in open
> >     return DbfilenameShelf(filename, flag, protocol, writeback)
> >   File "C:\Python25\lib\shelve.py", line 209, in __init__
> >     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> > writeback)
> >   File "C:\Python25\lib\anydbm.py", line 83, in open
> >     return mod.open(file, flag, mode)
> >   File "C:\Python25\lib\dbhash.py", line 16, in open
> >     return bsddb.hashopen(file, flag, mode)
> >   File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
> >     d.open(file, db.DB_HASH, flags, mode)
> > DBPermissionsError: (1, 'Operation not permitted')
>
> > On Dec 4, 4:00 pm, mdipierro  wrote:
>
> > > can you please try again?
>
> > > Massimo
>
> > > On Dec 4, 12:31 pm, ron_m  wrote:
>
> > > > Describe what I did
>
> > > > Copied the trunk hg area to a work area
> > > > Renamed sql.py to sql-save.py
> > > > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > > > Copied application I am working on to applications directory
> > > > Backed up the database
> > > > Ran the server as python web2py.py
>
> > > > Got this stack trace
> > > > Traceback (most recent call last):
> > > >   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> > > > wsgibase
> > > >     BaseAdapter.close_all_instances(BaseAdapter.commit)
> > > >   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> > > > close_all_instances
> > > >     if instance._pool_size:
> > > > AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> > > > I don't use SQLite as a database but the driver exists through default
> > > > install, the db line invoking SQLite is commented out.
>
>


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Phyo Arkar
Why nobody uses JQUI ?
http://jqueryui.com

yes extJS and other UI frameworks have already build UIs , but if you
want to build something from scratch jqui provide you all the stuff
you need. It have very powerful CSS Framework.
I found it very easy/productive to use, and themeroller rocks!

On 12/5/10, Branko Vukelic  wrote:
> OMG! I'm definitely using this for admin2! I've just started the Hello
> World tutorial. I can't believe the attention it's been given... /me
> drops jaw
>
> On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic  wrote:
>> Awesome feature set.
>>
>> On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
>>> instead of extjs i can happily recommend you using qooxdoo.
>>>
>>> see: http://qooxdoo.org
>>>
>>> On Dec 3, 11:10 pm, Branko Vukelic  wrote:
 On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
 > I would be careful on the licensing of Ext JS, wasn't this the one
 > that caused some concerns a couple of years ago when they switched as
 > they became popular with the GWT users?

 They require you to release your _application_ code if you want to use
 Ext.JS with open-source license. It's kind of like GPL on steroids. :)

 Btw, I've been using Mootools for a while. Very pythonic. I absolutely
 love it.

 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog:http://www.brankovukelic.com/
 Check out my portfolio:http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca:http://identi.ca/foxbunny

 Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>>
>>
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog: http://www.brankovukelic.com/
>> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca: http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guild
>> http://bit.ly/gbg-group
>>
>
>
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog: http://www.brankovukelic.com/
> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca: http://identi.ca/foxbunny
>
> Gimp Brushmakers Guild
> http://bit.ly/gbg-group
>


[web2py] Re: strange problem with form

2010-12-04 Thread VP
When there's no problem (don't know when it will show up), this is
what is shown:

request.session_id is None
response.session_id is not

what do you meant by "see if they match of a new session is issued
when the problem appears."?


[web2py] Re: strange problem with form

2010-12-04 Thread VP
No custom view.
Will try this.

On Dec 4, 10:07 pm, mdipierro  wrote:
> Do you have a custom form in the view?
>
> It could be a session problem
>
> Try display
>
> {{=request.session_id}}
> {{=response.session_id}}
>
> and see if they match of a new session is issued when the problem
> appears.
>
> On Dec 4, 9:59 pm, VP  wrote:
>
> > I have this simple form.  Lately, I've got this very strange problem.
> > Occasionally, after I filled out the form and submit.  (See code
> > below). The form did not get submitted.  Every field is clear.
> > There're no errors (instead the "else" is entered with the message
> > "please fill the form".)
>
> > I can't replicate it.  But it seems it is occurring more and more.
> > Any idea?  Thanks.
>
> > @auth.requires_login()
> > def add_entry():
> >     form = SQLFORM(db.entry)
> >     if form.accepts(request.vars, session):
> >         redirect(URL('post_process'))
> >     elif form.errors:
> >         response.flash = 'form has errors'
> >     else:
> >         response.flash = 'please fill the form'
> >     return dict( form=form )
>
>


[web2py] Re: strange problem with form

2010-12-04 Thread mdipierro
Do you have a custom form in the view?

It could be a session problem

Try display

{{=request.session_id}}
{{=response.session_id}}

and see if they match of a new session is issued when the problem
appears.

On Dec 4, 9:59 pm, VP  wrote:
> I have this simple form.  Lately, I've got this very strange problem.
> Occasionally, after I filled out the form and submit.  (See code
> below). The form did not get submitted.  Every field is clear.
> There're no errors (instead the "else" is entered with the message
> "please fill the form".)
>
> I can't replicate it.  But it seems it is occurring more and more.
> Any idea?  Thanks.
>
> @auth.requires_login()
> def add_entry():
>     form = SQLFORM(db.entry)
>     if form.accepts(request.vars, session):
>         redirect(URL('post_process'))
>     elif form.errors:
>         response.flash = 'form has errors'
>     else:
>         response.flash = 'please fill the form'
>     return dict( form=form )


[web2py] strange problem with form

2010-12-04 Thread VP
I have this simple form.  Lately, I've got this very strange problem.
Occasionally, after I filled out the form and submit.  (See code
below). The form did not get submitted.  Every field is clear.
There're no errors (instead the "else" is entered with the message
"please fill the form".)

I can't replicate it.  But it seems it is occurring more and more.
Any idea?  Thanks.


@auth.requires_login()
def add_entry():
form = SQLFORM(db.entry)
if form.accepts(request.vars, session):
redirect(URL('post_process'))
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill the form'
return dict( form=form )


[web2py] Re: new dal

2010-12-04 Thread mdipierro
Can you try delete everything in app/cache/

The error seems in opening the cache file.

On Dec 4, 8:30 pm, "mr.freeze"  wrote:
> I was getting that error. After updating it goes away but now I get
> the below. I am running it against web2pyslices.com source on a sqlite
> db with Python 2.5:
>
> Traceback (most recent call last):
>   File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
> 188, in restricted
>     exec ccode in environment
>   File "C:/Users/nathan/workspace/web2py/applications/main/models/
> menu.py", line 115, in 
>     response.tagcloud =
> db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
> 600))
>   File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
> select
>     shutil.copyfileobj(file, dest_file)
>   File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
> __call__
>     storage = shelve.open(self.shelve_name)
>   File "C:\Python25\lib\shelve.py", line 225, in open
>     return DbfilenameShelf(filename, flag, protocol, writeback)
>   File "C:\Python25\lib\shelve.py", line 209, in __init__
>     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> writeback)
>   File "C:\Python25\lib\anydbm.py", line 83, in open
>     return mod.open(file, flag, mode)
>   File "C:\Python25\lib\dbhash.py", line 16, in open
>     return bsddb.hashopen(file, flag, mode)
>   File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
>     d.open(file, db.DB_HASH, flags, mode)
> DBPermissionsError: (1, 'Operation not permitted')
>
> On Dec 4, 4:00 pm, mdipierro  wrote:
>
> > can you please try again?
>
> > Massimo
>
> > On Dec 4, 12:31 pm, ron_m  wrote:
>
> > > Describe what I did
>
> > > Copied the trunk hg area to a work area
> > > Renamed sql.py to sql-save.py
> > > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > > Copied application I am working on to applications directory
> > > Backed up the database
> > > Ran the server as python web2py.py
>
> > > Got this stack trace
> > > Traceback (most recent call last):
> > >   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> > > wsgibase
> > >     BaseAdapter.close_all_instances(BaseAdapter.commit)
> > >   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> > > close_all_instances
> > >     if instance._pool_size:
> > > AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> > > I don't use SQLite as a database but the driver exists through default
> > > install, the db line invoking SQLite is commented out.
>
>


[web2py] Re: Forms, radio boxes, options, etc.

2010-12-04 Thread VP
thanks.

On Dec 4, 6:52 pm, Richard Vézina  wrote:
> Here you will find some answers :
>
> http://wiki.web2py.com/Form_Select_Options_from_DB
>
> For your drop down you
> have to define : requires=IS_IN_SET(['red',
> 'green', 'blue']) instead of requires=IS_IN_SET(['Non-Fiction',
> 'Fiction', 'Childrens'])
>
> Hope this help!
>
> Richard
>
> On Sat, Dec 4, 2010 at 6:23 PM, VP  wrote:
> > I'd like to use FORM(...) to create forms with radio boxes, drop-down
> > options, etc.  But I can't find any document on how to do this.
>
> > For example, if I'd like a drop-down option for 'red', 'green',
> > 'blue', how do I do this using FORM?
>
> > Thanks.
>
>


[web2py] Re: Scalability of web2py?

2010-12-04 Thread mdipierro
This is supposed to be even better

# http://code.google.com/p/gevent/source/browse/examples/wsgiserver.py
from gevent import wsgi


but cannot install on snow leopard.

Massimo

On Dec 4, 9:19 pm, mdipierro  wrote:
> I tried this:
>
> #http://eventlet.net/doc/examples.html#wsgi-server
> import eventlet
> from eventlet import wsgi
> from rocket import Rocket
>
> def hello_world(env, start_response):
>     if env['PATH_INFO'] != '/':
>         start_response('404 Not Found', [('Content-Type', 'text/
> plain')])
>         return ['Not Found\r\n']
>     start_response('200 OK', [('Content-Type', 'text/plain')])
>     return ['Hello, World!\r\n']
>
> if __name__=='__main__':
>     if True:
>        r=Rocket(('127.0.0.1',8081),'wsgi', {'wsgi_app':hello_world})
>        r.start()
>     else:
>        wsgi.server(eventlet.listen(('127.0.0.1', 8081)), hello_world)
>
> with
>
> ab -n 1 -c 10http://127.0.0.1:8081/
>
> rocket: 0.618 [ms]
> eventlet: 0.443 [ms]
>
> ab -n 1 -c 100http://127.0.0.1:8081/
>
> rocket: 0.629 [ms]
> eventlet:
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1000 requests
> Test aborted after 10 failures
> apr_socket_connect(): Connection reset by peer (54)
> Total of 1998 requests completed
>
> On Dec 4, 7:39 pm, Branko Vukelic  wrote:
>
> > On Sun, Dec 5, 2010 at 1:59 AM, blackthorne  wrote:
> > > I've read it while ago.
> > > The "problem" with that test is the number of processors. It takes a
> > > high number of CPUs to bring Erlang benefits.
>
> > Another 'problem' is that it's not about performance when it comes to
> > Erlang. It's about overall robustness. For example, Yaws HTTP server
> > may not be the fastest around, but you just cannot kill it. Even if it
> > drops a request, it will keep on running, and handling whatever
> > requests you throw at it. I guess I had that in mind when I said
> > scalability.
>
> > Also, Erlang has software threads, afaik, not hardware CPU threads,
> > and it manages those internally using a supervisor-worker
> > architecture. That's something built into the language, and you mostly
> > don't have to worry about it.
>
> > --
> > Branko Vukelić
>
> > bg.bra...@gmail.com
> > stu...@brankovukelic.com
>
> > Check out my blog:http://www.brankovukelic.com/
> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> > Registered Linux user #438078 (http://counter.li.org/)
> > I hang out on identi.ca:http://identi.ca/foxbunny
>
> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>
>


[web2py] Re: Newbie question:add new record as a copy of an existing row in SQLFORM

2010-12-04 Thread tomt
Thanks to both of the responders.  The reference and example have
answered my question. (and introduced some concepts I was unfamiliar
with)
  - Tom

On Dec 3, 9:30 pm, "mr.freeze"  wrote:
> Here is an example:
>
> Model
> -
> db.define_table('things',Field('name',requires=IS_NOT_EMPTY()),
>                 Field('age','integer'),Field('weight','double'))
> db.things.id.represent = lambda v: A(v,_href=URL(vars=dict(dupe=v)),
>                                      _onclick='return confirm("Copy
> %s?")' % v)
>
> Controller
> --
> def index():
>     form = SQLFORM(db.things)
>     if form.accepts(request.vars,session):
>         response.flash = 'Added a thing'
>     if request.vars.dupe:
>         record = db.things(request.vars.dupe)
>         vals = {}
>         for k,v in record.items():
>             if k in db.things.fields:
>                 vals[k] = v
>         db.things.insert(**vals)
>     things = db(db.things.id>0).select()
>     return dict(form=form,things=things)
>
> On Dec 3, 6:12 pm, tomt  wrote:
>
> > Hi,
>
> > I've started to write a simple application to learn web2py. I am using
> > SQLFORM to insert, modify and delete records. So far everything is
> > working as planned.
>
> > I would like to give the user the ability add a new record as a copy
> > of an existing one.  The idea is that the user would view an existing
> > record, modify a couple fields, and select 'copy' which result in
> > adding a new record.
>
> > I assume that this requires additional code, and I was hoping that
> > someone would suggest an example, or let me know if SQLFORM can do
> > this automatically.
>
> > Thanks in advance,
>
> > - Tom
>
>


[web2py] Re: Scalability of web2py?

2010-12-04 Thread mdipierro
I tried this:


# http://eventlet.net/doc/examples.html#wsgi-server
import eventlet
from eventlet import wsgi
from rocket import Rocket


def hello_world(env, start_response):
if env['PATH_INFO'] != '/':
start_response('404 Not Found', [('Content-Type', 'text/
plain')])
return ['Not Found\r\n']
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello, World!\r\n']


if __name__=='__main__':
if True:
   r=Rocket(('127.0.0.1',8081),'wsgi', {'wsgi_app':hello_world})
   r.start()
else:
   wsgi.server(eventlet.listen(('127.0.0.1', 8081)), hello_world)

with

ab -n 1 -c 10 http://127.0.0.1:8081/

rocket: 0.618 [ms]
eventlet: 0.443 [ms]

ab -n 1 -c 100 http://127.0.0.1:8081/

rocket: 0.629 [ms]
eventlet:

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Test aborted after 10 failures
apr_socket_connect(): Connection reset by peer (54)
Total of 1998 requests completed




On Dec 4, 7:39 pm, Branko Vukelic  wrote:
> On Sun, Dec 5, 2010 at 1:59 AM, blackthorne  wrote:
> > I've read it while ago.
> > The "problem" with that test is the number of processors. It takes a
> > high number of CPUs to bring Erlang benefits.
>
> Another 'problem' is that it's not about performance when it comes to
> Erlang. It's about overall robustness. For example, Yaws HTTP server
> may not be the fastest around, but you just cannot kill it. Even if it
> drops a request, it will keep on running, and handling whatever
> requests you throw at it. I guess I had that in mind when I said
> scalability.
>
> Also, Erlang has software threads, afaik, not hardware CPU threads,
> and it manages those internally using a supervisor-worker
> architecture. That's something built into the language, and you mostly
> don't have to worry about it.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error? [Closed (but not entirely resolved)]

2010-12-04 Thread weheh
On further consideration, I consider this a kludge, albeit one that
I'm at a loss to figure out how to fix. The "web2py way" is web2py
+jQuery+ajax+css+... (hope I didn't leave something out). In the
interest of backwards compatibility, we need to think carefully about
this web2py_ajax.html file and how it gets updated. For instance, the
new web2py_ajax.html file and ajax-ing approach seem to be passing
variables by the name of the widget referenced by the event, not by
its id. In the past, it was id only. This is a rather substantial
change that I seem to have missed in the forum threads (I was out of
town for a few weeks) and also is missing in the doc. Beating my head
on this wall effectively wasted me a day. I've got to believe there's
a better way.

Nevertheless, I'm closing this thread because my underlying issue is
resolved. But I'm carrying scars from the experience.



On Dec 4, 6:23 pm, Jonathan Lundell  wrote:
> On Dec 4, 2010, at 2:53 PM, weheh wrote:
>
>
>
> > OK, that did the trick. Thanks.
>
> > As for the web2py_ajax.html file, all I have to say is, 'Urggh!' This
> > is probably the 3rd time I've been bitten by changes to the file in
> > the last year or two. Must keep that in mind in the future.
>
> Right; you can't count on being able to simply copy it over to your 
> application when it changes.
>
> I've been doing this (a little tedious, but necessary). I make a copy of the 
> stock web2py_ajax.html file (this could happen with other application files 
> as well; layout.html in my case) to keep as a reference, and then make my own 
> local changes to it (typically not a lot, but some).
>
> When I'm motivated to incorporate a newer version, I diff the original stock 
> file against the new one, to see what the web2py changes are, and diff the 
> original stock file against my current file, to see what I did. Then I apply 
> my changes to the new stock version (keeping a reference copy, of course), 
> and also evaluate whether the changes to the web2py version have any 
> implications for my app, and deal with them.
>
> I could probably enlist hg to help with this process, but so far I've been 
> doing it manually; I find it a little less confusing. You're basically 
> merging two parallel branches, and sometimes it's hard to do that 
> mechanically.
>
>
>
> > Again, many thanks for the help, Nathan. You too, Jonathan.
>
> > On Dec 4, 5:26 pm, "mr.freeze"  wrote:
> >> Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
> >> same backwards compatibility umbrella as the actual framework. Anyway,
> >> it's selecting by name so just change your onclick to:
> >>  _onclick="ajax('process_checkbox',['junk'],':eval');")
> >> ...and it should work.
>
> >> On Dec 4, 4:17 pm, "mr.freeze"  wrote:
>
> >>> Perhaps this was a recent change in trunk but it's definitely not
> >>> backwards compatible.  Selecting by name and id will definitely give
> >>> you different results.
>
> >>> On Dec 4, 4:14 pm, "mr.freeze"  wrote:
>
>  Your web2py_ajax.html ajax function IS different. Note this line:
>  Yours:
>   q = jQuery("[name="+s[i]+"]").serialize();
>  Standard:
>   q = jQuery("#"+s[i]).serialize();
>
>  On Dec 4, 3:32 pm, weheh  wrote:
>
> > On close inspection, web2py_ajax.html is out of date on my test app. I
> > updated web2py_ajax.html and the test case still doesn't work.
>
>


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread RyaneD
I fixed the second problem but the first remains. I had messed up in
my implementation of routes.py completely user error, forgot a
parenthesis. :P As the traceback says.

So that error is gone, but when I navigate to www.scadzombies.org/web2py
I get the same 500 Internal Server Error

On Dec 4, 9:23 pm, RyaneD  wrote:
> I followed the instructions 
> onhttp://web2pyslices.com/main/slices/take_slice/68,
> which were starting to make sense but I am confounded with this error
> when i visithttp://www.scadzombies.com/web2py:
>
> --
>
> Internal Server Error
>
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
>
> Please contact the server administrator, webmas...@scadzombies.org and
> inform them of the time the error occurred, and anything you might
> have done that may have caused the error.
>
> More information about this error may be available in the server error
> log.
>
> Additionally, a 500 Internal Server Error error was encountered while
> trying to use an ErrorDocument to handle the request.
>
> Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5
> mod_fcgid/2.3.5 Phusion_Passenger/2.2.15 mod_auth_passthrough/2.1
> mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server atwww.scadzombies.org
> Port 80
>
> ---
>
> I believe this is reminiscent of the error that I get when I try to
> run web2py through ssh ever since I changed the routes.py script.
>
> ---
>
> Traceback (most recent call last):
>   File "web2py.py", line 20, in 
>     import gluon.widget
>   File "/home/scadzomb/public_html/web2py/gluon/widget.py", line 25,
> in 
>     import main
>   File "/home/scadzomb/public_html/web2py/gluon/main.py", line 101, in
> 
>     rewrite.load()
>   File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 119,
> in load
>     p[sym].append(compile_re(k, v))
>   File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 83,
> in compile_re
>     return (re.compile(k, re.DOTALL), v)
>   File "/home/scadzomb/local/lib/python2.6/re.py", line 188, in
> compile
>     return _compile(pattern, flags)
>   File "/home/scadzomb/local/lib/python2.6/re.py", line 243, in
> _compile
>     raise error, v # invalid expression
> sre_constants.error: unbalanced parenthesis
>
> ---
>
> On Dec 4, 7:21 pm, pbreit  wrote:
>
>
>
>
>
>
>
> > Unfortunately, Python in general is a bit harder to deploy than HTML
> > and PHP. Site5 has a few different hosting options so to help out it
> > would be good to know what sort of plan you are on. If it's Shared
> > Hosting, I think you will want to try the "fastcgi" option. The web2py
> > book doesn't really provide information on this however.
>
> > If you have:
> > /home/username/public_html
> > /home/username/web2py
>
> > Add and ".htaccess" file at:
> > /home/username/public_html/.htaccess:
>
> > And put this in it:
>
> > AddHandler fastcgi-script .fcgi
> > RewriteEngine On
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteRule ^(.*)$ ./web2py/fcgihandler.py/$1 [QSA,L]
>
> > There's going to be one major problem in that you can't access
> > "admin". This page discusses these issues but for 
> > Dreamhost:http://wiki.dreamhost.com/Web2py
>
> > I have had the best luck running the "web2py.ubuntu.sh" script on
> > fresh installs of Ubuntu 10.04 at Amazon or Rackspace Cloud.


[web2py] Re: new dal

2010-12-04 Thread mr.freeze
I was getting that error. After updating it goes away but now I get
the below. I am running it against web2pyslices.com source on a sqlite
db with Python 2.5:

Traceback (most recent call last):
  File "C:\Users\nathan\workspace\web2py\gluon\restricted.py", line
188, in restricted
exec ccode in environment
  File "C:/Users/nathan/workspace/web2py/applications/main/models/
menu.py", line 115, in 
response.tagcloud =
db().select(db.tags.ALL,orderby=~db.tags.count,limitby=(0,15),cache=(cache.disk,
600))
  File "C:\Users\nathan\workspace\web2py\gluon\sql.py", line 3319, in
select
shutil.copyfileobj(file, dest_file)
  File "C:\Users\nathan\workspace\web2py\gluon\cache.py", line 282, in
__call__
storage = shelve.open(self.shelve_name)
  File "C:\Python25\lib\shelve.py", line 225, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
  File "C:\Python25\lib\shelve.py", line 209, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol,
writeback)
  File "C:\Python25\lib\anydbm.py", line 83, in open
return mod.open(file, flag, mode)
  File "C:\Python25\lib\dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
  File "C:\Python25\lib\bsddb\__init__.py", line 310, in hashopen
d.open(file, db.DB_HASH, flags, mode)
DBPermissionsError: (1, 'Operation not permitted')

On Dec 4, 4:00 pm, mdipierro  wrote:
> can you please try again?
>
> Massimo
>
> On Dec 4, 12:31 pm, ron_m  wrote:
>
> > Describe what I did
>
> > Copied the trunk hg area to a work area
> > Renamed sql.py to sql-save.py
> > Copied dal.py to sql.py in order to replace sql.py with dal.py
> > Copied application I am working on to applications directory
> > Backed up the database
> > Ran the server as python web2py.py
>
> > Got this stack trace
> > Traceback (most recent call last):
> >   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> > wsgibase
> >     BaseAdapter.close_all_instances(BaseAdapter.commit)
> >   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> > close_all_instances
> >     if instance._pool_size:
> > AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> > I don't use SQLite as a database but the driver exists through default
> > install, the db line invoking SQLite is commented out.
>
>


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread RyaneD
I followed the instructions on 
http://web2pyslices.com/main/slices/take_slice/68,
which were starting to make sense but I am confounded with this error
when i visit http://www.scadzombies.com/web2py :

--

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, webmas...@scadzombies.org and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.

More information about this error may be available in the server error
log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5
mod_fcgid/2.3.5 Phusion_Passenger/2.2.15 mod_auth_passthrough/2.1
mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.scadzombies.org
Port 80


---


I believe this is reminiscent of the error that I get when I try to
run web2py through ssh ever since I changed the routes.py script.


---

Traceback (most recent call last):
  File "web2py.py", line 20, in 
import gluon.widget
  File "/home/scadzomb/public_html/web2py/gluon/widget.py", line 25,
in 
import main
  File "/home/scadzomb/public_html/web2py/gluon/main.py", line 101, in

rewrite.load()
  File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 119,
in load
p[sym].append(compile_re(k, v))
  File "/home/scadzomb/public_html/web2py/gluon/rewrite.py", line 83,
in compile_re
return (re.compile(k, re.DOTALL), v)
  File "/home/scadzomb/local/lib/python2.6/re.py", line 188, in
compile
return _compile(pattern, flags)
  File "/home/scadzomb/local/lib/python2.6/re.py", line 243, in
_compile
raise error, v # invalid expression
sre_constants.error: unbalanced parenthesis

---

On Dec 4, 7:21 pm, pbreit  wrote:
> Unfortunately, Python in general is a bit harder to deploy than HTML
> and PHP. Site5 has a few different hosting options so to help out it
> would be good to know what sort of plan you are on. If it's Shared
> Hosting, I think you will want to try the "fastcgi" option. The web2py
> book doesn't really provide information on this however.
>
> If you have:
> /home/username/public_html
> /home/username/web2py
>
> Add and ".htaccess" file at:
> /home/username/public_html/.htaccess:
>
> And put this in it:
>
> AddHandler fastcgi-script .fcgi
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ ./web2py/fcgihandler.py/$1 [QSA,L]
>
> There's going to be one major problem in that you can't access
> "admin". This page discusses these issues but for 
> Dreamhost:http://wiki.dreamhost.com/Web2py
>
> I have had the best luck running the "web2py.ubuntu.sh" script on
> fresh installs of Ubuntu 10.04 at Amazon or Rackspace Cloud.


[web2py] Special Characters in Gluon DAL Connection String

2010-12-04 Thread Tony Young
Hi web2py-users,

Currently, Gluon DAL has no support for weird and whacky characters like @
in the database connection string.

I propose a patch to use unquote_plus to allow these characters, and leave
it to be an exercise for the user
to escape their own special characters.

This issue is also on the Sahana bug tracker:
http://eden.sahanafoundation.org/ticket/726

-Tony


dal.diff
Description: Binary data


sql.diff
Description: Binary data


Re: [web2py] Re: Scalability of web2py?

2010-12-04 Thread Branko Vukelic
On Sun, Dec 5, 2010 at 1:59 AM, blackthorne  wrote:
> I've read it while ago.
> The "problem" with that test is the number of processors. It takes a
> high number of CPUs to bring Erlang benefits.

Another 'problem' is that it's not about performance when it comes to
Erlang. It's about overall robustness. For example, Yaws HTTP server
may not be the fastest around, but you just cannot kill it. Even if it
drops a request, it will keep on running, and handling whatever
requests you throw at it. I guess I had that in mind when I said
scalability.

Also, Erlang has software threads, afaik, not hardware CPU threads,
and it manages those internally using a supervisor-worker
architecture. That's something built into the language, and you mostly
don't have to worry about it.

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Brian M
Check out these pages on web2py slices:
http://web2pyslices.com/main/default/search?query=FastCGI&criteria=tags

On Dec 4, 6:21 pm, pbreit  wrote:
> Unfortunately, Python in general is a bit harder to deploy than HTML
> and PHP. Site5 has a few different hosting options so to help out it
> would be good to know what sort of plan you are on. If it's Shared
> Hosting, I think you will want to try the "fastcgi" option. The web2py
> book doesn't really provide information on this however.
>
> If you have:
> /home/username/public_html
> /home/username/web2py
>
> Add and ".htaccess" file at:
> /home/username/public_html/.htaccess:
>
> And put this in it:
>
> AddHandler fastcgi-script .fcgi
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ ./web2py/fcgihandler.py/$1 [QSA,L]
>
> There's going to be one major problem in that you can't access
> "admin". This page discusses these issues but for 
> Dreamhost:http://wiki.dreamhost.com/Web2py
>
> I have had the best luck running the "web2py.ubuntu.sh" script on
> fresh installs of Ubuntu 10.04 at Amazon or Rackspace Cloud.


[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
Ok I'll work on making the change then.

On Dec 4, 4:15 pm, Jonathan Lundell  wrote:
> On Dec 4, 2010, at 1:52 PM, Brian M wrote:
>
>
>
> > OK, so make it so that if desired some subset of the URL vars could be
> > signed while still allowing other vars to be changed. That is
> > certainly doable and would be nice for securing only the important
> > parts.
>
> Right. Not so much the important parts as the invariant ones--the ones that 
> the form can't alter.
>
>
>
> > Are you assuming that *all* the args *always* get hashed though - that
> > seems reasonable to me anyway since a form or ajax call shouldn't need
> > to manipulate them right?
>
> That's what I'm assuming, yes. I think it'd be best to avoid that 
> complication for now, and if it turns out to be desirable down the road, we 
> could add a hash_args=True default that would retain compatibility.
>
>
>
>
>
>
>
>
>
> > If this sounds like a better implementation to you Jonathan (and
> > anyone else) then I can look at getting a patch to Massimo.
>
> > ~Brian
>
> > On Dec 4, 1:07 pm, Jonathan Lundell  wrote:
> >> On Dec 4, 2010, at 10:29 AM, Brian M wrote:
>
> >>> Jonathan,
>
> >>> How would you like to see this behave? Perhaps URL('index',args=[],
> >>> vars={}, hash_key='xxx', hash=['args','vars']) and then
> >>> URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could
> >>> choose which portions of the URL to sign and/or verify with hash=None
> >>> triggering the original behavior of hashing both? Since this hasn't
> >>> made it into a stable release yet I assume changes can be made still
> >>> without worrying about breaking backwards compatibility.
>
> >> That would work. I'm not sure if it needs to be that general; is there a 
> >> use case for hashing vars but not args? If not, then a boolean would be 
> >> adequate (hash_vars=True by default; the caller sets it False if desired).
>
> >> Another generalization would be to pass a set of var keys to be included 
> >> in the hash: hash_vars=set('name1', 'name2'). The use case would be a 
> >> form, again (or Ajax, perhaps), where the included vars would be page 
> >> state kept in hidden or read-only elements of the form.
>
> >> So:     hash_vars=True  (default; hash all vars)
> >>         hash_vars=False (don't hash any vars)
> >>         hash_vars=set(...)      (hash only the vars named in the set)
>
> >> The set needn't be a set per se, I suppose. Any iterable (well, not a 
> >> string) would suffice.
>
> >>> ~Brian
>
> >>> On Dec 3, 11:13 am, Jonathan Lundell  wrote:
>  On Dec 3, 2010, at 9:01 AM, mdipierro wrote:
>
> > New feature in trunk:
>
> > URL('index',args=[],vars={},hash_key='xxx')
>
> > the URL will have a _signature attached. The associated controller can
> > check for the signature with
>
> > def index():
> >     if not URL.verify(hmac_key='xxx'): ..
> >     ...
>
> > Please test it. In particular we need to test the workflow and see if
> > we are missing something useful or doing something wrong.
>
>  Perhaps there should be an option to exclude the query string from the 
>  hash calculation. Otherwise we can't sign URLs that are form actions (or 
>  that are similarly used with Ajax).


[web2py] Re: Scalability of web2py?

2010-12-04 Thread blackthorne
I've read it while ago.
The "problem" with that test is the number of processors. It takes a
high number of CPUs to bring Erlang benefits.

And scalability performance is only one issue.
For example, how do you deal with deployment of a new version in large
distributed system while on production? With Erlang you can do it on
the fly with no ups and downs and you can even take it back
seamlessly.
What happens if you want to keep it ON for months? I have no clue
about Stackless Python.

That said, considering what I've seen about python and the differences
to Stackless, you bet on it as a great solution! I love it!

On Dec 3, 7:40 pm, mdipierro  wrote:
> What do you people make of this:
>
> http://muharem.wordpress.com/2007/07/31/erlang-vs-stackless-python-a-...
>
> (web2py runs on stackless except that out server does not take
> advantage of its features).
>
> Massimo
>
> On Dec 3, 1:32 pm, Branko Vukelic  wrote:
>
>
>
> > I don't know why but Java hasn't been mentioned even once. Java has
> > seen lots of deployment, and I imagine some huge stuff might have been
> > built on it, and it's open-source-ish. :)
>
> > PHP? It's well capable of handling it's business, you know. Facebook's
> > front-end runs on PHP. And it's open-source. Ugly as hell, too.
>
> > Ruby on Rails was another option, right? Has all the benefits of an
> > open-source project with all the benefits of the 'proven to scale'
> > argument?
>
> > And finally, Erlang. Proven to massively scale in right hands, proven
> > ability to deal with hugely concurrent apps... If it's good enough for
> > Ericsson, right? I mean telecomm software: real-time, distributed, and
> > how many people use phones (including cells) around the world?
> > Facebook chat runs on it, Github has some components ported to Erlang,
> > and generally, wherever real-timeness is a priority, it's unbeatable.
>
> > So, it's not .NET vs web2py. It's proven-to-scale (they gave .NET and
> > Rails as examples, iirc), versus web2py. You have open-source
> > solutions other than Python/web2py. Frankly, I'd always bet on Erlang.
> > But I never learn enough of it to get started. :)
>
> > --
> > Branko Vukelić
>
> > bg.bra...@gmail.com
> > stu...@brankovukelic.com
>
> > Check out my blog:http://www.brankovukelic.com/
> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> > Registered Linux user #438078 (http://counter.li.org/)
> > I hang out on identi.ca:http://identi.ca/foxbunny
>
> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Forms, radio boxes, options, etc.

2010-12-04 Thread Richard Vézina
Here you will find some answers :

http://wiki.web2py.com/Form_Select_Options_from_DB

For your drop down you
have to define : requires=IS_IN_SET(['red',
'green', 'blue']) instead of requires=IS_IN_SET(['Non-Fiction',
'Fiction', 'Childrens'])

Hope this help!

Richard

On Sat, Dec 4, 2010 at 6:23 PM, VP  wrote:

> I'd like to use FORM(...) to create forms with radio boxes, drop-down
> options, etc.  But I can't find any document on how to do this.
>
> For example, if I'd like a drop-down option for 'red', 'green',
> 'blue', how do I do this using FORM?
>
> Thanks.


[web2py] Re: Forms, radio boxes, options, etc.

2010-12-04 Thread mr.freeze
Look in the book under the HTML Helpers section:
http://web2py.com/book/default/chapter/05?#HTML-Helpers

This would create the form using helpers:
def index():
   form = FORM(SELECT([OPTION(opt) for opt in
['red','green','blue']]))
   return dict(form=form)

...or more verbose...

def index():
   opts = ['red','green','blue']
   form = FORM(SELECT(*opts))
   return dict(form=form)

...or even more verbose...

def index():
   opts = ['red','green','blue']
   select = SELECT()
   form = FORM()
   for opt in opt:
   option = OPTION(opt)
   select.append(option)
   form.append(select)
   return dict(form=form)

On Dec 4, 5:23 pm, VP  wrote:
> I'd like to use FORM(...) to create forms with radio boxes, drop-down
> options, etc.  But I can't find any document on how to do this.
>
> For example, if I'd like a drop-down option for 'red', 'green',
> 'blue', how do I do this using FORM?
>
> Thanks.


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread pbreit
Unfortunately, Python in general is a bit harder to deploy than HTML
and PHP. Site5 has a few different hosting options so to help out it
would be good to know what sort of plan you are on. If it's Shared
Hosting, I think you will want to try the "fastcgi" option. The web2py
book doesn't really provide information on this however.

If you have:
/home/username/public_html
/home/username/web2py

Add and ".htaccess" file at:
/home/username/public_html/.htaccess:

And put this in it:

AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ./web2py/fcgihandler.py/$1 [QSA,L]

There's going to be one major problem in that you can't access
"admin". This page discusses these issues but for Dreamhost:
http://wiki.dreamhost.com/Web2py

I have had the best luck running the "web2py.ubuntu.sh" script on
fresh installs of Ubuntu 10.04 at Amazon or Rackspace Cloud.


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Branko Vukelic
OMG! I'm definitely using this for admin2! I've just started the Hello
World tutorial. I can't believe the attention it's been given... /me
drops jaw

On Sun, Dec 5, 2010 at 12:07 AM, Branko Vukelic  wrote:
> Awesome feature set.
>
> On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
>> instead of extjs i can happily recommend you using qooxdoo.
>>
>> see: http://qooxdoo.org
>>
>> On Dec 3, 11:10 pm, Branko Vukelic  wrote:
>>> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
>>> > I would be careful on the licensing of Ext JS, wasn't this the one
>>> > that caused some concerns a couple of years ago when they switched as
>>> > they became popular with the GWT users?
>>>
>>> They require you to release your _application_ code if you want to use
>>> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>>>
>>> Btw, I've been using Mootools for a while. Very pythonic. I absolutely love 
>>> it.
>>>
>>> --
>>> Branko Vukelić
>>>
>>> bg.bra...@gmail.com
>>> stu...@brankovukelic.com
>>>
>>> Check out my blog:http://www.brankovukelic.com/
>>> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>>> Registered Linux user #438078 (http://counter.li.org/)
>>> I hang out on identi.ca:http://identi.ca/foxbunny
>>>
>>> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>
>
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog: http://www.brankovukelic.com/
> Check out my portfolio: http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca: http://identi.ca/foxbunny
>
> Gimp Brushmakers Guild
> http://bit.ly/gbg-group
>



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 2:53 PM, weheh wrote:
> 
> OK, that did the trick. Thanks.
> 
> As for the web2py_ajax.html file, all I have to say is, 'Urggh!' This
> is probably the 3rd time I've been bitten by changes to the file in
> the last year or two. Must keep that in mind in the future.

Right; you can't count on being able to simply copy it over to your application 
when it changes.

I've been doing this (a little tedious, but necessary). I make a copy of the 
stock web2py_ajax.html file (this could happen with other application files as 
well; layout.html in my case) to keep as a reference, and then make my own 
local changes to it (typically not a lot, but some).

When I'm motivated to incorporate a newer version, I diff the original stock 
file against the new one, to see what the web2py changes are, and diff the 
original stock file against my current file, to see what I did. Then I apply my 
changes to the new stock version (keeping a reference copy, of course), and 
also evaluate whether the changes to the web2py version have any implications 
for my app, and deal with them.

I could probably enlist hg to help with this process, but so far I've been 
doing it manually; I find it a little less confusing. You're basically merging 
two parallel branches, and sometimes it's hard to do that mechanically.

> 
> Again, many thanks for the help, Nathan. You too, Jonathan.
> 
> 
> On Dec 4, 5:26 pm, "mr.freeze"  wrote:
>> Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
>> same backwards compatibility umbrella as the actual framework. Anyway,
>> it's selecting by name so just change your onclick to:
>>  _onclick="ajax('process_checkbox',['junk'],':eval');")
>> ...and it should work.
>> 
>> On Dec 4, 4:17 pm, "mr.freeze"  wrote:
>> 
>>> Perhaps this was a recent change in trunk but it's definitely not
>>> backwards compatible.  Selecting by name and id will definitely give
>>> you different results.
>> 
>>> On Dec 4, 4:14 pm, "mr.freeze"  wrote:
>> 
 Your web2py_ajax.html ajax function IS different. Note this line:
 Yours:
  q = jQuery("[name="+s[i]+"]").serialize();
 Standard:
  q = jQuery("#"+s[i]).serialize();
>> 
 On Dec 4, 3:32 pm, weheh  wrote:
>> 
> On close inspection, web2py_ajax.html is out of date on my test app. I
> updated web2py_ajax.html and the test case still doesn't work.
>> 
>> 




[web2py] Forms, radio boxes, options, etc.

2010-12-04 Thread VP
I'd like to use FORM(...) to create forms with radio boxes, drop-down
options, etc.  But I can't find any document on how to do this.

For example, if I'd like a drop-down option for 'red', 'green',
'blue', how do I do this using FORM?

Thanks.


Re: [web2py] Re: when to use ajax

2010-12-04 Thread Branko Vukelic
Awesome feature set.

On Sat, Dec 4, 2010 at 11:31 PM, Mengu  wrote:
> instead of extjs i can happily recommend you using qooxdoo.
>
> see: http://qooxdoo.org
>
> On Dec 3, 11:10 pm, Branko Vukelic  wrote:
>> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
>> > I would be careful on the licensing of Ext JS, wasn't this the one
>> > that caused some concerns a couple of years ago when they switched as
>> > they became popular with the GWT users?
>>
>> They require you to release your _application_ code if you want to use
>> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>>
>> Btw, I've been using Mootools for a while. Very pythonic. I absolutely love 
>> it.
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog:http://www.brankovukelic.com/
>> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca:http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guildhttp://bit.ly/gbg-group



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Supporting user translations on GAE

2010-12-04 Thread Richard
Does anyone happen to have a prior implementation?


On Dec 4, 11:24 am, howesc  wrote:
> because you cannot write to the file system, your "updated files" will
> need to be stored in the database.  since these could get large you
> might consider using blobstore to store the files.
>
> then yes, you'll have to override T() with something that reads
> blobstore, or your database.  i would recommend using memcache as well
> to reduce the number of DB queries.
>
> On Dec 2, 7:35 pm, Richard  wrote:
>
> > I want to allow users to add languages and translate strings for my
> > app. The app is hosted on GAE so overriding the translation files is
> > not allowed.
>
> > What do you recommend? - override T() with my own helper that reads
> > from the database?
>
>


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
OK, that did the trick. Thanks.

As for the web2py_ajax.html file, all I have to say is, 'Urggh!' This
is probably the 3rd time I've been bitten by changes to the file in
the last year or two. Must keep that in mind in the future.

Again, many thanks for the help, Nathan. You too, Jonathan.


On Dec 4, 5:26 pm, "mr.freeze"  wrote:
> Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
> same backwards compatibility umbrella as the actual framework. Anyway,
> it's selecting by name so just change your onclick to:
>  _onclick="ajax('process_checkbox',['junk'],':eval');")
> ...and it should work.
>
> On Dec 4, 4:17 pm, "mr.freeze"  wrote:
>
> > Perhaps this was a recent change in trunk but it's definitely not
> > backwards compatible.  Selecting by name and id will definitely give
> > you different results.
>
> > On Dec 4, 4:14 pm, "mr.freeze"  wrote:
>
> > > Your web2py_ajax.html ajax function IS different. Note this line:
> > > Yours:
> > >  q = jQuery("[name="+s[i]+"]").serialize();
> > > Standard:
> > >  q = jQuery("#"+s[i]).serialize();
>
> > > On Dec 4, 3:32 pm, weheh  wrote:
>
> > > > On close inspection, web2py_ajax.html is out of date on my test app. I
> > > > updated web2py_ajax.html and the test case still doesn't work.
>
>


Re: [web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 2:26 PM, mr.freeze wrote:
> 
> Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
> same backwards compatibility umbrella as the actual framework. Anyway,
> it's selecting by name so just change your onclick to:
> _onclick="ajax('process_checkbox',['junk'],':eval');")
> ...and it should work.

In general, the stuff under applications/ doesn't fall under backwards 
compatibility, since it won't change once you've incorporated it into your own 
app, unless and until you want to change it, either by doing your own edits or 
by incorporating a later version. 

[web2py] Re: when to use ajax

2010-12-04 Thread Mengu
instead of extjs i can happily recommend you using qooxdoo.

see: http://qooxdoo.org

On Dec 3, 11:10 pm, Branko Vukelic  wrote:
> On Fri, Dec 3, 2010 at 7:04 PM, ron_m  wrote:
> > I would be careful on the licensing of Ext JS, wasn't this the one
> > that caused some concerns a couple of years ago when they switched as
> > they became popular with the GWT users?
>
> They require you to release your _application_ code if you want to use
> Ext.JS with open-source license. It's kind of like GPL on steroids. :)
>
> Btw, I've been using Mootools for a while. Very pythonic. I absolutely love 
> it.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
same backwards compatibility umbrella as the actual framework. Anyway,
it's selecting by name so just change your onclick to:
 _onclick="ajax('process_checkbox',['junk'],':eval');")
...and it should work.

On Dec 4, 4:17 pm, "mr.freeze"  wrote:
> Perhaps this was a recent change in trunk but it's definitely not
> backwards compatible.  Selecting by name and id will definitely give
> you different results.
>
> On Dec 4, 4:14 pm, "mr.freeze"  wrote:
>
> > Your web2py_ajax.html ajax function IS different. Note this line:
> > Yours:
> >  q = jQuery("[name="+s[i]+"]").serialize();
> > Standard:
> >  q = jQuery("#"+s[i]).serialize();
>
> > On Dec 4, 3:32 pm, weheh  wrote:
>
> > > On close inspection, web2py_ajax.html is out of date on my test app. I
> > > updated web2py_ajax.html and the test case still doesn't work.
>
>


Re: [web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread Branko Vukelic
On Sat, Dec 4, 2010 at 11:09 PM, dustin.b  wrote:
> took me a while to find my calculator(behind my desk) cuz im not that
> bright at mental math ... til ...  i realized im sitting in front of
> one .. doohh  did that indicate my intelligence ? :D 'hope not! :)
>
> did python(usage) indicate some kind of intelligence? i hear employers
> like that kind of skill, even they seach for java(etc. ) coders :)

Well, took me almost 5 minutes WITH a calculator... What can I say...
But I have a good excuse: I'm a graphic designer. :P

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
Perhaps this was a recent change in trunk but it's definitely not
backwards compatible.  Selecting by name and id will definitely give
you different results.

On Dec 4, 4:14 pm, "mr.freeze"  wrote:
> Your web2py_ajax.html ajax function IS different. Note this line:
> Yours:
>  q = jQuery("[name="+s[i]+"]").serialize();
> Standard:
>  q = jQuery("#"+s[i]).serialize();
>
> On Dec 4, 3:32 pm, weheh  wrote:
>
> > On close inspection, web2py_ajax.html is out of date on my test app. I
> > updated web2py_ajax.html and the test case still doesn't work.
>
>


Re: [web2py] Re: new in trunk signed URLS

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 1:52 PM, Brian M wrote:
> 
> OK, so make it so that if desired some subset of the URL vars could be
> signed while still allowing other vars to be changed. That is
> certainly doable and would be nice for securing only the important
> parts.

Right. Not so much the important parts as the invariant ones--the ones that the 
form can't alter.

> 
> Are you assuming that *all* the args *always* get hashed though - that
> seems reasonable to me anyway since a form or ajax call shouldn't need
> to manipulate them right?

That's what I'm assuming, yes. I think it'd be best to avoid that complication 
for now, and if it turns out to be desirable down the road, we could add a 
hash_args=True default that would retain compatibility.

> 
> If this sounds like a better implementation to you Jonathan (and
> anyone else) then I can look at getting a patch to Massimo.
> 
> ~Brian
> 
> On Dec 4, 1:07 pm, Jonathan Lundell  wrote:
>> On Dec 4, 2010, at 10:29 AM, Brian M wrote:
>> 
>> 
>> 
>>> Jonathan,
>> 
>>> How would you like to see this behave? Perhaps URL('index',args=[],
>>> vars={}, hash_key='xxx', hash=['args','vars']) and then
>>> URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could
>>> choose which portions of the URL to sign and/or verify with hash=None
>>> triggering the original behavior of hashing both? Since this hasn't
>>> made it into a stable release yet I assume changes can be made still
>>> without worrying about breaking backwards compatibility.
>> 
>> That would work. I'm not sure if it needs to be that general; is there a use 
>> case for hashing vars but not args? If not, then a boolean would be adequate 
>> (hash_vars=True by default; the caller sets it False if desired).
>> 
>> Another generalization would be to pass a set of var keys to be included in 
>> the hash: hash_vars=set('name1', 'name2'). The use case would be a form, 
>> again (or Ajax, perhaps), where the included vars would be page state kept 
>> in hidden or read-only elements of the form.
>> 
>> So: hash_vars=True  (default; hash all vars)
>> hash_vars=False (don't hash any vars)
>> hash_vars=set(...)  (hash only the vars named in the set)
>> 
>> The set needn't be a set per se, I suppose. Any iterable (well, not a 
>> string) would suffice.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> ~Brian
>> 
>>> On Dec 3, 11:13 am, Jonathan Lundell  wrote:
 On Dec 3, 2010, at 9:01 AM, mdipierro wrote:
>> 
> New feature in trunk:
>> 
> URL('index',args=[],vars={},hash_key='xxx')
>> 
> the URL will have a _signature attached. The associated controller can
> check for the signature with
>> 
> def index():
> if not URL.verify(hmac_key='xxx'): ..
> ...
>> 
> Please test it. In particular we need to test the workflow and see if
> we are missing something useful or doing something wrong.
>> 
 Perhaps there should be an option to exclude the query string from the 
 hash calculation. Otherwise we can't sign URLs that are form actions (or 
 that are similarly used with Ajax).




[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
Your web2py_ajax.html ajax function IS different. Note this line:
Yours:
 q = jQuery("[name="+s[i]+"]").serialize();
Standard:
 q = jQuery("#"+s[i]).serialize();

On Dec 4, 3:32 pm, weheh  wrote:
> On close inspection, web2py_ajax.html is out of date on my test app. I
> updated web2py_ajax.html and the test case still doesn't work.


[web2py] Re: web2py automatic instalation

2010-12-04 Thread Christopher Steel
it's python as well, thanks!

On Dec 3, 9:05 pm, Bruno Rocha  wrote:
> Simple and usefull script, I tested and it works. I know it has a simple
> purpose, but this is very useful as it downloads and unpack web2py for me.
> I am always testing new versions and nightly builds and this script will
> save some clicks.
>
> http://snipt.net/italomaia/web2py-admin/
>
> --
>
> Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread dustin.b
took me a while to find my calculator(behind my desk) cuz im not that
bright at mental math ... til ...  i realized im sitting in front of
one .. doohh  did that indicate my intelligence ? :D 'hope not! :)

did python(usage) indicate some kind of intelligence? i hear employers
like that kind of skill, even they seach for java(etc. ) coders :)


[web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread mr.freeze
I tricked a co-worker into solving it then left early for a beer. I
may be a genius.

On Dec 3, 8:32 am, António Ramos  wrote:
> 2+3=10
> 7+2=63
> 6+5=66
> 8+4=96
> So:
> 9+7=???
>
> What is the answer?
> They say the IQ of people that can find it is above 120
>
> Dont write here the answer..
> Just the time, maybe


[web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread Christopher Steel
20sec

On Dec 3, 9:32 am, António Ramos  wrote:
> 2+3=10
> 7+2=63
> 6+5=66
> 8+4=96
> So:
> 9+7=???
>
> What is the answer?
> They say the IQ of people that can find it is above 120
>
> Dont write here the answer..
> Just the time, maybe


[web2py] Re: new dal

2010-12-04 Thread mdipierro
can you please try again?

Massimo

On Dec 4, 12:31 pm, ron_m  wrote:
> Describe what I did
>
> Copied the trunk hg area to a work area
> Renamed sql.py to sql-save.py
> Copied dal.py to sql.py in order to replace sql.py with dal.py
> Copied application I am working on to applications directory
> Backed up the database
> Ran the server as python web2py.py
>
> Got this stack trace
> Traceback (most recent call last):
>   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> wsgibase
>     BaseAdapter.close_all_instances(BaseAdapter.commit)
>   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> close_all_instances
>     if instance._pool_size:
> AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> I don't use SQLite as a database but the driver exists through default
> install, the db line invoking SQLite is commented out.


[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
OK, so make it so that if desired some subset of the URL vars could be
signed while still allowing other vars to be changed. That is
certainly doable and would be nice for securing only the important
parts.

Are you assuming that *all* the args *always* get hashed though - that
seems reasonable to me anyway since a form or ajax call shouldn't need
to manipulate them right?

If this sounds like a better implementation to you Jonathan (and
anyone else) then I can look at getting a patch to Massimo.

~Brian

On Dec 4, 1:07 pm, Jonathan Lundell  wrote:
> On Dec 4, 2010, at 10:29 AM, Brian M wrote:
>
>
>
> > Jonathan,
>
> > How would you like to see this behave? Perhaps URL('index',args=[],
> > vars={}, hash_key='xxx', hash=['args','vars']) and then
> > URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could
> > choose which portions of the URL to sign and/or verify with hash=None
> > triggering the original behavior of hashing both? Since this hasn't
> > made it into a stable release yet I assume changes can be made still
> > without worrying about breaking backwards compatibility.
>
> That would work. I'm not sure if it needs to be that general; is there a use 
> case for hashing vars but not args? If not, then a boolean would be adequate 
> (hash_vars=True by default; the caller sets it False if desired).
>
> Another generalization would be to pass a set of var keys to be included in 
> the hash: hash_vars=set('name1', 'name2'). The use case would be a form, 
> again (or Ajax, perhaps), where the included vars would be page state kept in 
> hidden or read-only elements of the form.
>
> So:     hash_vars=True  (default; hash all vars)
>         hash_vars=False (don't hash any vars)
>         hash_vars=set(...)      (hash only the vars named in the set)
>
> The set needn't be a set per se, I suppose. Any iterable (well, not a string) 
> would suffice.
>
>
>
>
>
>
>
>
>
> > ~Brian
>
> > On Dec 3, 11:13 am, Jonathan Lundell  wrote:
> >> On Dec 3, 2010, at 9:01 AM, mdipierro wrote:
>
> >>> New feature in trunk:
>
> >>> URL('index',args=[],vars={},hash_key='xxx')
>
> >>> the URL will have a _signature attached. The associated controller can
> >>> check for the signature with
>
> >>> def index():
> >>>     if not URL.verify(hmac_key='xxx'): ..
> >>>     ...
>
> >>> Please test it. In particular we need to test the workflow and see if
> >>> we are missing something useful or doing something wrong.
>
> >> Perhaps there should be an option to exclude the query string from the 
> >> hash calculation. Otherwise we can't sign URLs that are form actions (or 
> >> that are similarly used with Ajax).


Re: [web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Kenneth Lundström

Hi Ryan,

you can find a fcgihandler.py file in the root web2py folder. I havn't 
used fcgi but the fcgihandler seems to have an example on how webserver 
should be configured.



Kenneth



Thanks for the responses guys. I read all of chapter 11 and I must say
this is why I feel like really am missing something important in the
grand scheme of things. I simply can not understand what it is I need
to do.

I do not have root access so I can't do anything that requires it or
sudo, so I looked on the SITE5 forums like was suggested and looked
for a django setup thread. I found one and feel like I could follow
its steps but honestly I just don't get what needs to be done for a
web2py website to work and therefor I can not figure out the changes
that need to be made.

I need to use FCGI like Brian pointed out but I don't understand the
contexts.

Is there anyway someone could give me a rudimentary check list of what
needs to be done for a website to work, and perhaps examples or
specific links on how to do each step?

What does a fcgi file need to look like for web2py? What files need to
be directly in the www folder (public_html).

-Ryan

On Dec 4, 1:42 pm, Brian M  wrote:

Check the site5 forums for hints, it looks like wsgi isn't available
on the shared hosting plans but fastcgi is. There are some Django how
to threads you may be able to work off of and combine with what's in
chapter 11 of the web2py book.

~Brian

On Dec 3, 11:21 pm, RyaneD  wrote:








Now I do understand that I am probably asking a very rudimentary
question but in the end I need a rudimentary answer that I am just not
finding. Or if I am finding I don't know what i am looking at.
A little background: I have experience in Python and in Web Design,
not much in the incorporation of the two which is the main reason I
have looked into Web2py. I am needing to build a website that is rich
in features that HTML and CSS just can not handle and I need to be
able to program it fast. Now I can get Web2py working on my Local
computer just fine, no problem. I am even jumping into the actual
development rather quickly and easily. The framework is really
extremely helpful in the quick implementation of code and I am very
grateful that it exists.
Before I get too far in the programming and development of the site
that is needed I needed to make sure that I can get it hosted on the
internet and that it will work, and this is where it falls down. I
have only ever worked in html, xhtml, css, or javascript when it comes
to the internet and I do not understand the intricacies of apache or
wsgi or CGI at all. I am currently having a mental block on this area
and it is causing me intense frustration.
Simply put, how do I setup web2py coming from my webhost (in this 
casewww.site5.com) I have setup a virtual enviroment and unzipped the
source of web2py on the website. I can run the script web2py.py and
get it to prompt that it is running a server but I do not know how to
access it and I am under the impression that the web2py.py script is
really made for development not deployment of websites.
It should be noted that one of the main features I need is automated
database evaluation and manipulation.
Any help is extremely welcomed and I would be most grateful. I am
simply running out of time to be stumped by what is most likely a
simple issue.




[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
On close inspection, web2py_ajax.html is out of date on my test app. I
updated web2py_ajax.html and the test case still doesn't work.


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread RyaneD
Thanks for the responses guys. I read all of chapter 11 and I must say
this is why I feel like really am missing something important in the
grand scheme of things. I simply can not understand what it is I need
to do.

I do not have root access so I can't do anything that requires it or
sudo, so I looked on the SITE5 forums like was suggested and looked
for a django setup thread. I found one and feel like I could follow
its steps but honestly I just don't get what needs to be done for a
web2py website to work and therefor I can not figure out the changes
that need to be made.

I need to use FCGI like Brian pointed out but I don't understand the
contexts.

Is there anyway someone could give me a rudimentary check list of what
needs to be done for a website to work, and perhaps examples or
specific links on how to do each step?

What does a fcgi file need to look like for web2py? What files need to
be directly in the www folder (public_html).

-Ryan

On Dec 4, 1:42 pm, Brian M  wrote:
> Check the site5 forums for hints, it looks like wsgi isn't available
> on the shared hosting plans but fastcgi is. There are some Django how
> to threads you may be able to work off of and combine with what's in
> chapter 11 of the web2py book.
>
> ~Brian
>
> On Dec 3, 11:21 pm, RyaneD  wrote:
>
>
>
>
>
>
>
> > Now I do understand that I am probably asking a very rudimentary
> > question but in the end I need a rudimentary answer that I am just not
> > finding. Or if I am finding I don't know what i am looking at.
>
> > A little background: I have experience in Python and in Web Design,
> > not much in the incorporation of the two which is the main reason I
> > have looked into Web2py. I am needing to build a website that is rich
> > in features that HTML and CSS just can not handle and I need to be
> > able to program it fast. Now I can get Web2py working on my Local
> > computer just fine, no problem. I am even jumping into the actual
> > development rather quickly and easily. The framework is really
> > extremely helpful in the quick implementation of code and I am very
> > grateful that it exists.
>
> > Before I get too far in the programming and development of the site
> > that is needed I needed to make sure that I can get it hosted on the
> > internet and that it will work, and this is where it falls down. I
> > have only ever worked in html, xhtml, css, or javascript when it comes
> > to the internet and I do not understand the intricacies of apache or
> > wsgi or CGI at all. I am currently having a mental block on this area
> > and it is causing me intense frustration.
>
> > Simply put, how do I setup web2py coming from my webhost (in this 
> > casewww.site5.com) I have setup a virtual enviroment and unzipped the
> > source of web2py on the website. I can run the script web2py.py and
> > get it to prompt that it is running a server but I do not know how to
> > access it and I am under the impression that the web2py.py script is
> > really made for development not deployment of websites.
>
> > It should be noted that one of the main features I need is automated
> > database evaluation and manipulation.
>
> > Any help is extremely welcomed and I would be most grateful. I am
> > simply running out of time to be stumped by what is most likely a
> > simple issue.


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
Feel free to send me a packed app to test on my system.

On Dec 4, 3:13 pm, weheh  wrote:
> No. web2py_ajax.html is the original
>
> On Dec 4, 3:59 pm, "mr.freeze"  wrote:
>
> > Strange. Works on my system. Have you modified the ajax function in
> > web2py_ajax.html?
>
> > On Dec 4, 1:56 pm, weheh  wrote:
>
> > > So I tried Nathan's suggested test case above and the return value of
> > > request.vars.junk is always None, regardless of whether the checkbox
> > > is checked or not. I'm not seeing the case where request.vars is empty
> > > when the checkbox is unchecked. In a nutshell, unless I'm doing
> > > something wrong, it's not working. I'm using web2py version 1.89.5.
>
> > > On Dec 4, 2:22 pm, weheh  wrote:
>
> > > > Hi Nathan, thanks for the response. I checked the old threads (like
> > > > this 
> > > > onehttp://groups.google.com/group/web2py/browse_thread/thread/35c5708111...)
> > > > and see this is an old issue. In fact, I complained of this a long
> > > > time ago in a separate post. I'll try your fix and report back.
>
> > > > On Dec 4, 2:14 pm, "mr.freeze"  wrote:
>
> > > > > The var name should just be 'junk' since that is the name of the
> > > > > checkbox. Also, I don't think you should have a closing parenthesis
> > > > > after _id='no_table_junk'. Just a typo? Also, accessing it like
> > > > > request.vars['no_table_junk'] will throw an error. Why not just use
> > > > > request.vars.xxx and check for None? Also, it will not have a value of
> > > > > 'off' when unchecked, request.vars will just be empty. This works for
> > > > > me:
>
> > > > > def checktest():
> > > > >     div=DIV(_id='test')
> > > > >     inp = INPUT(_type='checkbox',
> > > > >                 _name='junk',
> > > > >                 _id='no_table_junk',
> > > > >                 _onclick="ajax('process_checkbox',
> > > > > ['no_table_junk'],':eval');")
> > > > >     return dict(div=div,inp=inp)
>
> > > > > def process_checkbox():
> > > > >   checkbox_results=request.vars.junk
> > > > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > > > On Dec 4, 12:57 pm, weheh  wrote:
>
> > > > > > I have a form with a dummy checkbox:
>
> > > > > > #view
> > > > > > INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
> > > > > >         _onclick="ajax('process_checkbox',
> > > > > > ['no_table_junk'],':eval');")
>
> > > > > > #controller
> > > > > > def process_checkbox():
> > > > > >   checkbox_results=request.vars['no_table_junk']
> > > > > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > > > > Regardless of whether the checkbox is checked or not, the onclick
> > > > > > event passes to the "process_checkbox" routine a
> > > > > > request.vars['no_table_junk'] equal to 'on'. I would have expected 
> > > > > > it
> > > > > > to toggle from "on" to "off" to "on" again as I keep toggling the
> > > > > > checkbox from checked to unchecked.
>
> > > > > > Anybody know what's wrong?
>
>


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
No. web2py_ajax.html is the original

On Dec 4, 3:59 pm, "mr.freeze"  wrote:
> Strange. Works on my system. Have you modified the ajax function in
> web2py_ajax.html?
>
> On Dec 4, 1:56 pm, weheh  wrote:
>
> > So I tried Nathan's suggested test case above and the return value of
> > request.vars.junk is always None, regardless of whether the checkbox
> > is checked or not. I'm not seeing the case where request.vars is empty
> > when the checkbox is unchecked. In a nutshell, unless I'm doing
> > something wrong, it's not working. I'm using web2py version 1.89.5.
>
> > On Dec 4, 2:22 pm, weheh  wrote:
>
> > > Hi Nathan, thanks for the response. I checked the old threads (like
> > > this 
> > > onehttp://groups.google.com/group/web2py/browse_thread/thread/35c5708111...)
> > > and see this is an old issue. In fact, I complained of this a long
> > > time ago in a separate post. I'll try your fix and report back.
>
> > > On Dec 4, 2:14 pm, "mr.freeze"  wrote:
>
> > > > The var name should just be 'junk' since that is the name of the
> > > > checkbox. Also, I don't think you should have a closing parenthesis
> > > > after _id='no_table_junk'. Just a typo? Also, accessing it like
> > > > request.vars['no_table_junk'] will throw an error. Why not just use
> > > > request.vars.xxx and check for None? Also, it will not have a value of
> > > > 'off' when unchecked, request.vars will just be empty. This works for
> > > > me:
>
> > > > def checktest():
> > > >     div=DIV(_id='test')
> > > >     inp = INPUT(_type='checkbox',
> > > >                 _name='junk',
> > > >                 _id='no_table_junk',
> > > >                 _onclick="ajax('process_checkbox',
> > > > ['no_table_junk'],':eval');")
> > > >     return dict(div=div,inp=inp)
>
> > > > def process_checkbox():
> > > >   checkbox_results=request.vars.junk
> > > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > > On Dec 4, 12:57 pm, weheh  wrote:
>
> > > > > I have a form with a dummy checkbox:
>
> > > > > #view
> > > > > INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
> > > > >         _onclick="ajax('process_checkbox',
> > > > > ['no_table_junk'],':eval');")
>
> > > > > #controller
> > > > > def process_checkbox():
> > > > >   checkbox_results=request.vars['no_table_junk']
> > > > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > > > Regardless of whether the checkbox is checked or not, the onclick
> > > > > event passes to the "process_checkbox" routine a
> > > > > request.vars['no_table_junk'] equal to 'on'. I would have expected it
> > > > > to toggle from "on" to "off" to "on" again as I keep toggling the
> > > > > checkbox from checked to unchecked.
>
> > > > > Anybody know what's wrong?
>
>


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
Strange. Works on my system. Have you modified the ajax function in
web2py_ajax.html?

On Dec 4, 1:56 pm, weheh  wrote:
> So I tried Nathan's suggested test case above and the return value of
> request.vars.junk is always None, regardless of whether the checkbox
> is checked or not. I'm not seeing the case where request.vars is empty
> when the checkbox is unchecked. In a nutshell, unless I'm doing
> something wrong, it's not working. I'm using web2py version 1.89.5.
>
> On Dec 4, 2:22 pm, weheh  wrote:
>
> > Hi Nathan, thanks for the response. I checked the old threads (like
> > this 
> > onehttp://groups.google.com/group/web2py/browse_thread/thread/35c5708111...)
> > and see this is an old issue. In fact, I complained of this a long
> > time ago in a separate post. I'll try your fix and report back.
>
> > On Dec 4, 2:14 pm, "mr.freeze"  wrote:
>
> > > The var name should just be 'junk' since that is the name of the
> > > checkbox. Also, I don't think you should have a closing parenthesis
> > > after _id='no_table_junk'. Just a typo? Also, accessing it like
> > > request.vars['no_table_junk'] will throw an error. Why not just use
> > > request.vars.xxx and check for None? Also, it will not have a value of
> > > 'off' when unchecked, request.vars will just be empty. This works for
> > > me:
>
> > > def checktest():
> > >     div=DIV(_id='test')
> > >     inp = INPUT(_type='checkbox',
> > >                 _name='junk',
> > >                 _id='no_table_junk',
> > >                 _onclick="ajax('process_checkbox',
> > > ['no_table_junk'],':eval');")
> > >     return dict(div=div,inp=inp)
>
> > > def process_checkbox():
> > >   checkbox_results=request.vars.junk
> > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > On Dec 4, 12:57 pm, weheh  wrote:
>
> > > > I have a form with a dummy checkbox:
>
> > > > #view
> > > > INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
> > > >         _onclick="ajax('process_checkbox',
> > > > ['no_table_junk'],':eval');")
>
> > > > #controller
> > > > def process_checkbox():
> > > >   checkbox_results=request.vars['no_table_junk']
> > > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > > Regardless of whether the checkbox is checked or not, the onclick
> > > > event passes to the "process_checkbox" routine a
> > > > request.vars['no_table_junk'] equal to 'on'. I would have expected it
> > > > to toggle from "on" to "off" to "on" again as I keep toggling the
> > > > checkbox from checked to unchecked.
>
> > > > Anybody know what's wrong?
>
>


Re: [web2py] Re: minimal setup on Debian for using Mail()

2010-12-04 Thread Miguel Lopes
Hi Bernado,

2010/12/4 Bernardo Botella Corbí 

> Hi Miguel,
>
> which test did you do from command line?
> does web2py print something? Any error?
>
> Try to do the next thing from the command line:
> tail -f /var/log/mail.log
>

If I try to send mail from web2py using local resources it fails silently.
I can use a gmail account to send the email it works, so perhaps I'm
configuring gluon.tools.Mail wrongly:
mail.settings.server = 'myIP:25'# your SMTP
server
mail.settings.sender = 'u...@mydomain.pt' # your email
mail.settings.login = 'user:pass'   # your
credentials or None 'username:password'

I'm unsure about mails.settings.server. Is this correct?


> (if you are in ubuntu/debian, don't know where it would be in other
> distributions...)
>
> I'm using Debian Lenny.

txs,
Miguel


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
So I tried Nathan's suggested test case above and the return value of
request.vars.junk is always None, regardless of whether the checkbox
is checked or not. I'm not seeing the case where request.vars is empty
when the checkbox is unchecked. In a nutshell, unless I'm doing
something wrong, it's not working. I'm using web2py version 1.89.5.

On Dec 4, 2:22 pm, weheh  wrote:
> Hi Nathan, thanks for the response. I checked the old threads (like
> this 
> onehttp://groups.google.com/group/web2py/browse_thread/thread/35c5708111...)
> and see this is an old issue. In fact, I complained of this a long
> time ago in a separate post. I'll try your fix and report back.
>
> On Dec 4, 2:14 pm, "mr.freeze"  wrote:
>
> > The var name should just be 'junk' since that is the name of the
> > checkbox. Also, I don't think you should have a closing parenthesis
> > after _id='no_table_junk'. Just a typo? Also, accessing it like
> > request.vars['no_table_junk'] will throw an error. Why not just use
> > request.vars.xxx and check for None? Also, it will not have a value of
> > 'off' when unchecked, request.vars will just be empty. This works for
> > me:
>
> > def checktest():
> >     div=DIV(_id='test')
> >     inp = INPUT(_type='checkbox',
> >                 _name='junk',
> >                 _id='no_table_junk',
> >                 _onclick="ajax('process_checkbox',
> > ['no_table_junk'],':eval');")
> >     return dict(div=div,inp=inp)
>
> > def process_checkbox():
> >   checkbox_results=request.vars.junk
> >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > On Dec 4, 12:57 pm, weheh  wrote:
>
> > > I have a form with a dummy checkbox:
>
> > > #view
> > > INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
> > >         _onclick="ajax('process_checkbox',
> > > ['no_table_junk'],':eval');")
>
> > > #controller
> > > def process_checkbox():
> > >   checkbox_results=request.vars['no_table_junk']
> > >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > > Regardless of whether the checkbox is checked or not, the onclick
> > > event passes to the "process_checkbox" routine a
> > > request.vars['no_table_junk'] equal to 'on'. I would have expected it
> > > to toggle from "on" to "off" to "on" again as I keep toggling the
> > > checkbox from checked to unchecked.
>
> > > Anybody know what's wrong?
>
>


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
Hi Nathan, thanks for the response. I checked the old threads (like
this one
http://groups.google.com/group/web2py/browse_thread/thread/35c5708111d173ae/7d12923e4643a3ed?lnk=gst&q=ajax+checkbox#7d12923e4643a3ed)
and see this is an old issue. In fact, I complained of this a long
time ago in a separate post. I'll try your fix and report back.

On Dec 4, 2:14 pm, "mr.freeze"  wrote:
> The var name should just be 'junk' since that is the name of the
> checkbox. Also, I don't think you should have a closing parenthesis
> after _id='no_table_junk'. Just a typo? Also, accessing it like
> request.vars['no_table_junk'] will throw an error. Why not just use
> request.vars.xxx and check for None? Also, it will not have a value of
> 'off' when unchecked, request.vars will just be empty. This works for
> me:
>
> def checktest():
>     div=DIV(_id='test')
>     inp = INPUT(_type='checkbox',
>                 _name='junk',
>                 _id='no_table_junk',
>                 _onclick="ajax('process_checkbox',
> ['no_table_junk'],':eval');")
>     return dict(div=div,inp=inp)
>
> def process_checkbox():
>   checkbox_results=request.vars.junk
>   return """jQuery("#test").html("%s");""" % checkbox_results
>
> On Dec 4, 12:57 pm, weheh  wrote:
>
> > I have a form with a dummy checkbox:
>
> > #view
> > INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
> >         _onclick="ajax('process_checkbox',
> > ['no_table_junk'],':eval');")
>
> > #controller
> > def process_checkbox():
> >   checkbox_results=request.vars['no_table_junk']
> >   return """jQuery("#test").html("%s");""" % checkbox_results
>
> > Regardless of whether the checkbox is checked or not, the onclick
> > event passes to the "process_checkbox" routine a
> > request.vars['no_table_junk'] equal to 'on'. I would have expected it
> > to toggle from "on" to "off" to "on" again as I keep toggling the
> > checkbox from checked to unchecked.
>
> > Anybody know what's wrong?
>
>


[web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread mr.freeze
The var name should just be 'junk' since that is the name of the
checkbox. Also, I don't think you should have a closing parenthesis
after _id='no_table_junk'. Just a typo? Also, accessing it like
request.vars['no_table_junk'] will throw an error. Why not just use
request.vars.xxx and check for None? Also, it will not have a value of
'off' when unchecked, request.vars will just be empty. This works for
me:

def checktest():
div=DIV(_id='test')
inp = INPUT(_type='checkbox',
_name='junk',
_id='no_table_junk',
_onclick="ajax('process_checkbox',
['no_table_junk'],':eval');")
return dict(div=div,inp=inp)

def process_checkbox():
  checkbox_results=request.vars.junk
  return """jQuery("#test").html("%s");""" % checkbox_results




On Dec 4, 12:57 pm, weheh  wrote:
> I have a form with a dummy checkbox:
>
> #view
> INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
>         _onclick="ajax('process_checkbox',
> ['no_table_junk'],':eval');")
>
> #controller
> def process_checkbox():
>   checkbox_results=request.vars['no_table_junk']
>   return """jQuery("#test").html("%s");""" % checkbox_results
>
> Regardless of whether the checkbox is checked or not, the onclick
> event passes to the "process_checkbox" routine a
> request.vars['no_table_junk'] equal to 'on'. I would have expected it
> to toggle from "on" to "off" to "on" again as I keep toggling the
> checkbox from checked to unchecked.
>
> Anybody know what's wrong?


[web2py] Re: web2py installer broken

2010-12-04 Thread weheh
Too late, I think. I already installed from the manual download and it
worked fine. Sorry, I'm in major development mode and didn't think
about stopping to debug.

On Dec 4, 2:09 pm, Jonathan Lundell  wrote:
> On Dec 4, 2010, at 11:06 AM, weheh wrote:
>
>
>
> > I just did an install using the auto-installer feature from the site
> > admin page and it didn't work. Now, my web2py is corrupted and I have
> > to download manually.
>
> If it's not too late, it might be useful to preserve a copy of the corrupt 
> tree, and see how it differs from the re-install.


Re: [web2py] web2py installer broken

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 11:06 AM, weheh wrote:
> 
> I just did an install using the auto-installer feature from the site
> admin page and it didn't work. Now, my web2py is corrupted and I have
> to download manually.

If it's not too late, it might be useful to preserve a copy of the corrupt 
tree, and see how it differs from the re-install.

Re: [web2py] Re: new in trunk signed URLS

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 10:29 AM, Brian M wrote:
> 
> Jonathan,
> 
> How would you like to see this behave? Perhaps URL('index',args=[],
> vars={}, hash_key='xxx', hash=['args','vars']) and then
> URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could
> choose which portions of the URL to sign and/or verify with hash=None
> triggering the original behavior of hashing both? Since this hasn't
> made it into a stable release yet I assume changes can be made still
> without worrying about breaking backwards compatibility.

That would work. I'm not sure if it needs to be that general; is there a use 
case for hashing vars but not args? If not, then a boolean would be adequate 
(hash_vars=True by default; the caller sets it False if desired).

Another generalization would be to pass a set of var keys to be included in the 
hash: hash_vars=set('name1', 'name2'). The use case would be a form, again (or 
Ajax, perhaps), where the included vars would be page state kept in hidden or 
read-only elements of the form.

So: hash_vars=True  (default; hash all vars)
hash_vars=False (don't hash any vars)
hash_vars=set(...)  (hash only the vars named in the set)

The set needn't be a set per se, I suppose. Any iterable (well, not a string) 
would suffice.

> 
> ~Brian
> 
> On Dec 3, 11:13 am, Jonathan Lundell  wrote:
>> On Dec 3, 2010, at 9:01 AM, mdipierro wrote:
>> 
>> 
>> 
>>> New feature in trunk:
>> 
>>> URL('index',args=[],vars={},hash_key='xxx')
>> 
>>> the URL will have a _signature attached. The associated controller can
>>> check for the signature with
>> 
>>> def index():
>>> if not URL.verify(hmac_key='xxx'): ..
>>> ...
>> 
>>> Please test it. In particular we need to test the workflow and see if
>>> we are missing something useful or doing something wrong.
>> 
>> Perhaps there should be an option to exclude the query string from the hash 
>> calculation. Otherwise we can't sign URLs that are form actions (or that are 
>> similarly used with Ajax).




[web2py] web2py installer broken

2010-12-04 Thread weheh
I just did an install using the auto-installer feature from the site
admin page and it didn't work. Now, my web2py is corrupted and I have
to download manually.


[web2py] Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread weheh
I have a form with a dummy checkbox:

#view
INPUT(_type='checkbox',_name='junk',_id='no_table_junk'),
_onclick="ajax('process_checkbox',
['no_table_junk'],':eval');")

#controller
def process_checkbox():
  checkbox_results=request.vars['no_table_junk']
  return """jQuery("#test").html("%s");""" % checkbox_results

Regardless of whether the checkbox is checked or not, the onclick
event passes to the "process_checkbox" routine a
request.vars['no_table_junk'] equal to 'on'. I would have expected it
to toggle from "on" to "off" to "on" again as I keep toggling the
checkbox from checked to unchecked.

Anybody know what's wrong?


[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Brian M
Check the site5 forums for hints, it looks like wsgi isn't available
on the shared hosting plans but fastcgi is. There are some Django how
to threads you may be able to work off of and combine with what's in
chapter 11 of the web2py book.

~Brian

On Dec 3, 11:21 pm, RyaneD  wrote:
> Now I do understand that I am probably asking a very rudimentary
> question but in the end I need a rudimentary answer that I am just not
> finding. Or if I am finding I don't know what i am looking at.
>
> A little background: I have experience in Python and in Web Design,
> not much in the incorporation of the two which is the main reason I
> have looked into Web2py. I am needing to build a website that is rich
> in features that HTML and CSS just can not handle and I need to be
> able to program it fast. Now I can get Web2py working on my Local
> computer just fine, no problem. I am even jumping into the actual
> development rather quickly and easily. The framework is really
> extremely helpful in the quick implementation of code and I am very
> grateful that it exists.
>
> Before I get too far in the programming and development of the site
> that is needed I needed to make sure that I can get it hosted on the
> internet and that it will work, and this is where it falls down. I
> have only ever worked in html, xhtml, css, or javascript when it comes
> to the internet and I do not understand the intricacies of apache or
> wsgi or CGI at all. I am currently having a mental block on this area
> and it is causing me intense frustration.
>
> Simply put, how do I setup web2py coming from my webhost (in this 
> casewww.site5.com) I have setup a virtual enviroment and unzipped the
> source of web2py on the website. I can run the script web2py.py and
> get it to prompt that it is running a server but I do not know how to
> access it and I am under the impression that the web2py.py script is
> really made for development not deployment of websites.
>
> It should be noted that one of the main features I need is automated
> database evaluation and manipulation.
>
> Any help is extremely welcomed and I would be most grateful. I am
> simply running out of time to be stumped by what is most likely a
> simple issue.


[web2py] Re: new dal

2010-12-04 Thread ron_m
Sorry should have mentioned that was in the welcome app fetching the
index page as the default browser load occured fomr the TK server
interface. In my own application I get

Traceback (most recent call last):
  File "/home/camcentral/Dev/web2py_hg/gluon/restricted.py", line 188,
in restricted
exec ccode in environment
  File "/home/camcentral/Dev/web2py_hg/applications/ccims/models/
A_db.py", line 19, in 
db = DAL('postgres://ccims:oss3...@localhost/cc_ims') # CamCentral
IMS configuration database
  File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 2408, in
__init__
raise RuntimeError, "Failure to connect, tried 5 times"
RuntimeError: Failure to connect, tried 5 times

Maybe I did something wrong getting dal.py activated?

On Dec 4, 10:31 am, ron_m  wrote:
> Describe what I did
>
> Copied the trunk hg area to a work area
> Renamed sql.py to sql-save.py
> Copied dal.py to sql.py in order to replace sql.py with dal.py
> Copied application I am working on to applications directory
> Backed up the database
> Ran the server as python web2py.py
>
> Got this stack trace
> Traceback (most recent call last):
>   File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
> wsgibase
>     BaseAdapter.close_all_instances(BaseAdapter.commit)
>   File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
> close_all_instances
>     if instance._pool_size:
> AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
> I don't use SQLite as a database but the driver exists through default
> install, the db line invoking SQLite is commented out.


[web2py] Re: new dal

2010-12-04 Thread ron_m
Describe what I did

Copied the trunk hg area to a work area
Renamed sql.py to sql-save.py
Copied dal.py to sql.py in order to replace sql.py with dal.py
Copied application I am working on to applications directory
Backed up the database
Ran the server as python web2py.py

Got this stack trace
Traceback (most recent call last):
  File "/home/camcentral/Dev/web2py_hg/gluon/main.py", line 446, in
wsgibase
BaseAdapter.close_all_instances(BaseAdapter.commit)
  File "/home/camcentral/Dev/web2py_hg/gluon/sql.py", line 161, in
close_all_instances
if instance._pool_size:
AttributeError: 'SQLiteAdapter' object has no attribute '_pool_size'
I don't use SQLite as a database but the driver exists through default
install, the db line invoking SQLite is commented out.





[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
Jonathan,

How would you like to see this behave? Perhaps URL('index',args=[],
vars={}, hash_key='xxx', hash=['args','vars']) and then
URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could
choose which portions of the URL to sign and/or verify with hash=None
triggering the original behavior of hashing both? Since this hasn't
made it into a stable release yet I assume changes can be made still
without worrying about breaking backwards compatibility.

~Brian

On Dec 3, 11:13 am, Jonathan Lundell  wrote:
> On Dec 3, 2010, at 9:01 AM, mdipierro wrote:
>
>
>
> > New feature in trunk:
>
> > URL('index',args=[],vars={},hash_key='xxx')
>
> > the URL will have a _signature attached. The associated controller can
> > check for the signature with
>
> > def index():
> >     if not URL.verify(hmac_key='xxx'): ..
> >     ...
>
> > Please test it. In particular we need to test the workflow and see if
> > we are missing something useful or doing something wrong.
>
> Perhaps there should be an option to exclude the query string from the hash 
> calculation. Otherwise we can't sign URLs that are form actions (or that are 
> similarly used with Ajax).


[web2py] new dal

2010-12-04 Thread mdipierro
The good news...

I have finished the new DAL for RDBMs. If you now replace gluon/sql.py
with gluon/dal.py as long as you do not use GAE, everything should
work fine. All tests pass.

The new dal should have all the features as the old dal but no more.
It just comes with a better more modular design that will allow adding
new features.

It defines the following classes:

class ConnectionPool(object):
class BaseAdapter(ConnectionPool):

# adapters
class SQLiteAdapter(BaseAdapter):
class JDBCSQLiteAdapter(SQLiteAdapter):
class MySQLAdapter(BaseAdapter):
class PostgreSQLAdapter(BaseAdapter):
class JDBCPostgreSQLAdapter(PostgreSQLAdapter):
class OracleAdapter(BaseAdapter):
class MSSQLAdapter(BaseAdapter):
class MSSQLAdapter2(MSSQLAdapter):
class FireBirdAdapter(BaseAdapter):
class FireBirdEmbeddedAdapter(FireBirdAdapter):
class InformixAdapter(BaseAdapter):
class DB2Adapter(BaseAdapter):
class IngresAdapter(BaseAdapter):
class IngresUnicodeAdapter(IngresAdapter):

# exposed by DAL
class Row(dict):
class SQLCallableList(list):
class DAL(dict):
class SQLALL(object):
class Reference(int):
class Table(dict):
class Expression(object):
class SQLCustomType:
class Field(Expression):
class Query(object):
class Set(object):
class Rows(object):

TODO:

1)
test dal.py
test dal.py
test dal.py

2)
break gluon/dal.py into
   gluon/dal/__init__.py
   gluon/dal/pooling.py
   gluon/dal/adapter_base.py
   gluon/dal/adapter_*.py

3)
reimplement gluon/contrib/gql.py as
   gluon/dal/adapter_nosql.py
   gluon/dal/adapter_gae.py

4)
implement
   gluon/dal/adapter_mongodb.py
   etc.

Can you help with 1) and 2)?

Massimo


[web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread weheh
I wasn't timing, but felt like between 5 & 10 sec.
Thanks for the break.

On Dec 4, 9:08 am, Branko Vukelic  wrote:
> On Sat, Dec 4, 2010 at 2:50 PM, villas  wrote:
> > Who can propose minimum lines to re-factor Massimo's code?
> > Of course two lines to be included somewhere must be:
> > x=[(2,3,10),(7,2,63),(6,5,66),(8,4,96)]
> > a,b = 9,7
>
> > Please first state your number of lines and then be prepared to
> > release your code as open source later :)
> > You have to beat my 9 lines so far!
>
> Something here reminds me of that "I just need a programmer" thread.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Deploying a site powered by web2py.

2010-12-04 Thread Albert Abril
I think deployment of web2py is one of the easiest of all the python
frameworks.
I found a lot of difficulties with Django. Maybe was my fault, but in web2py
was a lot easier.

Read Chapter 11 as Kenneth said.

2010/12/4 Kenneth Lundström 

> Hello,
>
> have you read the web2py book, specifically chapter 11,
> http://web2py.com/book/default/chapter/11 it should tell the most.
>
> If you still have questions will try to answer them.
>
>
> Kenneth
>
>
>  Now I do understand that I am probably asking a very rudimentary
>> question but in the end I need a rudimentary answer that I am just not
>> finding. Or if I am finding I don't know what i am looking at.
>>
>> A little background: I have experience in Python and in Web Design,
>> not much in the incorporation of the two which is the main reason I
>> have looked into Web2py. I am needing to build a website that is rich
>> in features that HTML and CSS just can not handle and I need to be
>> able to program it fast. Now I can get Web2py working on my Local
>> computer just fine, no problem. I am even jumping into the actual
>> development rather quickly and easily. The framework is really
>> extremely helpful in the quick implementation of code and I am very
>> grateful that it exists.
>>
>> Before I get too far in the programming and development of the site
>> that is needed I needed to make sure that I can get it hosted on the
>> internet and that it will work, and this is where it falls down. I
>> have only ever worked in html, xhtml, css, or javascript when it comes
>> to the internet and I do not understand the intricacies of apache or
>> wsgi or CGI at all. I am currently having a mental block on this area
>> and it is causing me intense frustration.
>>
>> Simply put, how do I setup web2py coming from my webhost (in this case
>> www.site5.com) I have setup a virtual enviroment and unzipped the
>> source of web2py on the website. I can run the script web2py.py and
>> get it to prompt that it is running a server but I do not know how to
>> access it and I am under the impression that the web2py.py script is
>> really made for development not deployment of websites.
>>
>> It should be noted that one of the main features I need is automated
>> database evaluation and manipulation.
>>
>> Any help is extremely welcomed and I would be most grateful. I am
>> simply running out of time to be stumped by what is most likely a
>> simple issue.
>>
>
>


[web2py] Timepicker

2010-12-04 Thread Branko Vukelic
Since we've discussed the topic of timepickers before, I've just
stumbled upon a very good solution from the Dojo camp. Here's a demo.

http://www-01.ibm.com/software/ucd/UE/dijit/tests/form/test_TimeTextBox.html?theme=claro

Except for the minor visual noise in the form of emphasized hundred
hours spots, I think it's overall a great solution. Of course, it's a
Dojo widget, so it would have to be ported to jQuery, although I
personally find Dojo much more pleasant than jQuery.

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: "I Just Need a Programmer"

2010-12-04 Thread Branko Vukelic
Nothing that can be talked about without braking the NDA, I'm afraid. :)

On Sat, Dec 4, 2010 at 1:29 PM, ma...@rockiger.com
 wrote:
> By the way, any interesting business ideas here in the web2py-world?
>
> Marco
>
> On 3 Dez., 15:46, mdipierro  wrote:
>> I do not think there is a lack of ideas not a lack of execution
>> capabilities. The problem is that the more interesting projects
>> require a critical mass of users to start. Think about this... you
>> walk by a restaurant and it is empty. It does not matter how good the
>> restaurant look and how attractive the menu looks. If it is empty you
>> do not go in.
>>
>> Same with software project. You need to buy your critical mass of
>> users. The more ambitious, the larger the critical mass. If you start
>> too small and takes too long to grow, please will copy your project.
>> Buying users cost money. Companies buy each other mostly because they
>> want to buy theirs clients, not the technologies or the ideas. The
>> want to sell their own ideas and technologies to the clients of the
>> acquired company.
>>
>> Massimo
>>
>> On Dec 3, 2:20 pm, Branko Vukelic  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > I think it's the same with designers, actually, and they are
>> > _expected_ to be creative. But once you're in the industry, so little
>> > of it is actually demanded.
>>
>> > On Fri, Dec 3, 2010 at 6:54 PM, Jason Brower  wrote:
>>
>> > > Personally, I see the other way.  So many programmers, so little 
>> > > creativity.
>>
>> > > On Thu, 2010-12-02 at 19:14 -0800, mdipierro wrote:
>>
>> > >http://www.cs.uni.edu/~wallingf/blog/archives/monthly/2010-12.html#e2...
>>
>> > --
>> > Branko Vukelić
>>
>> > bg.bra...@gmail.com
>> > stu...@brankovukelic.com
>>
>> > Check out my blog:http://www.brankovukelic.com/
>> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>> > Registered Linux user #438078 (http://counter.li.org/)
>> > I hang out on identi.ca:http://identi.ca/foxbunny
>>
>> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread Branko Vukelic
On Sat, Dec 4, 2010 at 2:50 PM, villas  wrote:
> Who can propose minimum lines to re-factor Massimo's code?
> Of course two lines to be included somewhere must be:
> x=[(2,3,10),(7,2,63),(6,5,66),(8,4,96)]
> a,b = 9,7
>
> Please first state your number of lines and then be prepared to
> release your code as open source later :)
> You have to beat my 9 lines so far!

Something here reminds me of that "I just need a programmer" thread.


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Time to relax, off topic - Simple IQ Testing.

2010-12-04 Thread villas
> I am too dumb to solve it but this program can:

M, that program was dumb -- call yourself a programmer! :)
However, my first effort to re-factor the code still took 9 lines!

IQ Test #2
--
Who can propose minimum lines to re-factor Massimo's code?
Of course two lines to be included somewhere must be:
x=[(2,3,10),(7,2,63),(6,5,66),(8,4,96)]
a,b = 9,7

Please first state your number of lines and then be prepared to
release your code as open source later :)
You have to beat my 9 lines so far!


[web2py] Re: "I Just Need a Programmer"

2010-12-04 Thread ma...@rockiger.com
By the way, any interesting business ideas here in the web2py-world?

Marco

On 3 Dez., 15:46, mdipierro  wrote:
> I do not think there is a lack of ideas not a lack of execution
> capabilities. The problem is that the more interesting projects
> require a critical mass of users to start. Think about this... you
> walk by a restaurant and it is empty. It does not matter how good the
> restaurant look and how attractive the menu looks. If it is empty you
> do not go in.
>
> Same with software project. You need to buy your critical mass of
> users. The more ambitious, the larger the critical mass. If you start
> too small and takes too long to grow, please will copy your project.
> Buying users cost money. Companies buy each other mostly because they
> want to buy theirs clients, not the technologies or the ideas. The
> want to sell their own ideas and technologies to the clients of the
> acquired company.
>
> Massimo
>
> On Dec 3, 2:20 pm, Branko Vukelic  wrote:
>
>
>
>
>
>
>
> > I think it's the same with designers, actually, and they are
> > _expected_ to be creative. But once you're in the industry, so little
> > of it is actually demanded.
>
> > On Fri, Dec 3, 2010 at 6:54 PM, Jason Brower  wrote:
>
> > > Personally, I see the other way.  So many programmers, so little 
> > > creativity.
>
> > > On Thu, 2010-12-02 at 19:14 -0800, mdipierro wrote:
>
> > >http://www.cs.uni.edu/~wallingf/blog/archives/monthly/2010-12.html#e2...
>
> > --
> > Branko Vukelić
>
> > bg.bra...@gmail.com
> > stu...@brankovukelic.com
>
> > Check out my blog:http://www.brankovukelic.com/
> > Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> > Registered Linux user #438078 (http://counter.li.org/)
> > I hang out on identi.ca:http://identi.ca/foxbunny
>
> > Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Deploying a site powered by web2py.

2010-12-04 Thread Kenneth Lundström

Hello,

have you read the web2py book, specifically chapter 11, 
http://web2py.com/book/default/chapter/11 it should tell the most.


If you still have questions will try to answer them.


Kenneth


Now I do understand that I am probably asking a very rudimentary
question but in the end I need a rudimentary answer that I am just not
finding. Or if I am finding I don't know what i am looking at.

A little background: I have experience in Python and in Web Design,
not much in the incorporation of the two which is the main reason I
have looked into Web2py. I am needing to build a website that is rich
in features that HTML and CSS just can not handle and I need to be
able to program it fast. Now I can get Web2py working on my Local
computer just fine, no problem. I am even jumping into the actual
development rather quickly and easily. The framework is really
extremely helpful in the quick implementation of code and I am very
grateful that it exists.

Before I get too far in the programming and development of the site
that is needed I needed to make sure that I can get it hosted on the
internet and that it will work, and this is where it falls down. I
have only ever worked in html, xhtml, css, or javascript when it comes
to the internet and I do not understand the intricacies of apache or
wsgi or CGI at all. I am currently having a mental block on this area
and it is causing me intense frustration.

Simply put, how do I setup web2py coming from my webhost (in this case
www.site5.com) I have setup a virtual enviroment and unzipped the
source of web2py on the website. I can run the script web2py.py and
get it to prompt that it is running a server but I do not know how to
access it and I am under the impression that the web2py.py script is
really made for development not deployment of websites.

It should be noted that one of the main features I need is automated
database evaluation and manipulation.

Any help is extremely welcomed and I would be most grateful. I am
simply running out of time to be stumped by what is most likely a
simple issue.




[web2py] Deploying a site powered by web2py.

2010-12-04 Thread RyaneD
Now I do understand that I am probably asking a very rudimentary
question but in the end I need a rudimentary answer that I am just not
finding. Or if I am finding I don't know what i am looking at.

A little background: I have experience in Python and in Web Design,
not much in the incorporation of the two which is the main reason I
have looked into Web2py. I am needing to build a website that is rich
in features that HTML and CSS just can not handle and I need to be
able to program it fast. Now I can get Web2py working on my Local
computer just fine, no problem. I am even jumping into the actual
development rather quickly and easily. The framework is really
extremely helpful in the quick implementation of code and I am very
grateful that it exists.

Before I get too far in the programming and development of the site
that is needed I needed to make sure that I can get it hosted on the
internet and that it will work, and this is where it falls down. I
have only ever worked in html, xhtml, css, or javascript when it comes
to the internet and I do not understand the intricacies of apache or
wsgi or CGI at all. I am currently having a mental block on this area
and it is causing me intense frustration.

Simply put, how do I setup web2py coming from my webhost (in this case
www.site5.com) I have setup a virtual enviroment and unzipped the
source of web2py on the website. I can run the script web2py.py and
get it to prompt that it is running a server but I do not know how to
access it and I am under the impression that the web2py.py script is
really made for development not deployment of websites.

It should be noted that one of the main features I need is automated
database evaluation and manipulation.

Any help is extremely welcomed and I would be most grateful. I am
simply running out of time to be stumped by what is most likely a
simple issue.


Re: [web2py] Re: minimal setup on Debian for using Mail()

2010-12-04 Thread Bernardo Botella Corbí
Hi Miguel,

which test did you do from command line?
does web2py print something? Any error?

Try to do the next thing from the command line:
tail -f /var/log/mail.log

(if you are in ubuntu/debian, don't know where it would be in other
distributions...)

and see if it complaints about anything when trying to send a mail from
web2py.

Bernardo

2010/12/4 Miguel Lopes 

>
>
> On Sat, Dec 4, 2010 at 1:12 AM, mdipierro  wrote:
>
>> did you apt-get install portfix?
>>
>> Do you mean postfix? No I didn't.
>
> By the way, tp be precise in the config I'm using:
> mail.settings.server = 'myIPaddress:25'  # your
> SMTPserver
>
> since sendmail uses port 25 by default.
> Miguel
>
>
>
>>
>> On Dec 3, 6:36 pm, Miguel Lopes  wrote:
>> > I'm having problems trying to make gluon.tools.Mail work on a vps, and
>> > wonder if anyone knows what would be a minimal setup for sending mail.
>> > I just need to send the an occasional mail. The server as sendmail
>> working,
>> > which I've confirmed in the command line. However, I'm unable to make it
>> > work via web2py.
>> > My model file reads:
>> >
>> > mail.settings.server = 'localhost'  # your
>> SMTP
>> > server
>> > mail.settings.sender = 'r...@mydomain.pt' # your email
>> > #mail.settings.login = ''#
>> your
>> > credentials or None 'username:password'
>> >
>> > I confess being a complete n00b regarding linux admin.
>> > Is sendmail enough? What could I be missing?
>> > Miguel
>>
>
>