[web2py] Which checker (PyChecker, Lint, PyFlakes, ...?) is good for using with web2py projects, and how?

2012-06-07 Thread nick name
What works?
What doesn't work?
What are the pitfalls?

Do you need to write any "if 0: import ..." statements to make it recognize 
the functions?

Thanks in advance.


[web2py] Re: [web2py:34669] Re: Does your Response Flash get in the way?

2012-06-07 Thread Annet
I have been struggling with the flash messages as well. At the moment I 
have a separate view flash.html:

{{if response.flash:}}
  
x
{{=response.flash}}
   
{{pass}}

In this view I use Bootstrap's alerts to style the flash messages. 
'alert-info' is the one I use most, in case I need another alert set it in 
the function:

def index():
...
if form.process().accepted:
...
alert='alert-success'
elif form.errors:
alert='alert-error'
else:
...
   return dict(alert=alert, ...)

In my views I simply include {{include 'flash.html'}}

This works for now, to come up with a more sophisticated way to set the 
alerts is on my to do list.


Annet



[web2py] Re: [web2py:34669] Re: Does your Response Flash get in the way?

2012-06-07 Thread pbreit
It's controlled with CSS in the web2py.css file. Look for "div.flash".

With the new bootstrap support, I put this in my layout.html:

{{if response.flash:}}

  ×
  {{=response.flash}}

{{pass}}

Right below: 


On Thursday, June 7, 2012 9:46:06 PM UTC-7, Janath wrote:
>
> How can I change the location of response.flash. It overlaps with my menu 
> items...
>
> Thank you,
> Janath
>
> On Thursday, November 5, 2009 1:16:41 PM UTC-6, Jonathan Lundell wrote:
>>
>> On Nov 5, 2009, at 8:52 AM, Thadeus Burgess wrote:
>>
>> Instead of putting a timer on response.flash, I moved its location to 
>> another location on the site that does conflict with any text.
>>
>>
>> I like Gmail's approach to flash messages. They're not obtrusive, but 
>> they're still prominent enough to be noticed. And because they're 
>> relatively small, Google can reserve a portion of the page for them (which 
>> is otherwise white space), with the result that showing a flash message 
>> doesn't obscure other content, nor does it change the page layout. 
>>
>> When I first registered at web2pyslices, I found the fade-out flash 
>> somewhat unhelpful, in that I didn't notice it until it was too late.
>>
>> OTOH, web2pyslices has a dedicated area in the UI header for the flash 
>> message, which is nice.
>>
>> Another thing I'd look at is to use color in the flash messages to 
>> indicate the message category. Notices of failed operations should look 
>> different from the routine "welcome back" message, IMO.
>>
>>
>> -Thadeus
>>
>>
>>
>>
>> On Thu, Nov 5, 2009 at 1:08 AM, Sebastian Brandt wrote:
>>
>>>
>>> Thnaks Russel for pointing that out. I think this is very nice.
>>> Of course the message will be unread if the user is distracted, but
>>> after the message is generated after user input in most cases I guess,
>>> that should be no problem in my opinion.
>>>
>>> Sebastian
>>>
>>> On 5 Nov., 05:43, mdipierro  wrote:
>>> > The problem with that is that if the user is distracted, the message
>>> > fades out before he/she can read it.
>>> >
>>> > On Nov 4, 4:48 pm, Russell  wrote:
>>> >
>>> > > Hi there,
>>> >
>>> > > A mild annoyance: Sometimes the response flash covers other text on
>>> > > the screen and, when you are doing lots of testing, you are
>>> > > continually clicking it to make it go away.
>>> >
>>> > > My suggestion is to replace web2py_ajax.html line 36:
>>> >
>>> > > jQuery('.flash').click(function() { jQuery(this).fadeOut('slow');
>>> > > return false; });
>>> >
>>> > > with:
>>> >
>>> > > jQuery('.flash').hide().fadeIn(2000).animate({opacity: 1.0},
>>> > > 2000).animate({ opacity: 'hide' }, 2000);
>>> >
>>> > > This makes the response.flash fade in and then fade out.  No clicking
>>> > > required.
>>> >
>>> > > Thanks
>>> > > Russell
>>>
>>>
>>
>>
>>
>>
>>

[web2py] Re: [web2py:34669] Re: Does your Response Flash get in the way?

2012-06-07 Thread Janath
How can I change the location of response.flash. It overlaps with my menu 
items...

Thank you,
Janath

On Thursday, November 5, 2009 1:16:41 PM UTC-6, Jonathan Lundell wrote:
>
> On Nov 5, 2009, at 8:52 AM, Thadeus Burgess wrote:
>
> Instead of putting a timer on response.flash, I moved its location to 
> another location on the site that does conflict with any text.
>
>
> I like Gmail's approach to flash messages. They're not obtrusive, but 
> they're still prominent enough to be noticed. And because they're 
> relatively small, Google can reserve a portion of the page for them (which 
> is otherwise white space), with the result that showing a flash message 
> doesn't obscure other content, nor does it change the page layout. 
>
> When I first registered at web2pyslices, I found the fade-out flash 
> somewhat unhelpful, in that I didn't notice it until it was too late.
>
> OTOH, web2pyslices has a dedicated area in the UI header for the flash 
> message, which is nice.
>
> Another thing I'd look at is to use color in the flash messages to 
> indicate the message category. Notices of failed operations should look 
> different from the routine "welcome back" message, IMO.
>
>
> -Thadeus
>
>
>
>
> On Thu, Nov 5, 2009 at 1:08 AM, Sebastian Brandt wrote:
>
>>
>> Thnaks Russel for pointing that out. I think this is very nice.
>> Of course the message will be unread if the user is distracted, but
>> after the message is generated after user input in most cases I guess,
>> that should be no problem in my opinion.
>>
>> Sebastian
>>
>> On 5 Nov., 05:43, mdipierro  wrote:
>> > The problem with that is that if the user is distracted, the message
>> > fades out before he/she can read it.
>> >
>> > On Nov 4, 4:48 pm, Russell  wrote:
>> >
>> > > Hi there,
>> >
>> > > A mild annoyance: Sometimes the response flash covers other text on
>> > > the screen and, when you are doing lots of testing, you are
>> > > continually clicking it to make it go away.
>> >
>> > > My suggestion is to replace web2py_ajax.html line 36:
>> >
>> > > jQuery('.flash').click(function() { jQuery(this).fadeOut('slow');
>> > > return false; });
>> >
>> > > with:
>> >
>> > > jQuery('.flash').hide().fadeIn(2000).animate({opacity: 1.0},
>> > > 2000).animate({ opacity: 'hide' }, 2000);
>> >
>> > > This makes the response.flash fade in and then fade out.  No clicking
>> > > required.
>> >
>> > > Thanks
>> > > Russell
>>
>>
>
>
>
>
>

[web2py] Re: Is the welcome.w2p file missing in Version 1.99.7?

2012-06-07 Thread Massimo Di Pierro
Now I see the problem.

For now you should be able to do

echo '' > NEWINSTALL
python web2py.py -a 'hello'
Ctrl+C

when starting with apache the first time it skips the logic to create 
welcome.w2p.


On Thursday, 7 June 2012 23:33:18 UTC-5, JoeCodeswell wrote:
>
> Hi Massimo. Thanks for the reply. I DID do what you said to do. Here are 
> the commands i ran. 
>
>
> [web2py]$ echo '' > NEWINSTALL
> [web2py]$ ls
> anyserver.py gaehandler.py options_std.py  setup_exe.
> py
> appengine_config.py  gluon parameters_80.pysetup.py
> app.example.yaml __init__.py   queue.example.yaml  site-
> packages
> applications isapiwsgihandler.py   README  splashlogo.
> gif
> cgihandler.pyLICENSE   router.example.py   VERSION
> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
> deposit  logs  scgihandler.py  wsgihandler
> .py
> epydoc.conf  Makefile  scripts
> epydoc.css   modpythonhandler.py   setup_app.py
> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
> [web2py]$ cd ..
> [w2p27]$ ls
> apache2  htdocs  web2py  web2py_src.zip
> [w2p27]$ cd apache2/bin
> [bin]$ ./stop
> [bin]$ ./start
> [bin]$ cd ../../web2py
> [web2py]$ ls
> anyserver.py gaehandler.py options_std.py  setup_exe.
> py
> appengine_config.py  gluon parameters_80.pysetup.py
> app.example.yaml __init__.py   queue.example.yaml  site-
> packages
> applications isapiwsgihandler.py   README  splashlogo.
> gif
> cgihandler.pyLICENSE   router.example.py   VERSION
> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
> deposit  logs  scgihandler.py  wsgihandler
> .py
> epydoc.conf  Makefile  scripts
> epydoc.css   modpythonhandler.py   setup_app.py
> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
>
>  
>
> I still don't see any *welcome.w2p* in the *web2p*y directory. In 
> addition, i think the purpose of the   $ echo '' > NEWINSTALL command was 
> to create the NEWINSTALL file. However, i am NOT sure, but i believe,  that 
> file already existed as shown by the $ ls of the web2py directory in my 
> original post.
>
> Is there something else I need to do?
>
> Thanks in advance.
>
> Love and peace,
>
> Joe
>
> On Thursday, June 7, 2012 7:53:47 PM UTC-7, Massimo Di Pierro wrote:
>>
>> cd web2py
>> echo '' > NEWINSTALL
>>
>> then web2py will create a welcome.w2p for you.
>>
>> On Thursday, 7 June 2012 20:47:02 UTC-5, JoeCodeswell wrote:
>>>
>>> This is a continuation of the "web2py still unable to create 
>>> application on 
>>> WebFaction"
>>>  
>>> topic.
>>>
>>> When creating a new simple app from the web admin interface i get 
>>> "unable to create application "newapp" (it may exist already)".  I had this 
>>> problem occur AGAIN, TODAY on WebFaction, when I upgraded to Version 1.99.7 
>>> (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 (Unix) mod_wsgi/3.3 
>>> Python/2.7.3. 
>>>
>>> I checked and there is NO *welcome.w2p *in the  *web2py* directory. 
>>> Here are the ssh commands i used to upgrade.  
>>>
>>>
>>> $ cd PATH/w2py/apache2/bin
>>> $ ./stop
>>>
>>> $ cd ../..
>>> $ rm web2py_src.zip
>>>
>>> $ wget -q http://www.web2py.com/examples/static/web2py_src.zip
>>> $ unzip -q web2py_src.zip
>>> replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename:A
>>>
>>> $ cd PATH/w2py/apache2/bin
>>> $ ./start
>>>
>>> $ cd ../..
>>> $ cd web2py
>>> $ ls
>>> anyserver.py gaehandler.py options_std.py  setup_exe
>>> .py
>>> appengine_config.py  gluon parameters_80.pysetup.py
>>> app.example.yaml __init__.py   queue.example.yaml  site-
>>> packages
>>> applications isapiwsgihandler.py   README 
>>>  splashlogo.gif
>>> cgihandler.pyLICENSE   router.example.py   VERSION
>>> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
>>> deposit  logs  scgihandler.py 
>>>  wsgihandler.py
>>> epydoc.conf  Makefile  scripts
>>> epydoc.css   modpythonhandler.py   setup_app.py
>>> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
>>>
>>>
>>> I can see the site in a browser and get to the web-admin interface. I 
>>> cloned the Movuca demo from GitHub and it seems to be working. But when I 
>>> create a new simple app from the web admin interface I still get "unable to 
>>> create application "newapp" (it may exist already)". And subsequent $ 
>>> lscommands show there is STILL NO 
>>> *welcome.w2p *in the  *web2py* directory.
>>>
>>> I hope I have been clear enough in my description. Here is my question. 
>>>
>>> How can i get a *wel

[web2py] Re: Is the welcome.w2p file missing in Version 1.99.7?

2012-06-07 Thread JoeCodeswell
Hi Massimo. Thanks for the reply. I DID do what you said to do. Here are 
the commands i ran. 


[web2py]$ echo '' > NEWINSTALL
[web2py]$ ls
anyserver.py gaehandler.py options_std.py  setup_exe.py
appengine_config.py  gluon parameters_80.pysetup.py
app.example.yaml __init__.py   queue.example.yaml  site-packages
applications isapiwsgihandler.py   README  splashlogo.
gif
cgihandler.pyLICENSE   router.example.py   VERSION
CHANGELOGlogging.example.conf  routes.example.py   web2py.py
deposit  logs  scgihandler.py  wsgihandler.
py
epydoc.conf  Makefile  scripts
epydoc.css   modpythonhandler.py   setup_app.py
fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
[web2py]$ cd ..
[w2p27]$ ls
apache2  htdocs  web2py  web2py_src.zip
[w2p27]$ cd apache2/bin
[bin]$ ./stop
[bin]$ ./start
[bin]$ cd ../../web2py
[web2py]$ ls
anyserver.py gaehandler.py options_std.py  setup_exe.py
appengine_config.py  gluon parameters_80.pysetup.py
app.example.yaml __init__.py   queue.example.yaml  site-packages
applications isapiwsgihandler.py   README  splashlogo.
gif
cgihandler.pyLICENSE   router.example.py   VERSION
CHANGELOGlogging.example.conf  routes.example.py   web2py.py
deposit  logs  scgihandler.py  wsgihandler.
py
epydoc.conf  Makefile  scripts
epydoc.css   modpythonhandler.py   setup_app.py
fcgihandler.py   NEWINSTALLsetup_exe_2.6.py

 

I still don't see any *welcome.w2p* in the *web2p*y directory. In addition, 
i think the purpose of the   $ echo '' > NEWINSTALL command was to create 
the NEWINSTALL file. However, i am NOT sure, but i believe,  that file 
already existed as shown by the $ ls of the web2py directory in my original 
post.

Is there something else I need to do?

Thanks in advance.

Love and peace,

Joe

On Thursday, June 7, 2012 7:53:47 PM UTC-7, Massimo Di Pierro wrote:
>
> cd web2py
> echo '' > NEWINSTALL
>
> then web2py will create a welcome.w2p for you.
>
> On Thursday, 7 June 2012 20:47:02 UTC-5, JoeCodeswell wrote:
>>
>> This is a continuation of the "web2py still unable to create application 
>> on 
>> WebFaction"
>>  
>> topic.
>>
>> When creating a new simple app from the web admin interface i get "unable 
>> to create application "newapp" (it may exist already)".  I had this problem 
>> occur AGAIN, TODAY on WebFaction, when I upgraded to Version 1.99.7 
>> (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 (Unix) mod_wsgi/3.3 
>> Python/2.7.3. 
>>
>> I checked and there is NO *welcome.w2p *in the  *web2py* directory. Here 
>> are the ssh commands i used to upgrade.  
>>
>>
>> $ cd PATH/w2py/apache2/bin
>> $ ./stop
>>
>> $ cd ../..
>> $ rm web2py_src.zip
>>
>> $ wget -q http://www.web2py.com/examples/static/web2py_src.zip
>> $ unzip -q web2py_src.zip
>> replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
>>
>> $ cd PATH/w2py/apache2/bin
>> $ ./start
>>
>> $ cd ../..
>> $ cd web2py
>> $ ls
>> anyserver.py gaehandler.py options_std.py  setup_exe.
>> py
>> appengine_config.py  gluon parameters_80.pysetup.py
>> app.example.yaml __init__.py   queue.example.yaml  site-
>> packages
>> applications isapiwsgihandler.py   README  splashlogo
>> .gif
>> cgihandler.pyLICENSE   router.example.py   VERSION
>> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
>> deposit  logs  scgihandler.py 
>>  wsgihandler.py
>> epydoc.conf  Makefile  scripts
>> epydoc.css   modpythonhandler.py   setup_app.py
>> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
>>
>>
>> I can see the site in a browser and get to the web-admin interface. I 
>> cloned the Movuca demo from GitHub and it seems to be working. But when I 
>> create a new simple app from the web admin interface I still get "unable to 
>> create application "newapp" (it may exist already)". And subsequent $ 
>> lscommands show there is STILL NO 
>> *welcome.w2p *in the  *web2py* directory.
>>
>> I hope I have been clear enough in my description. Here is my question. 
>>
>> How can i get a *welcome.w2p *into the *web2py* directory so i can 
>> create a new simple app from the web admin interface?
>>
>> Thanks for the help. 
>>
>> Love and peace,
>>
>> Joe
>>
>>

[web2py] Re: conflicts with issue 778

2012-06-07 Thread Massimo Di Pierro
done. Thank you Carlos. Sorry for the confusion.

On Thursday, 7 June 2012 22:18:05 UTC-5, Carlos wrote:
>
> Hi Massimo,
>
> In summary, just revert changeset # e808fd6f684a, since that code is 
> already included in the assert_status function.
>
> Thanks,
>
>Carlos
>
>
> On Thursday, June 7, 2012 9:38:44 PM UTC-5, Massimo Di Pierro wrote:
>>
>> I am a bit lost. Can you email me a patch to remove what should have not 
>> been included?
>>
>> massimo
>>
>> On Wednesday, 6 June 2012 16:43:21 UTC-5, Carlos wrote:
>>>
>>> Hi Massimo,
>>>
>>> Why was the code in the following changeset re-included?:
>>>
>>>(e808fd6f684a) do not show errors about already uploaded files
>>>
>>> This was already handled (so far successfully) via the following 
>>> changeset:
>>>
>>>(af730eb609c0) fixed onvalidation for SQLFORM, issue 778
>>>
>>>http://code.google.com/p/web2py/issues/detail?id=778
>>>
>>> Thanks,
>>>
>>>Carlos
>>>
>>>

[web2py] grid/smartgrid ondelete issue

2012-06-07 Thread weheh
I gave grid (and later tried smartgrid) an ondelete parameter, but it's not 
getting used at all by the grid object. Inspection of the grid's Delete 
button shows the onclick action to be the same regardless of whether or not 
I have an ondelete argument to SQLFORM.grid.

Related questions, assuming the ondelete argument worked as expected:
- How to pass the .id of the intended record?
- How to get the signature?

Could it be that part of the problem may be that my query is considered an 
unsupported query because it has a left join?


[web2py] Re: conflicts with issue 778

2012-06-07 Thread Carlos
Hi Massimo,

In summary, just revert changeset # e808fd6f684a, since that code is 
already included in the assert_status function.

Thanks,

   Carlos


On Thursday, June 7, 2012 9:38:44 PM UTC-5, Massimo Di Pierro wrote:
>
> I am a bit lost. Can you email me a patch to remove what should have not 
> been included?
>
> massimo
>
> On Wednesday, 6 June 2012 16:43:21 UTC-5, Carlos wrote:
>>
>> Hi Massimo,
>>
>> Why was the code in the following changeset re-included?:
>>
>>(e808fd6f684a) do not show errors about already uploaded files
>>
>> This was already handled (so far successfully) via the following 
>> changeset:
>>
>>(af730eb609c0) fixed onvalidation for SQLFORM, issue 778
>>
>>http://code.google.com/p/web2py/issues/detail?id=778
>>
>> Thanks,
>>
>>Carlos
>>
>>

[web2py] Symbolic links in the applications directory...

2012-06-07 Thread Doug Philips
I can only find one mention of symbolic links in the book, under:
http://web2py.com/books/default/chapter/29/4#Application-init

That seems to imply that symbolic links at the applications directory
level are ok.
Specifically, if I have the following applications:
ProjectX2010
ProjectX2011
ProjectX2012
and then I symbolic link ProjectX to point to one of them, say
ProjectX2012, is the underlying database safe if I have clients using
the ProjectX2012 and ProjectX applications at the same time?

The one mention of symbolic links seems to say so, but that's pretty
'backhanded' way of saying symlinks won't cause any corruption with
simultaneous access, etc.
I'm interested because I have several instances of ProjectX (and
ProjectY) planned, and if symbolic links are safe, for my use case
here, symbolic links seem a lot easier than doing URL
rewriting/routing. If I've missed where this is talked about in the
book, a link or even a better, a better term to search for would be
great!

Thanks,
 --Doug


[web2py] Re: Is the welcome.w2p file missing in Version 1.99.7?

2012-06-07 Thread Massimo Di Pierro
cd web2py
echo '' > NEWINSTALL

then web2py will create a welcome.w2p for you.

On Thursday, 7 June 2012 20:47:02 UTC-5, JoeCodeswell wrote:
>
> This is a continuation of the "web2py still unable to create application 
> on 
> WebFaction"
>  
> topic.
>
> When creating a new simple app from the web admin interface i get "unable 
> to create application "newapp" (it may exist already)".  I had this problem 
> occur AGAIN, TODAY on WebFaction, when I upgraded to Version 1.99.7 
> (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 (Unix) mod_wsgi/3.3 
> Python/2.7.3. 
>
> I checked and there is NO *welcome.w2p *in the  *web2py* directory. Here 
> are the ssh commands i used to upgrade.  
>
>
> $ cd PATH/w2py/apache2/bin
> $ ./stop
>
> $ cd ../..
> $ rm web2py_src.zip
>
> $ wget -q http://www.web2py.com/examples/static/web2py_src.zip
> $ unzip -q web2py_src.zip
> replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
>
> $ cd PATH/w2py/apache2/bin
> $ ./start
>
> $ cd ../..
> $ cd web2py
> $ ls
> anyserver.py gaehandler.py options_std.py  setup_exe.
> py
> appengine_config.py  gluon parameters_80.pysetup.py
> app.example.yaml __init__.py   queue.example.yaml  site-
> packages
> applications isapiwsgihandler.py   README  splashlogo.
> gif
> cgihandler.pyLICENSE   router.example.py   VERSION
> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
> deposit  logs  scgihandler.py  wsgihandler
> .py
> epydoc.conf  Makefile  scripts
> epydoc.css   modpythonhandler.py   setup_app.py
> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
>
>
> I can see the site in a browser and get to the web-admin interface. I 
> cloned the Movuca demo from GitHub and it seems to be working. But when I 
> create a new simple app from the web admin interface I still get "unable to 
> create application "newapp" (it may exist already)". And subsequent $ 
> lscommands show there is STILL NO 
> *welcome.w2p *in the  *web2py* directory.
>
> I hope I have been clear enough in my description. Here is my question. 
>
> How can i get a *welcome.w2p *into the *web2py* directory so i can create 
> a new simple app from the web admin interface?
>
> Thanks for the help. 
>
> Love and peace,
>
> Joe
>
>

Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-06-07 Thread Massimo Di Pierro
The file welcome.w2p does not ship with web2py. It is created when the 
file NEWINSTALL is present. NEWINSTALL ships with web2py. How did you 
upgrade? If you upgrade from trunk, it is not there.

On Thursday, 7 June 2012 20:35:19 UTC-5, JoeCodeswell wrote:
>
> Hi Noel,
>
> I had this problem occur AGAIN, TODAY on WebFaction, when I upgraded to 
> Version 1.99.7 (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 
> (Unix) mod_wsgi/3.3 Python/2.7.3. When creating a new simple app from the 
> web admin interface i get "unable to create application "newapp" (it may 
> exist already)"
>
> I checked and there is NO  *welcome.w2p *in the  *web2py* directory. Here 
> are the ssh commands i used. 
>
> $ cd PATH/w2py/apache2/bin
> $ ./stop
>
> $ cd ../..
> $ rm web2py_src.zip
>
> $ wget -q http://www.web2py.com/examples/static/web2py_src.zip
> $ unzip -q web2py_src.zip
> replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
>
> $ cd PATH/w2py/apache2/bin
> $ ./start
>
> $ cd ../..
> $ cd web2py
> $ ls
> anyserver.py gaehandler.py options_std.py  setup_exe.
> py
> appengine_config.py  gluon parameters_80.pysetup.py
> app.example.yaml __init__.py   queue.example.yaml  site-
> packages
> applications isapiwsgihandler.py   README  splashlogo.
> gif
> cgihandler.pyLICENSE   router.example.py   VERSION
> CHANGELOGlogging.example.conf  routes.example.py   web2py.py
> deposit  logs  scgihandler.py  wsgihandler
> .py
> epydoc.conf  Makefile  scripts
> epydoc.css   modpythonhandler.py   setup_app.py
> fcgihandler.py   NEWINSTALLsetup_exe_2.6.py
>
>
>
> Is the  *welcome.w2p *file missing in Version 1.99.7? How can it be 
> replaced?
>
> I'll start up a new topic entitled "Is the  *welcome.w2p *file missing in 
> Version 1.99.7? " 
>
> Thanks for the help.
>
> Love and peace,
>
> Joe
>
>
>
> On Sunday, April 8, 2012 4:17:22 PM UTC-7, Noel Villamor wrote:
>>
>>
>> Hi All,
>>
>> I encountered this issue as well. Here is how I resolved it.
>>
>> *- web2py directory should have welcome.w2p*
>>
>> Happy Easter!
>>
>> Noel Villamor
>>
>>
>> On Sunday, 6 March 2011 09:54:19 UTC+13, Jonathan Lundell wrote:
>>>
>>> On Mar 5, 2011, at 12:07 PM, Jonathan Lundell wrote:
>>> > 
>>> > On Mar 5, 2011, at 11:35 AM, JoeCodeswell wrote:
>>> >> 
>>> >> Something like you, Christopher, suggested was also suggested by the
>>> >> Webfaction Support folks. This suggestion worked for me, after I had
>>> >> investigated some other possibilities.
>>> >> 
>>> >> You can read my blog post on this subject, "Fixing my "my web2py is
>>> >> unable to create a new application on WebFaction" problem", which
>>> >> references THIS web2py-users thread for "a full discussion of the
>>> >> problem". Here is the link 
>>> http://joecodeswell.blogspot.com/2011/02/fixing-my-my-web2py-is-unable-to-create.html
>>> > 
>>> > Do we know what's going on here? I'm guessing that it's the 
>>> initialization of the admin password.
>>>
>>> On second thought, that's not it. It'd be good to track it down and fix 
>>> it, though.
>>>
>>

Re: [web2py] Re: what do you think about waitress webserver

2012-06-07 Thread Massimo Di Pierro
agree.

On Thursday, 7 June 2012 16:49:07 UTC-5, Derek wrote:
>
> Yeah, that whole "large files get corrupted when downloading" is a big 
> issue...
>
> On Tuesday, June 5, 2012 1:14:14 PM UTC-7, Massimo Di Pierro wrote:
>>
>> Good reason to be busy. Anyway, if can assemble a team a people who can 
>> reproduce the problem, I can help fix it over IRC chat. Next week.
>>
>> On Tuesday, 5 June 2012 14:10:22 UTC-5, mcm wrote:
>>>
>>> IIRC Tim is busy with is little (real) baby.  I am sure he did not 
>>> forget rocket... 
>>>
>>> mic 
>>>
>>> 2012/6/5 Massimo Di Pierro : 
>>> > I still think rocket is the best (speed and design compromise) but I 
>>> am not 
>>> > sure Tim is till maintaining it. If rocket is no longer maintained we 
>>> should 
>>> > revert to cherrypy. It supports ssl and has proved its worth. 
>>> > 
>>> > 
>>> > On Monday, 4 June 2012 18:17:57 UTC-5, pbreit wrote: 
>>> >> 
>>> >> Well that's a problem and supports my initial intuition. I'm not sure 
>>> how 
>>> >> it can be considered "production-ready" without SSL. 
>>> >> 
>>> >> 
>>> >> On Monday, June 4, 2012 1:21:10 PM UTC-7, Anthony wrote: 
>>> >>> 
>>> >>> No SSL, though. 
>>> >>> 
>>> >>> On Monday, June 4, 2012 4:12:16 PM UTC-4, pbreit wrote: 
>>>  
>>>  Ordinarily I would not think much of it but it actually looks 
>>>  interesting considering it is pure Python, supposedly production 
>>> ready and 
>>>  "very acceptable performance". 
>>>  
>>>  
>>>  On Monday, June 4, 2012 7:03:11 AM UTC-7, Vasile Ermicioi wrote: 
>>> > 
>>> > hi, 
>>> > what do you think about waitress webserver? 
>>> > 
>>> > http://docs.pylonsproject.org/projects/waitress/en/latest/ 
>>> > 
>>> > 
>>> > 
>>>
>>

[web2py] Re: default foreign key

2012-06-07 Thread Massimo Di Pierro


db(db.owner.isdefault=True).select()


should be


db(db.owner.isdefault==True).select()


On Thursday, 7 June 2012 16:48:57 UTC-5, Vincent wrote:
>
> Thanks for the suggestion.
> It returns the following error:
> SyntaxError: keyword can't be an expression
>
> On Thursday, June 7, 2012 4:26:03 PM UTC-5, Derek wrote:
>>
>> Have you tried this:
>>
>> db.define_table('dog', 
>> Field('name','string'),Field('owner',db.owner,default=db(db.owner.isdefault=True).select().first()))
>>
>>
>> On Thursday, June 7, 2012 2:20:30 PM UTC-7, Vincent wrote:
>>>
>>> Hi,
>>>
>>> I'm looking for a way to define a default foreign key dynamically.
>>>
>>> For example if I have the following schema:
>>>
>>> db.define_table('owner',Field('name', 'string'), 
>>> Field('isdefault','boolean',default=False))
>>> db.people.insert('name'='Bill')
>>> db.people.insert('name'='unknown',isdefault=True)
>>> db.define_table('dog', 
>>> Field('name','string'),Field('owner',db.owner,default=))
>>> db.dog.insert(name='Fido',owner=1)
>>> db.dog.insert(name='mutt') # hopefully points to "unknown" in owner table
>>>
>>> Is there a way I could dynamically check the "owner" table and return 
>>> the id of the first row where isdefault==True whenever I define a new "dog" 
>>> without an owner?
>>> In the example above the "mutt" row should have owner==2 ("unknown" in 
>>> the owner table).
>>>
>>> Trying to put a function as the default argument does not work. I 
>>> realize I could set the owner to always be the first row in the table but I 
>>> would like something more robust and flexible.
>>>
>>> Thanks
>>> Vincent
>>>
>>>

[web2py] Re: trunk and statusbar?

2012-06-07 Thread Massimo Di Pierro
it is this: 

..

I feel is new welcome is still too much cluttered anyway. There is too much 
js and too may obscure classes (jumbotron?)

On Thursday, 7 June 2012 11:34:58 UTC-5, mweissen wrote:
>
> Today I have tried to build a new application using the trunk.
> Where has the status-bar gone? I could not find it in layout.html
>
> Regards, Martin
>
>
>

Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Doug Philips
On Thu, Jun 7, 2012 at 2:12 PM, Anthony  wrote:
> I'm not sure if this is in stable, but in trunk you can specify dictionaries
> of args to pass to SQLFORM, including separate dictionaries for create,
> edit, and view
> forms: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#1500.

I'm running:
Version 1.99.7 (2012-03-04 22:12:08) stable

and that code isn't there. Glad it will be in the stable tree at some
point though, thanks for the pointer/info!

-=Doug


Re: [web2py] niphlod tvseries error

2012-06-07 Thread Massimo Di Pierro
You did? I am not sure I have them.

On Thursday, 7 June 2012 03:08:50 UTC-5, Niphlod wrote:
>
> There are a few places here and there stating that web2py supports python 
> 2.5 , 2.6 and 2.7, preferring 2.5 .
>
> I contacted Massimo the last week just about that the binary 
> distribution with a recent python version could enable some new features 
> that are in stable. Builds against 2.7 seems to work ok with small 
> modifications, and I sent Massimo my patches for it.
>
> I'm pretty sure that for the 2.0 release binary version will be built 
> against python 2.7 ...
>
>
> Il giorno giovedì 7 giugno 2012 09:48:37 UTC+2, blye ha scritto:
>>
>> thanks again
>> I am curious.. 
>> in light of above, my web2py runs very fine most of time but newer apps 
>> are having this issue
>> why does the web2py distrib bin version have py 25 dll etc
>>
>> Are there any references to this issue in the lit or books
>> Is a new main thread worthwhile in this regard?
>>
>>
>> On Wednesday, 6 June 2012 23:32:55 UTC+2, Niphlod wrote:
>>>
>>> if you're using binary version there is a good chance that web2py will 
>>> run under 2.5
>>>
>>> if you have also 2.7 installed, download the source code version, unzip 
>>> in a folder, then python web2py.py and voilà.
>>>
>>> Il giorno mercoledì 6 giugno 2012 22:18:34 UTC+2, blye ha scritto:

 Thanks very much for prompt reply. Never quite sure if its a bug ... 
  or me :-(
 This issue has happened with other apps, not sure if I understand.
 w2p has its own internal Python 2.5.. ???
 I have py 2.5 and 2.7 installed on my machine

 How do I resolve the w2p 2.7 issue?
 Should I be running w2p from source code? How do I resolve on a 
 production host server?

 OTT All the work of you guys is both inspirational, showing web2py 
 power and educational. What a great ongoing creation.

 Thanks.

 On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:
>
> yeah, forgot to mention in the main page that w2p_tvseries won't work 
> with python 2.5 (the scheduler part needs the multiprocessing module)
>
> BTW, the function this line is in is not used for the moment, but a 
> one-line fix will avoid the error, so as soon as possible I'll release an 
> update.
>
> @all: if you want to discuss it further, maybe this can be a right 
> place, but if it's for filing a bug, let's keep this list uncluttered and 
> move to github's pages ;-)
>
> Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha scritto:
>>
>> whats the Python version?
>>
>> this is a python issue you can solve with this (if not running 2.7)
>>
>> return UL(*lis, **{"_class": 'nav'})
>>
>>
>>
>> On Tue, Jun 5, 2012 at 12:05 PM, blye  wrote:
>>
>>> return UL(*lis, _class='nav')
>>
>>
>>
>>
>> -- 
>>
>> Bruno Rocha
>> [http://rochacbruno.com.br]
>>
>>

[web2py] Re: has_permission() broken?

2012-06-07 Thread Massimo Di Pierro
Why do you say that? The exception is raised by the app controller, not by 
web2py. There is not enough info here to help debug.

massimo

On Wednesday, 6 June 2012 21:17:04 UTC-5, craley wrote:
>
> Traceback (most recent call last):
>
>   File "/srv/web2py/gluon/restricted.py", line 204, in restricted
> ccode = compile2(code,layer)
>   File "/srv/web2py/applications/dashboard/controllers/admin.py" 
> ,
>  line 258, in 
>   File "/srv/web2py/gluon/globals.py", line 172, in 
> self._vars = None
>   File "/srv/web2py/gluon/tools.py", line 2533, in f
> def not_authorized(self):
>   File "/srv/web2py/applications/dashboard/controllers/admin.py" 
> ,
>  line 183, in security
> raise StandardError,[auth.has_permission(name = 'read',table_name = 
> 'location',user_id = user['id'],record_id = 
> target_location[0]['id']),auth.has_permission(name = 'read',table_name = 
> 'location',group_id = auth.user_group(user['id']),record_id = 
> target_location[0]['id'])]
> StandardError: [False, True]
>
>

[web2py] Re: conflicts with issue 778

2012-06-07 Thread Massimo Di Pierro
I am a bit lost. Can you email me a patch to remove what should have not 
been included?

massimo

On Wednesday, 6 June 2012 16:43:21 UTC-5, Carlos wrote:
>
> Hi Massimo,
>
> Why was the code in the following changeset re-included?:
>
>(e808fd6f684a) do not show errors about already uploaded files
>
> This was already handled (so far successfully) via the following changeset:
>
>(af730eb609c0) fixed onvalidation for SQLFORM, issue 778
>
>http://code.google.com/p/web2py/issues/detail?id=778
>
> Thanks,
>
>Carlos
>
>

[web2py] Is the welcome.w2p file missing in Version 1.99.7?

2012-06-07 Thread JoeCodeswell
This is a continuation of the "web2py still unable to create application on 
WebFaction"
 
topic.

When creating a new simple app from the web admin interface i get "unable 
to create application "newapp" (it may exist already)".  I had this problem 
occur AGAIN, TODAY on WebFaction, when I upgraded to Version 1.99.7 
(2012-03-04 22:12:08) stable, Running on Apache/2.2.17 (Unix) mod_wsgi/3.3 
Python/2.7.3. 

I checked and there is NO *welcome.w2p *in the  *web2py* directory. Here 
are the ssh commands i used to upgrade.  


$ cd PATH/w2py/apache2/bin
$ ./stop

$ cd ../..
$ rm web2py_src.zip

$ wget -q http://www.web2py.com/examples/static/web2py_src.zip
$ unzip -q web2py_src.zip
replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A

$ cd PATH/w2py/apache2/bin
$ ./start

$ cd ../..
$ cd web2py
$ ls
anyserver.py gaehandler.py options_std.py  setup_exe.py
appengine_config.py  gluon parameters_80.pysetup.py
app.example.yaml __init__.py   queue.example.yaml  site-packages
applications isapiwsgihandler.py   README  splashlogo.
gif
cgihandler.pyLICENSE   router.example.py   VERSION
CHANGELOGlogging.example.conf  routes.example.py   web2py.py
deposit  logs  scgihandler.py  wsgihandler.
py
epydoc.conf  Makefile  scripts
epydoc.css   modpythonhandler.py   setup_app.py
fcgihandler.py   NEWINSTALLsetup_exe_2.6.py


I can see the site in a browser and get to the web-admin interface. I 
cloned the Movuca demo from GitHub and it seems to be working. But when I 
create a new simple app from the web admin interface I still get "unable to 
create application "newapp" (it may exist already)". And subsequent $ 
lscommands show there is STILL NO 
*welcome.w2p *in the  *web2py* directory.

I hope I have been clear enough in my description. Here is my question. 

How can i get a *welcome.w2p *into the *web2py* directory so i can create a 
new simple app from the web admin interface?

Thanks for the help. 

Love and peace,

Joe



Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-06-07 Thread JoeCodeswell
Hi Noel,

I had this problem occur AGAIN, TODAY on WebFaction, when I upgraded to 
Version 1.99.7 (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 
(Unix) mod_wsgi/3.3 Python/2.7.3. When creating a new simple app from the 
web admin interface i get "unable to create application "newapp" (it may 
exist already)"

I checked and there is NO  *welcome.w2p *in the  *web2py* directory. Here 
are the ssh commands i used. 

$ cd PATH/w2py/apache2/bin
$ ./stop

$ cd ../..
$ rm web2py_src.zip

$ wget -q http://www.web2py.com/examples/static/web2py_src.zip
$ unzip -q web2py_src.zip
replace web2py/gluon/__init__.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A

$ cd PATH/w2py/apache2/bin
$ ./start

$ cd ../..
$ cd web2py
$ ls
anyserver.py gaehandler.py options_std.py  setup_exe.py
appengine_config.py  gluon parameters_80.pysetup.py
app.example.yaml __init__.py   queue.example.yaml  site-packages
applications isapiwsgihandler.py   README  splashlogo.
gif
cgihandler.pyLICENSE   router.example.py   VERSION
CHANGELOGlogging.example.conf  routes.example.py   web2py.py
deposit  logs  scgihandler.py  wsgihandler.
py
epydoc.conf  Makefile  scripts
epydoc.css   modpythonhandler.py   setup_app.py
fcgihandler.py   NEWINSTALLsetup_exe_2.6.py



Is the  *welcome.w2p *file missing in Version 1.99.7? How can it be 
replaced?

I'll start up a new topic entitled "Is the  *welcome.w2p *file missing in 
Version 1.99.7? " 

Thanks for the help.

Love and peace,

Joe



On Sunday, April 8, 2012 4:17:22 PM UTC-7, Noel Villamor wrote:
>
>
> Hi All,
>
> I encountered this issue as well. Here is how I resolved it.
>
> *- web2py directory should have welcome.w2p*
>
> Happy Easter!
>
> Noel Villamor
>
>
> On Sunday, 6 March 2011 09:54:19 UTC+13, Jonathan Lundell wrote:
>>
>> On Mar 5, 2011, at 12:07 PM, Jonathan Lundell wrote:
>> > 
>> > On Mar 5, 2011, at 11:35 AM, JoeCodeswell wrote:
>> >> 
>> >> Something like you, Christopher, suggested was also suggested by the
>> >> Webfaction Support folks. This suggestion worked for me, after I had
>> >> investigated some other possibilities.
>> >> 
>> >> You can read my blog post on this subject, "Fixing my "my web2py is
>> >> unable to create a new application on WebFaction" problem", which
>> >> references THIS web2py-users thread for "a full discussion of the
>> >> problem". Here is the link 
>> http://joecodeswell.blogspot.com/2011/02/fixing-my-my-web2py-is-unable-to-create.html
>> > 
>> > Do we know what's going on here? I'm guessing that it's the 
>> initialization of the admin password.
>>
>> On second thought, that's not it. It'd be good to track it down and fix 
>> it, though.
>>
>

Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 6:12 PM, Cliff Kachinske wrote:
> Does that mean there's only one instance of current for a running instance of 
> Web2py?  So if I do current.db, it could overwrite a current.db assigned in 
> an earlier request?

No, it's unique to the current request (that's why it's called current).

But web2py itself saves things there, like current.request, and there's no 
guarantee that it might not save something like current.db in the future, which 
you'd be clobbering. So you're better off doing something like

current.app = Storage()
current.myappname.db = db

Nag: I really think that we should be executing that first line in gluon 
itself, and officially reserve current.app for use by the app.



> 
> On Thursday, June 7, 2012 7:07:35 PM UTC-4, Jonathan Lundell wrote:
> On Jun 7, 2012, at 2:42 PM, Cliff Kachinske wrote:
>> I don't have a good feel for the most efficient way to, for example, pass 
>> the db to a class method.  I can think of three ways.
>> 
>> - Pass it in when you call the method.
>> - Pass it in when you initialize the class
>> - Import current, do something like current.db = db and then pass current to 
>> the class's __init__
>> 
>> Any opinions on this?  All help greatly appreciated.
> 
> It shouldn't really matter. But where is the caller and callee? If the caller 
> is in a controller and the callee is in an imported module, for example, I 
> don't think it makes much difference. I'd avoid current where you don't 
> really need it (and if you do use current, using current.db is a little 
> risky; try to give yourself a safe namespace).




[web2py] Re: Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
Anthony, Bruce,

thank you.

I will study the Auth and Crud code.  

On Thursday, June 7, 2012 5:42:33 PM UTC-4, Cliff Kachinske wrote:
>
> I'm just starting to use modules with classes for code commonality.
>
> I don't have a good feel for the most efficient way to, for example, pass 
> the db to a class method.  I can think of three ways.
>
> - Pass it in when you call the method.
> - Pass it in when you initialize the class
> - Import current, do something like current.db = db and then pass current 
> to the class's __init__
>
> Any opinions on this?  All help greatly appreciated.
>


Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
Thanks, Jonathon,

Does that mean there's only one instance of current for a running instance 
of Web2py?  So if I do current.db, it could overwrite a current.db assigned 
in an earlier request?

On Thursday, June 7, 2012 7:07:35 PM UTC-4, Jonathan Lundell wrote:
>
> On Jun 7, 2012, at 2:42 PM, Cliff Kachinske wrote:
>
> I don't have a good feel for the most efficient way to, for example, pass 
> the db to a class method.  I can think of three ways.
>
> - Pass it in when you call the method.
> - Pass it in when you initialize the class
> - Import current, do something like current.db = db and then pass current 
> to the class's __init__
>
> Any opinions on this?  All help greatly appreciated.
>
>
> It shouldn't really matter. But where is the caller and callee? If the 
> caller is in a controller and the callee is in an imported module, for 
> example, I don't think it makes much difference. I'd avoid current where 
> you don't really need it (and if you do use current, using current.db is a 
> little risky; try to give yourself a safe namespace).
>


[web2py] Re: Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-07 Thread greaneym
Hello,

people can also consider using RedHat's Openshift services for hosting as 
they do support python.  They will be soon offering commercial pricing but 
maybe for many people their free platform is sufficient.  Please contact 
Sumitha Nathan for details, snat...@redhat.com.  I got her permission to 
send this to the list.

I see that other people on the list have tried this hosting platform.  I 
think RedHat's hosting will be around for more than 2 years:)

Margaret



On Wednesday, June 6, 2012 8:03:48 AM UTC-5, drelyn86 wrote:
>
> Fluxflex will be shut down and will be no longer available on June 30, 
>> 2012.
>> =
>> From 2010, we have provided Fluxflex for about two years.
>> But because of profitability, instability and some other issues,
>> we decided to shut down fluxflex on June 30, 2012.
>> Because our team is composed of just two members,
>> we decided to focus more on concise products.
>> Thanks to all of our users, who kindly support our team and
>> advice us a lot to improve Fluxflex.
>> Although we shut down fluxflex.com, we will introduce your our new 
>> service soon,
>> which is like pre-configured VPS as localhost on a Cloud and
>> much more products for developers.
>> I really appreciate all people who help fluxflex.
>
>
>
> Source:  http://dl.dropbox.com/u/964705/fluxflex/goodbye_fluxflex.md



Re: [web2py] Re: Help me get a better feel for efficient code

2012-06-07 Thread Bruce Wade
I using the same process as Auth, all my shared code is put in a package at
the same level as gluon and I import what I need when I need it passing the
db object to the constructor.

On Thu, Jun 7, 2012 at 4:29 PM, Anthony  wrote:

> - Pass it in when you initialize the class
>>
>
> This is how Auth and Crud work:
> http://code.google.com/p/web2py/source/browse/gluon/tools.py#898,
> http://code.google.com/p/web2py/source/browse/gluon/tools.py#3056.
> Probably the best approach when you need to access db from multiple methods.
>
> Anthony
>
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.fittraineronline.com - Fitness Personal Trainers Online
http://www.warplydesigned.com


[web2py] Re: Help me get a better feel for efficient code

2012-06-07 Thread Anthony

>
> - Pass it in when you initialize the class
>

This is how Auth and Crud work: 
http://code.google.com/p/web2py/source/browse/gluon/tools.py#898, 
http://code.google.com/p/web2py/source/browse/gluon/tools.py#3056. Probably 
the best approach when you need to access db from multiple methods.

Anthony 
 


Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 2:42 PM, Cliff Kachinske wrote:
> I don't have a good feel for the most efficient way to, for example, pass the 
> db to a class method.  I can think of three ways.
> 
> - Pass it in when you call the method.
> - Pass it in when you initialize the class
> - Import current, do something like current.db = db and then pass current to 
> the class's __init__
> 
> Any opinions on this?  All help greatly appreciated.

It shouldn't really matter. But where is the caller and callee? If the caller 
is in a controller and the callee is in an imported module, for example, I 
don't think it makes much difference. I'd avoid current where you don't really 
need it (and if you do use current, using current.db is a little risky; try to 
give yourself a safe namespace).

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 2:03 PM, Cliff Kachinske wrote:
> It's not unusual to have a setup like this:
> 
> development box -> test box -> production box
> 
> The test box is a clone of the production box, as much as you can make it so. 
>  No reason why it couldn't be a virtual machine, but it has to be there to 
> prevent surprises due to different patch/version levels of the various 
> packages in the system.

Right. I'm working on a back end for an iPad app that uses that general setup. 
The development environment is local to my map, and the text box is a 
small-scale imitation of the production box (both Rackspace servers, as it 
happens), with identical configurations.

Minor changes I just push out to the test box, but anything that's more 
involved goes through all three.

(To my original restart question, though: think of it as an academic project. 
If you wanted to recognize a restart from inside an app, how would you go about 
it?)

> 
> On Thursday, June 7, 2012 3:48:00 PM UTC-4, Derek wrote:
> Ah, it seemed to me this is just a development environment and thus you 
> wouldn't need this feature in production?
> 
> On Thursday, May 31, 2012 2:47:51 PM UTC-7, Jonathan Lundell wrote:
> On May 31, 2012, at 2:32 PM, Derek wrote:
>> If you're blowing away your database, why don't you clear memcached when you 
>> blow away your database? I don't see how this is a web2py issue.
> 
> One possible reason: web2py (and in particular my application) aren't 
> necessarily the only memcached clients on the machine.
> 
> Regardless, it's more a puzzle than an issue. I can certainly clear my caches 
> manually, and that's in fact what I do now. But if there *were* a 
> straightforward way to detect web2py restart from inside an app, that'd be 
> handy in this particular case.
> 
>> 
>> On Wednesday, May 30, 2012 7:10:13 PM UTC-7, Jonathan Lundell wrote:
>> I've got an application that uses memcached. I'd like to recognize when 
>> web2py gets restarted (mod_wsgi, fwiw) so I can flush my cache. No doubt I 
>> can figure something out, but I'm sure I must be missing something obvious. 
>> (My motivation: in my development environment, I sometimes blow away my 
>> database when installing and starting a new copy of the app, and things get 
>> confused when the cache is still holding data from the earlier run.)
> 




Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-07 Thread Omi Chiba
Bruno,

I'm interested in pythonanywhere. 
Can we set up web2py with free account ? Any documentation I can refer ?

On Wednesday, June 6, 2012 4:34:46 PM UTC-5, rochacbruno wrote:
>
> pythonanywhere has easy deployment for web2py
>
> http://zerp.ly/rochacbruno
> Em 06/06/2012 15:10, "sesenmaister"  escreveu:
>
>> Andrew, I have the same question. Today I wanted to get payed hosting on 
>> FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python 
>> and web2py for pleasure, I've got no idea how to install web2py in a 
>> "normal" server and have no idea if all hostings permit that. So FluxFlex 
>> was my salvation. Now I'm gonna loose so many days for the simple thing of 
>> deploying. If any advice in getting a way, please I'd be very very glad.
>>
>> jsesen
>>
>> El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:
>>>
>>> So where do we go now?
>>
>> 

Re: [web2py] Re: what do you think about waitress webserver

2012-06-07 Thread Derek
Yeah, that whole "large files get corrupted when downloading" is a big 
issue...

On Tuesday, June 5, 2012 1:14:14 PM UTC-7, Massimo Di Pierro wrote:
>
> Good reason to be busy. Anyway, if can assemble a team a people who can 
> reproduce the problem, I can help fix it over IRC chat. Next week.
>
> On Tuesday, 5 June 2012 14:10:22 UTC-5, mcm wrote:
>>
>> IIRC Tim is busy with is little (real) baby.  I am sure he did not 
>> forget rocket... 
>>
>> mic 
>>
>> 2012/6/5 Massimo Di Pierro : 
>> > I still think rocket is the best (speed and design compromise) but I am 
>> not 
>> > sure Tim is till maintaining it. If rocket is no longer maintained we 
>> should 
>> > revert to cherrypy. It supports ssl and has proved its worth. 
>> > 
>> > 
>> > On Monday, 4 June 2012 18:17:57 UTC-5, pbreit wrote: 
>> >> 
>> >> Well that's a problem and supports my initial intuition. I'm not sure 
>> how 
>> >> it can be considered "production-ready" without SSL. 
>> >> 
>> >> 
>> >> On Monday, June 4, 2012 1:21:10 PM UTC-7, Anthony wrote: 
>> >>> 
>> >>> No SSL, though. 
>> >>> 
>> >>> On Monday, June 4, 2012 4:12:16 PM UTC-4, pbreit wrote: 
>>  
>>  Ordinarily I would not think much of it but it actually looks 
>>  interesting considering it is pure Python, supposedly production 
>> ready and 
>>  "very acceptable performance". 
>>  
>>  
>>  On Monday, June 4, 2012 7:03:11 AM UTC-7, Vasile Ermicioi wrote: 
>> > 
>> > hi, 
>> > what do you think about waitress webserver? 
>> > 
>> > http://docs.pylonsproject.org/projects/waitress/en/latest/ 
>> > 
>> > 
>> > 
>>
>

[web2py] Re: default foreign key

2012-06-07 Thread Vincent
Thanks for the suggestion.
It returns the following error:
SyntaxError: keyword can't be an expression

On Thursday, June 7, 2012 4:26:03 PM UTC-5, Derek wrote:
>
> Have you tried this:
>
> db.define_table('dog', 
> Field('name','string'),Field('owner',db.owner,default=db(db.owner.isdefault=True).select().first()))
>
>
> On Thursday, June 7, 2012 2:20:30 PM UTC-7, Vincent wrote:
>>
>> Hi,
>>
>> I'm looking for a way to define a default foreign key dynamically.
>>
>> For example if I have the following schema:
>>
>> db.define_table('owner',Field('name', 'string'), 
>> Field('isdefault','boolean',default=False))
>> db.people.insert('name'='Bill')
>> db.people.insert('name'='unknown',isdefault=True)
>> db.define_table('dog', 
>> Field('name','string'),Field('owner',db.owner,default=))
>> db.dog.insert(name='Fido',owner=1)
>> db.dog.insert(name='mutt') # hopefully points to "unknown" in owner table
>>
>> Is there a way I could dynamically check the "owner" table and return the 
>> id of the first row where isdefault==True whenever I define a new "dog" 
>> without an owner?
>> In the example above the "mutt" row should have owner==2 ("unknown" in 
>> the owner table).
>>
>> Trying to put a function as the default argument does not work. I realize 
>> I could set the owner to always be the first row in the table but I would 
>> like something more robust and flexible.
>>
>> Thanks
>> Vincent
>>
>>

[web2py] Re: Help me get a better feel for efficient code

2012-06-07 Thread Niphlod
I'll follow this thread as well I choose the third method, the second 
didn't work when connection was dropped, or with sqlite...kept getting 
"connection is closed" after a while.

Il giorno giovedì 7 giugno 2012 23:42:33 UTC+2, Cliff Kachinske ha scritto:
>
> I'm just starting to use modules with classes for code commonality.
>
> I don't have a good feel for the most efficient way to, for example, pass 
> the db to a class method.  I can think of three ways.
>
> - Pass it in when you call the method.
> - Pass it in when you initialize the class
> - Import current, do something like current.db = db and then pass current 
> to the class's __init__
>
> Any opinions on this?  All help greatly appreciated.
>


[web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
I'm just starting to use modules with classes for code commonality.

I don't have a good feel for the most efficient way to, for example, pass 
the db to a class method.  I can think of three ways.

- Pass it in when you call the method.
- Pass it in when you initialize the class
- Import current, do something like current.db = db and then pass current 
to the class's __init__

Any opinions on this?  All help greatly appreciated.


[web2py] Re: default foreign key

2012-06-07 Thread Derek
Have you tried this:

db.define_table('dog', 
Field('name','string'),Field('owner',db.owner,default=db(db.owner.isdefault=True).select().first()))


On Thursday, June 7, 2012 2:20:30 PM UTC-7, Vincent wrote:
>
> Hi,
>
> I'm looking for a way to define a default foreign key dynamically.
>
> For example if I have the following schema:
>
> db.define_table('owner',Field('name', 'string'), 
> Field('isdefault','boolean',default=False))
> db.people.insert('name'='Bill')
> db.people.insert('name'='unknown',isdefault=True)
> db.define_table('dog', 
> Field('name','string'),Field('owner',db.owner,default=))
> db.dog.insert(name='Fido',owner=1)
> db.dog.insert(name='mutt') # hopefully points to "unknown" in owner table
>
> Is there a way I could dynamically check the "owner" table and return the 
> id of the first row where isdefault==True whenever I define a new "dog" 
> without an owner?
> In the example above the "mutt" row should have owner==2 ("unknown" in the 
> owner table).
>
> Trying to put a function as the default argument does not work. I realize 
> I could set the owner to always be the first row in the table but I would 
> like something more robust and flexible.
>
> Thanks
> Vincent
>
>

[web2py] Re: Dynamic model creation

2012-06-07 Thread Anthony
Also, see this 
discussion: https://groups.google.com/d/msg/web2py/r0pLhvGi27Y/VtTibzxs6koJ

On Thursday, June 7, 2012 10:42:48 AM UTC-4, Anthony wrote:
>
> Once you specify a given type of object, will its schema always remain the 
> same? If so, you should be able to dynamically generate the DAL table 
> definition and have the DAL create the table. However, if you need to make 
> arbitrary dynamic changes to the schema within a given class of object, 
> you're probably better off with a document database like MongoDB. The DAL 
> does have an experimental MongoDB adapter, but I'm not sure how complete it 
> is and whether it could easily handle this use case -- if not, though, I 
> think MongoDB is fairly easy to work with natively via the Python driver.
>
> Anthony
>
> On Sunday, June 3, 2012 5:35:34 AM UTC-4, Christian wrote:
>>
>> Hello group,
>>
>> I found a backend service, mostly for mobile apps, called parse.com. 
>> Looking at their REST documentation (https://parse.com/docs/rest), it 
>> looks like one can e.g. dynamically generate different kind of objects, 
>> which get persistet (see "creating objects" in the docs to see what I 
>> mean). These objects can get relationships to other objects and can also be 
>> queried. So if the client posts GameScore or GameScores, both are valid 
>> (but different) objects (in different tables?)  and get persisted,
>> My questions: how looks sth. like this on the model side? How is this 
>> done? How to model general tables and still make them queryable. Or does 
>> the model generate tables dynamically? Could something like this be modeled 
>> with DAL? 
>> On the controller side: could such a dynamic model be made available via 
>> sth like @request.restful?
>>
>> I would be happy for any hint, as I have no idea, how this is done!
>>
>> Thanks and regards,
>> Christian
>>
>> P.S.: I also found a open source clone, which rebuilds the iOS client 
>> library and the server with node and MongoDB, if this might be of any help. 
>> I do not speak JS and have no clue about mongo. 
>> https://github.com/eaigner/DataKit
>>
>>

[web2py] default foreign key

2012-06-07 Thread Vincent
Hi,

I'm looking for a way to define a default foreign key dynamically.

For example if I have the following schema:

db.define_table('owner',Field('name', 'string'), 
Field('isdefault','boolean',default=False))
db.people.insert('name'='Bill')
db.people.insert('name'='unknown',isdefault=True)
db.define_table('dog', 
Field('name','string'),Field('owner',db.owner,default=))
db.dog.insert(name='Fido',owner=1)
db.dog.insert(name='mutt') # hopefully points to "unknown" in owner table

Is there a way I could dynamically check the "owner" table and return the 
id of the first row where isdefault==True whenever I define a new "dog" 
without an owner?
In the example above the "mutt" row should have owner==2 ("unknown" in the 
owner table).

Trying to put a function as the default argument does not work. I realize I 
could set the owner to always be the first row in the table but I would 
like something more robust and flexible.

Thanks
Vincent



[web2py] Re: backward-compatible CRYPT() upgrades

2012-06-07 Thread Anthony
https://groups.google.com/d/msg/web2py/WEiNGgDya58/ljDoE23gI8gJ

On Thursday, June 7, 2012 3:58:11 PM UTC-4, pbreit wrote:
>
> Bumping since another password compromise came out today (last.fm).
>
> I would like to at least salt my passwords. Also would be nice to have a 
> bcrypt option. Finally, would be nice to have an easy way to migrate an 
> existing set of users to new password scheme as they log in (or I've also 
> seen suggested encrypting current encrypted strings and then checking both 
> ways in the future).
>
>
>
> On Wednesday, June 6, 2012 9:35:41 AM UTC-7, pbreit wrote:
>>
>> Were these suggestions considered or deployed? In light of today's 
>> LinkedIn compromise, I am again searching for either a salted password or 
>> bcrypt solution.
>>
>>
>> On Friday, July 31, 2009 12:40:35 PM UTC-7, Jonathan Lundell wrote:
>>>
>>> There are several measures we might take to tighten up default security 
>>> in a backwards-compatible way.
>>>
>>> 1. Use IS_STRONG() by default in the welcome application template. 
>>>
>>> 2. Add salted hash methods, in particular a) random salt, and b) using 
>>> the user's email address as salt (it's not as good as random salt, but it 
>>> doesn't have to be appended to the hash, since it's already available).
>>>
>>> 3. Add a meta hash method for migrating hashes. Let a site that's using 
>>> currently using some WEAKHASH() (default CRYPT() in particular) to specify 
>>> a hash type of MIGRATEHASH(WEAKHASH, STRONGHASH). The rule for this method 
>>> is to always use STRONGHASH, with one exception: on login, if STRONGHASH 
>>> fails, try WEAKHASH. If WEAKHASH succeeds, then update the user table with 
>>> STRONGHASH.
>>>
>>> 4. Given (2) and (3), then by default CRYPT() could be redefined as 
>>> MIGRATEHASH(OLDCRYPT, STRONGHASH), for some strong hash.
>>>
>>> 5. Add a defense against blind brute-force attacks by rate-limiting 
>>> login attempts, but some method tbd.
>>>
>>> 6. Consider some mechanism that requires a user to choose a new password 
>>> (aging, perhaps), so that IS_STRONG can be enforced.
>>>
>>> 7. Encrypt the user table (or at least critical fields in it) with a 
>>> secret key, so that if someone gains access to the database, they don't get 
>>> access to email addresses or password hashes. This raises the question of 
>>> how to keep the secret key secret, but at the very least it can be kept 
>>> separate from the database, say in an access-controlled file in the 
>>> filesystem.
>>>
>>> 8. Note that (7) introduces the general problem of secret-key 
>>> management, which is also an issue for HMACs. Some general solution would 
>>> be nice.
>>>
>>> 9. Finally, none of this helps against a stolen-password attack. For 
>>> that, we ought to be supporting two-factor authentication. I assume that we 
>>> can do this already via third-party methods; perhaps we could identify 
>>> someone supporting something like the Verisign dongle.
>>>
>>

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Cliff Kachinske
It's not unusual to have a setup like this:

development box -> test box -> production box

The test box is a clone of the production box, as much as you can make it 
so.  No reason why it couldn't be a virtual machine, but it has to be there 
to prevent surprises due to different patch/version levels of the various 
packages in the system.

On Thursday, June 7, 2012 3:48:00 PM UTC-4, Derek wrote:
>
> Ah, it seemed to me this is just a development environment and thus you 
> wouldn't need this feature in production?
>
> On Thursday, May 31, 2012 2:47:51 PM UTC-7, Jonathan Lundell wrote:
>>
>> On May 31, 2012, at 2:32 PM, Derek wrote:
>>
>> If you're blowing away your database, why don't you clear memcached when 
>> you blow away your database? I don't see how this is a web2py issue.
>>
>>
>> One possible reason: web2py (and in particular my application) aren't 
>> necessarily the only memcached clients on the machine.
>>
>> Regardless, it's more a puzzle than an issue. I can certainly clear my 
>> caches manually, and that's in fact what I do now. But if there *were* a 
>> straightforward way to detect web2py restart from inside an app, that'd be 
>> handy in this particular case.
>>
>>
>> On Wednesday, May 30, 2012 7:10:13 PM UTC-7, Jonathan Lundell wrote:
>>>
>>> I've got an application that uses memcached. I'd like to recognize when 
>>> web2py gets restarted (mod_wsgi, fwiw) so I can flush my cache. No doubt I 
>>> can figure something out, but I'm sure I must be missing something obvious. 
>>> (My motivation: in my development environment, I sometimes blow away my 
>>> database when installing and starting a new copy of the app, and things get 
>>> confused when the cache is still holding data from the earlier run.)
>>
>>
>>
>>

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thank you so much for your reply. That took care of everything. 

Thank you very much for the tips. I know the code is very rough. I had just 
started on it when I ran into this problem, and I'm still fairly new to 
web2py and python. 

Thanks again for your help. 

Joel Robinson

On Thursday, June 7, 2012 3:34:46 PM UTC-5, Anthony wrote:
>
> Two problems:
>
>1. You are using partnum as a GET variable, but it is also the name of 
>one of the form fields, so when you submit the form, there is a "partnum" 
>in both the GET and the POST variables. When the same variable appears in 
>both the GET and POST variables, web2py puts them in a list in 
> request.vars 
>-- so, in this case, upon form submission, request.vars.partnum is 
>['12345', '12345'] instead of just '12345'. To avoid that problem, you 
>should refer specifically to request.get_vars.partnum instead of 
>request.vars.partnum.
>2. Issue #1 caused your query to return no results, but you don't have 
>any logic to check for no results (which would be a problem even without 
>issue #1), which is why you got an error ticket.
>
> Your code also includes some unnecessary checks and variable assignments. 
> Here's a much simpler version of the code:
>
> def update_inventory(): 
> if request.get_vars.partnum:
> row = db(db.invent.partnum == request.get_vars.partnum).select().
> first()
> return dict(record=crud.update(db.invent, row.id) if row
> else 'Part #%s not found' % request.get_vars.partnum)
> else:
> return dict(record="No part number. URL should read 
> update_inventory?part=12345")
>
> Note, I removed the check for duplicates:
>
> # check to make sure there are no double entries in database
> if(len(rows) > 1):
> record = "Database Error"
> return dict(record=record)  
>
> That shouldn't be necessary, because in your model definition, you have:
>
> Field('partnum', unique=True),
>
> Setting unique=True tells the database not to allow duplicates, so if you 
> try to enter a duplicate, you'll get an operational error from the 
> database. However, getting an error from the database isn't a friendly user 
> experience, so in addition to setting unique=True, you should also add an 
> IS_NOT_IN_DB 
> validatorto 
> the field -- the validator will be enforced at the form level and will 
> result in a friendly error message being displayed on the form when a 
> duplicate value is submitted:
>
> Field('partnum', unique=True,
> requires=IS_NOT_IN_DB(db, 'invent.partnum')),
>
> Anthony
>
> On Thursday, June 7, 2012 3:33:51 PM UTC-4, Joel Robinson wrote:
>>
>> Here's the code in a web2py module. You'll have to enter a few things in 
>> the database with the 
>> enter_inventory page.
>>
>> To see the problem enter, for example, part number 12345 and a quantity 
>> of 3 on the enter_inventory page. 
>> Once that is entered you can enter the following URL:
>> http://localhost:8000/GTV/default/update_inventory?partnum=12345
>>  
>> the page will initially come up correctly. But if you change the quantity 
>> from 3 to 2, for example, and then
>> hit the submit button, you will get an error. 
>>
>> Thanks again for you help with this
>>
>> Joel Robinson
>>
>>
>> On Thursday, June 7, 2012 12:38:46 PM UTC-5, Anthony wrote:
>>>
>>> Yeah, I think you'll have to show more code.
>>>
>>> On Thursday, June 7, 2012 12:58:45 PM UTC-4, Joel Robinson wrote:

 Thanks for the reply. I tried you sugestion but still no joy. I haven't 
 included all the code 
 so that the examples as simple as possible. I can try to attach some of 
 my code and send it
 to you if you wish. 

 If you add some code such as:
 else :
 record = 'No part number URL should read 
 "update_inventory?partnum=something"'
 return dict(record=record)

 then it returns that message when you submit an update, but the 
 database is still not being updated.


 On Thursday, June 7, 2012 11:11:41 AM UTC-5, Anthony wrote:
>
> What are you returning in case no rows are found? Also, you can 
> instead do:
>
> row = db(db.invent.partnum == request.vars.partnum).select().first()
> if row:
> etc.
>
> .first() returns the first row or None if there are no records.
>
> Anthony
>
> On Thursday, June 7, 2012 10:49:54 AM UTC-4, Joel Robinson wrote:
>>
>> Thanks for the reply, but its still not working correctly. I changed 
>> the code to the following:
>>
>> if rows:
>> row = rows[0]
>> record = crud.update(db.invent, row.id )
>> return dict(record=record)
>>
>> with a URL like:
>>
>> http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4
>>
>> I will get the correct web page, but when I change a va

Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Paolo Caruccio
"links" is a list so you could add more items to it.

links = [lambda row: A(T('action 1'),_href=URL("acontroller
","function1",args=[row.id])),
   lambda row: A(T('action 2'),_href=URL("acontroller
","function2",args=[row.id, row.field1])),
   lambda row: A(T('action 3'),_href=URL("acontroller
","function3",args=[row.id, row.field2]))] 


Il giorno giovedì 7 giugno 2012 13:25:46 UTC+2, cornelinux ha scritto:
>
>  
> Am 07.06.2012 12:46, schrieb Johann Spies: 
>
> On 7 June 2012 11:01, Cornelius Kölbel wrote:
>  
>>  Hi,
>> is it possible to add more than one button to a SQLFORM.smartgrid?
>>
>>  Yes.
>  
>
>>  At the moment I would add one button like this...
>> links = [lambda row: A(T('Add a contact to this 
>> customer'),_href=URL("customer","add_contact",args=[row.id]))]
>>
>>   
>  There will be a button for each item in links if you use links=links in 
> arguments for SQLFORM.smartgrid.
>
>  Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>
>  Hello Johann,
>
> thanks for your response.
> But I'd like to have two buttons per item, and I wonder if this could be 
> implemented.
> At the moment the lambda function returns one link for an item resulting 
> in one button per item.
>
> I can not figure out, what to pass, if I want to have several buttons and 
> I wonder if this is supported at all.
>
> Kind regards
> Cornelius 
>
> 

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Anthony
Two problems:

   1. You are using partnum as a GET variable, but it is also the name of 
   one of the form fields, so when you submit the form, there is a "partnum" 
   in both the GET and the POST variables. When the same variable appears in 
   both the GET and POST variables, web2py puts them in a list in request.vars 
   -- so, in this case, upon form submission, request.vars.partnum is 
   ['12345', '12345'] instead of just '12345'. To avoid that problem, you 
   should refer specifically to request.get_vars.partnum instead of 
   request.vars.partnum.
   2. Issue #1 caused your query to return no results, but you don't have 
   any logic to check for no results (which would be a problem even without 
   issue #1), which is why you got an error ticket.

Your code also includes some unnecessary checks and variable assignments. 
Here's a much simpler version of the code:

def update_inventory(): 
if request.get_vars.partnum:
row = db(db.invent.partnum == request.get_vars.partnum).select().
first()
return dict(record=crud.update(db.invent, row.id) if row
else 'Part #%s not found' % request.get_vars.partnum)
else:
return dict(record="No part number. URL should read 
update_inventory?part=12345")

Note, I removed the check for duplicates:

# check to make sure there are no double entries in database
if(len(rows) > 1):
record = "Database Error"
return dict(record=record)  

That shouldn't be necessary, because in your model definition, you have:

Field('partnum', unique=True),

Setting unique=True tells the database not to allow duplicates, so if you 
try to enter a duplicate, you'll get an operational error from the 
database. However, getting an error from the database isn't a friendly user 
experience, so in addition to setting unique=True, you should also add an 
IS_NOT_IN_DB 
validatorto 
the field -- the validator will be enforced at the form level and will 
result in a friendly error message being displayed on the form when a 
duplicate value is submitted:

Field('partnum', unique=True,
requires=IS_NOT_IN_DB(db, 'invent.partnum')),

Anthony

On Thursday, June 7, 2012 3:33:51 PM UTC-4, Joel Robinson wrote:
>
> Here's the code in a web2py module. You'll have to enter a few things in 
> the database with the 
> enter_inventory page.
>
> To see the problem enter, for example, part number 12345 and a quantity of 
> 3 on the enter_inventory page. 
> Once that is entered you can enter the following URL:
> http://localhost:8000/GTV/default/update_inventory?partnum=12345
>  
> the page will initially come up correctly. But if you change the quantity 
> from 3 to 2, for example, and then
> hit the submit button, you will get an error. 
>
> Thanks again for you help with this
>
> Joel Robinson
>
>
> On Thursday, June 7, 2012 12:38:46 PM UTC-5, Anthony wrote:
>>
>> Yeah, I think you'll have to show more code.
>>
>> On Thursday, June 7, 2012 12:58:45 PM UTC-4, Joel Robinson wrote:
>>>
>>> Thanks for the reply. I tried you sugestion but still no joy. I haven't 
>>> included all the code 
>>> so that the examples as simple as possible. I can try to attach some of 
>>> my code and send it
>>> to you if you wish. 
>>>
>>> If you add some code such as:
>>> else :
>>> record = 'No part number URL should read 
>>> "update_inventory?partnum=something"'
>>> return dict(record=record)
>>>
>>> then it returns that message when you submit an update, but the database 
>>> is still not being updated.
>>>
>>>
>>> On Thursday, June 7, 2012 11:11:41 AM UTC-5, Anthony wrote:

 What are you returning in case no rows are found? Also, you can instead 
 do:

 row = db(db.invent.partnum == request.vars.partnum).select().first()
 if row:
 etc.

 .first() returns the first row or None if there are no records.

 Anthony

 On Thursday, June 7, 2012 10:49:54 AM UTC-4, Joel Robinson wrote:
>
> Thanks for the reply, but its still not working correctly. I changed 
> the code to the following:
>
> if rows:
> row = rows[0]
> record = crud.update(db.invent, row.id )
> return dict(record=record)
>
> with a URL like:
>
> http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4
>
> I will get the correct web page, but when I change a value and hit the 
> submit button I just get sent to
> a page that says "None". If I reload the page the values are 
> unchanged.  Nothing was updated. 
>
> Joel Robinson
>
> On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote:
>>
>> Same problem -- everything has to go inside your "if rows:" block -- 
>> don't attempt to create a crud.update form if no rows have been returned.
>>
>> Anthony
>>
>> On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel 

[web2py] Re: Errors creating/reading tickets

2012-06-07 Thread Frederick Yankowski
The fix that I saw was just to ignore the exception during unpickling.  As 
selecta said at least that allows viewing the other tickets. It does not 
address the root problem of corrupted error files being created.

Re: [web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Bruno Rocha
This is a very nice tutorial -->  http://killer-web-development.com/


*Bruno Cezar Rocha*

http://www.CursoDePython.com.br
[image: Facebook]  [image:
Twitter] [image:
LinkedIn]  [image:
about.me] [image:
Amazon]  [image:
AngelList] [image:
Blog RSS]  [image:
Facebook Page]  [image:
foursquare] [image:
Google Plus]  [image:
pinterest]  [image:
SlideShare] [image:
YouTube] 
 [image: Google Talk] rochacbruno [image: Skype] blouweb
Blog: Updated: uwsgi + nginx script for Ubuntu
11.10
  Want a signature like mine?

Click
here.



On Thu, Jun 7, 2012 at 5:20 PM, Omar Ali wrote:

> Thank you all for your feedback. I suppose that's correct. I should try to
> change my way of thinking about writing applications from plain simple
> event-driven programming. It just felt so natural thinking about it that
> way...
>
> I will definitely go through the online manuals thoroughly and then if I
> have more questions, will come back here. This is actually my first ever
> forum post. I was always reluctant to post questions thinking I'd never get
> timely responses, but I read somewhere that I should give web2py a shot and
> see how "friendly" the community is.. :) so Good first experience.
>
> Hope to be able to add back to web2py. It looks good so far
>
>
> On Thursday, June 7, 2012 2:15:26 PM UTC+4, Omar Ali wrote:
>>
>> I'm a total newbie. I have programmed extensively during the VB days
>> (event driven programming) (I know, you'd hardly call that programming!) so
>> ... Web programming is taking a toll on me.
>>
>> Could someone explain to me the dynamics of web2py programming in a way
>> that an event driven programming dude can understand, maybe using analogies
>> and such..
>>
>>
>>


[web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Omar Ali
Thank you all for your feedback. I suppose that's correct. I should try to 
change my way of thinking about writing applications from plain simple 
event-driven programming. It just felt so natural thinking about it that 
way... 

I will definitely go through the online manuals thoroughly and then if I 
have more questions, will come back here. This is actually my first ever 
forum post. I was always reluctant to post questions thinking I'd never get 
timely responses, but I read somewhere that I should give web2py a shot and 
see how "friendly" the community is.. :) so Good first experience.

Hope to be able to add back to web2py. It looks good so far

On Thursday, June 7, 2012 2:15:26 PM UTC+4, Omar Ali wrote:
>
> I'm a total newbie. I have programmed extensively during the VB days 
> (event driven programming) (I know, you'd hardly call that programming!) so 
> ... Web programming is taking a toll on me.
>
> Could someone explain to me the dynamics of web2py programming in a way 
> that an event driven programming dude can understand, maybe using analogies 
> and such..
>
>
>

Re: [web2py] Re: backward-compatible CRYPT() upgrades

2012-06-07 Thread Richard Vézina
pbreit,

I think you should open up a issue also!


Richard

On Thu, Jun 7, 2012 at 4:00 PM, pbreit  wrote:

> For example:
>
> https://docs.djangoproject.com/en/dev/topics/auth/#password-upgrading
>
> "When users log in, if their passwords are stored with anything other
> than the preferred algorithm, Django will automatically upgrade the
> algorithm to the preferred one. This means that old installs of Django will
> get automatically more secure as users log in, and it also means that you
> can switch to new (and better) storage algorithms as they get invented."
>
>
>
> On Thursday, June 7, 2012 12:58:11 PM UTC-7, pbreit wrote:
>>
>> Bumping since another password compromise came out today (last.fm).
>>
>> I would like to at least salt my passwords. Also would be nice to have a
>> bcrypt option. Finally, would be nice to have an easy way to migrate an
>> existing set of users to new password scheme as they log in (or I've also
>> seen suggested encrypting current encrypted strings and then checking both
>> ways in the future).
>>
>>
>>
>> On Wednesday, June 6, 2012 9:35:41 AM UTC-7, pbreit wrote:
>>>
>>> Were these suggestions considered or deployed? In light of today's
>>> LinkedIn compromise, I am again searching for either a salted password or
>>> bcrypt solution.
>>>
>>>
>>> On Friday, July 31, 2009 12:40:35 PM UTC-7, Jonathan Lundell wrote:

 There are several measures we might take to tighten up default security
 in a backwards-compatible way.

 1. Use IS_STRONG() by default in the welcome application template.

 2. Add salted hash methods, in particular a) random salt, and b) using
 the user's email address as salt (it's not as good as random salt, but it
 doesn't have to be appended to the hash, since it's already available).

 3. Add a meta hash method for migrating hashes. Let a site that's using
 currently using some WEAKHASH() (default CRYPT() in particular) to specify
 a hash type of MIGRATEHASH(WEAKHASH, STRONGHASH). The rule for this method
 is to always use STRONGHASH, with one exception: on login, if STRONGHASH
 fails, try WEAKHASH. If WEAKHASH succeeds, then update the user table with
 STRONGHASH.

 4. Given (2) and (3), then by default CRYPT() could be redefined as
 MIGRATEHASH(OLDCRYPT, STRONGHASH), for some strong hash.

 5. Add a defense against blind brute-force attacks by rate-limiting
 login attempts, but some method tbd.

 6. Consider some mechanism that requires a user to choose a new
 password (aging, perhaps), so that IS_STRONG can be enforced.

 7. Encrypt the user table (or at least critical fields in it) with a
 secret key, so that if someone gains access to the database, they don't get
 access to email addresses or password hashes. This raises the question of
 how to keep the secret key secret, but at the very least it can be kept
 separate from the database, say in an access-controlled file in the
 filesystem.

 8. Note that (7) introduces the general problem of secret-key
 management, which is also an issue for HMACs. Some general solution would
 be nice.

 9. Finally, none of this helps against a stolen-password attack. For
 that, we ought to be supporting two-factor authentication. I assume that we
 can do this already via third-party methods; perhaps we could identify
 someone supporting something like the Verisign dongle.

>>>


[web2py] Re: backward-compatible CRYPT() upgrades

2012-06-07 Thread pbreit
For example:

https://docs.djangoproject.com/en/dev/topics/auth/#password-upgrading

"When users log in, if their passwords are stored with anything other than 
the preferred algorithm, Django will automatically upgrade the algorithm to 
the preferred one. This means that old installs of Django will get 
automatically more secure as users log in, and it also means that you can 
switch to new (and better) storage algorithms as they get invented."



On Thursday, June 7, 2012 12:58:11 PM UTC-7, pbreit wrote:
>
> Bumping since another password compromise came out today (last.fm).
>
> I would like to at least salt my passwords. Also would be nice to have a 
> bcrypt option. Finally, would be nice to have an easy way to migrate an 
> existing set of users to new password scheme as they log in (or I've also 
> seen suggested encrypting current encrypted strings and then checking both 
> ways in the future).
>
>
>
> On Wednesday, June 6, 2012 9:35:41 AM UTC-7, pbreit wrote:
>>
>> Were these suggestions considered or deployed? In light of today's 
>> LinkedIn compromise, I am again searching for either a salted password or 
>> bcrypt solution.
>>
>>
>> On Friday, July 31, 2009 12:40:35 PM UTC-7, Jonathan Lundell wrote:
>>>
>>> There are several measures we might take to tighten up default security 
>>> in a backwards-compatible way.
>>>
>>> 1. Use IS_STRONG() by default in the welcome application template. 
>>>
>>> 2. Add salted hash methods, in particular a) random salt, and b) using 
>>> the user's email address as salt (it's not as good as random salt, but it 
>>> doesn't have to be appended to the hash, since it's already available).
>>>
>>> 3. Add a meta hash method for migrating hashes. Let a site that's using 
>>> currently using some WEAKHASH() (default CRYPT() in particular) to specify 
>>> a hash type of MIGRATEHASH(WEAKHASH, STRONGHASH). The rule for this method 
>>> is to always use STRONGHASH, with one exception: on login, if STRONGHASH 
>>> fails, try WEAKHASH. If WEAKHASH succeeds, then update the user table with 
>>> STRONGHASH.
>>>
>>> 4. Given (2) and (3), then by default CRYPT() could be redefined as 
>>> MIGRATEHASH(OLDCRYPT, STRONGHASH), for some strong hash.
>>>
>>> 5. Add a defense against blind brute-force attacks by rate-limiting 
>>> login attempts, but some method tbd.
>>>
>>> 6. Consider some mechanism that requires a user to choose a new password 
>>> (aging, perhaps), so that IS_STRONG can be enforced.
>>>
>>> 7. Encrypt the user table (or at least critical fields in it) with a 
>>> secret key, so that if someone gains access to the database, they don't get 
>>> access to email addresses or password hashes. This raises the question of 
>>> how to keep the secret key secret, but at the very least it can be kept 
>>> separate from the database, say in an access-controlled file in the 
>>> filesystem.
>>>
>>> 8. Note that (7) introduces the general problem of secret-key 
>>> management, which is also an issue for HMACs. Some general solution would 
>>> be nice.
>>>
>>> 9. Finally, none of this helps against a stolen-password attack. For 
>>> that, we ought to be supporting two-factor authentication. I assume that we 
>>> can do this already via third-party methods; perhaps we could identify 
>>> someone supporting something like the Verisign dongle.
>>>
>>

[web2py] Re: backward-compatible CRYPT() upgrades

2012-06-07 Thread pbreit
Bumping since another password compromise came out today (last.fm).

I would like to at least salt my passwords. Also would be nice to have a 
bcrypt option. Finally, would be nice to have an easy way to migrate an 
existing set of users to new password scheme as they log in (or I've also 
seen suggested encrypting current encrypted strings and then checking both 
ways in the future).



On Wednesday, June 6, 2012 9:35:41 AM UTC-7, pbreit wrote:
>
> Were these suggestions considered or deployed? In light of today's 
> LinkedIn compromise, I am again searching for either a salted password or 
> bcrypt solution.
>
>
> On Friday, July 31, 2009 12:40:35 PM UTC-7, Jonathan Lundell wrote:
>>
>> There are several measures we might take to tighten up default security 
>> in a backwards-compatible way.
>>
>> 1. Use IS_STRONG() by default in the welcome application template. 
>>
>> 2. Add salted hash methods, in particular a) random salt, and b) using 
>> the user's email address as salt (it's not as good as random salt, but it 
>> doesn't have to be appended to the hash, since it's already available).
>>
>> 3. Add a meta hash method for migrating hashes. Let a site that's using 
>> currently using some WEAKHASH() (default CRYPT() in particular) to specify 
>> a hash type of MIGRATEHASH(WEAKHASH, STRONGHASH). The rule for this method 
>> is to always use STRONGHASH, with one exception: on login, if STRONGHASH 
>> fails, try WEAKHASH. If WEAKHASH succeeds, then update the user table with 
>> STRONGHASH.
>>
>> 4. Given (2) and (3), then by default CRYPT() could be redefined as 
>> MIGRATEHASH(OLDCRYPT, STRONGHASH), for some strong hash.
>>
>> 5. Add a defense against blind brute-force attacks by rate-limiting login 
>> attempts, but some method tbd.
>>
>> 6. Consider some mechanism that requires a user to choose a new password 
>> (aging, perhaps), so that IS_STRONG can be enforced.
>>
>> 7. Encrypt the user table (or at least critical fields in it) with a 
>> secret key, so that if someone gains access to the database, they don't get 
>> access to email addresses or password hashes. This raises the question of 
>> how to keep the secret key secret, but at the very least it can be kept 
>> separate from the database, say in an access-controlled file in the 
>> filesystem.
>>
>> 8. Note that (7) introduces the general problem of secret-key management, 
>> which is also an issue for HMACs. Some general solution would be nice.
>>
>> 9. Finally, none of this helps against a stolen-password attack. For 
>> that, we ought to be supporting two-factor authentication. I assume that we 
>> can do this already via third-party methods; perhaps we could identify 
>> someone supporting something like the Verisign dongle.
>>
>

[web2py] Re: Errors creating/reading tickets

2012-06-07 Thread Derek
The issue has been fixed in trunk. If you want the fix, you'll have to use 
the source version or wait for the next release.

On Thursday, June 7, 2012 4:40:28 AM UTC-7, Chris wrote:
>
> Following up on some of the clues others have suggested -- I have this 
> problem when running web2py version 1.99.7 on Red Hat Enterprise 6.2 (very 
> similar to CentOS) and mod_wsgi with Apache.
>
> Happy to provide copies of the error tickets if that would help with 
> troubleshooting -- ?
>
>
>
> On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>>
>> This has actually been plaguing me for a while but finally annoyed me 
>> enough to ask.  I have several web2py (1.99.4) apps running under 
>> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
>> not when an error happens and a ticket is generated, the ticket seems to be 
>> corrupt.  Attempting to view the ticket creates another error for which the 
>> ticket says something like:
>>
>>  Version  web2py™ (1, 99, 4, 
>> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
>> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>>
>> Traceback (most recent call last):
>>   File "C:\vantage_dashboard\xampp\web2py\gluon\restricted.py", line 204, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py"
>>  , line 
>> 1341, in 
>>   File "C:\vantage_dashboard\xampp\web2py\gluon\globals.py", line 172, in 
>> 
>> self._caller = lambda f: f()
>>   File 
>> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py"
>>  , line 
>> 1082, in errors
>> error = pickle.load(fullpath_file)
>>   File "C:\Python26\Lib\pickle.py", line 1370, in load
>> return Unpickler(file).load()
>>   File "C:\Python26\Lib\pickle.py", line 858, in load
>> dispatch[key](self)
>>   File "C:\Python26\Lib\pickle.py", line 880, in load_eof
>> raise EOFError
>> EOFError
>>
>>
>> Which means that I have to attempt to read the original error ticket in a 
>> text editor which is just slightly less than idea.  Any ideas what might be 
>> happening? This problem doesn't seem to happen in my dev environment (also 
>> Windows but just using rocket instead of apache/mod_wsgi).
>>
>> Thanks,
>> Brian
>>
>
> On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>>
>> This has actually been plaguing me for a while but finally annoyed me 
>> enough to ask.  I have several web2py (1.99.4) apps running under 
>> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
>> not when an error happens and a ticket is generated, the ticket seems to be 
>> corrupt.  Attempting to view the ticket creates another error for which the 
>> ticket says something like:
>>
>>  Version  web2py™ (1, 99, 4, 
>> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
>> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>>
>> Traceback (most recent call last):
>>   File "C:\vantage_dashboard\xampp\web2py\gluon\restricted.py", line 204, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py"
>>  , line 
>> 1341, in 
>>   File "C:\vantage_dashboard\xampp\web2py\gluon\globals.py", line 172, in 
>> 
>> self._caller = lambda f: f()
>>   File 
>> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py"
>>  , line 
>> 1082, in errors
>> error = pickle.load(fullpath_file)
>>   File "C:\Python26\Lib\pickle.py", line 1370, in load
>> return Unpickler(file).load()
>>   File "C:\Python26\Lib\pickle.py", line 858, in load
>> dispatch[key](self)
>>   File "C:\Python26\Lib\pickle.py", line 880, in load_eof
>> raise EOFError
>> EOFError
>>
>>
>> Which means that I have to attempt to read the original error ticket in a 
>> text editor which is just slightly less than idea.  Any ideas what might be 
>> happening? This problem doesn't seem to happen in my dev environment (also 
>> Windows but just using rocket instead of apache/mod_wsgi).
>>
>> Thanks,
>> Brian
>>
>
> On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>>
>> This has actually been plaguing me for a while but finally annoyed me 
>> enough to ask.  I have several web2py (1.99.4) apps running under 
>> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
>> not when an error happens and a ticket is generated, the ticket seems to be 

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Derek
Ah, it seemed to me this is just a development environment and thus you 
wouldn't need this feature in production?

On Thursday, May 31, 2012 2:47:51 PM UTC-7, Jonathan Lundell wrote:
>
> On May 31, 2012, at 2:32 PM, Derek wrote:
>
> If you're blowing away your database, why don't you clear memcached when 
> you blow away your database? I don't see how this is a web2py issue.
>
>
> One possible reason: web2py (and in particular my application) aren't 
> necessarily the only memcached clients on the machine.
>
> Regardless, it's more a puzzle than an issue. I can certainly clear my 
> caches manually, and that's in fact what I do now. But if there *were* a 
> straightforward way to detect web2py restart from inside an app, that'd be 
> handy in this particular case.
>
>
> On Wednesday, May 30, 2012 7:10:13 PM UTC-7, Jonathan Lundell wrote:
>>
>> I've got an application that uses memcached. I'd like to recognize when 
>> web2py gets restarted (mod_wsgi, fwiw) so I can flush my cache. No doubt I 
>> can figure something out, but I'm sure I must be missing something obvious. 
>> (My motivation: in my development environment, I sometimes blow away my 
>> database when installing and starting a new copy of the app, and things get 
>> confused when the cache is still holding data from the earlier run.)
>
>
>
>

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2012-06-07 Thread Leopold
I am not committed to cherokee and if this goes unsolved then I would be 
forced to choose another webserver, Apache seems overkill since my app is 
only used by intranet users; I am taking a look at Nginx at the moment. 
Still, I'm a bit reluctant to just forget about it since it worked 
wonderfully until now and I have a feeling it may be just a minor thing but 
I just cant find what it is.

Anyway thanks for the suggestion but in the meantime if somebody knows how 
to fix this please post, even it is just for future reference...

On Thursday, June 7, 2012 12:07:03 PM UTC-7, pbreit wrote:
>
> Are you committed to Cherokee? I would advise against that since 
> development has stalled/stopped and instead consider Apache or Nginx. If 
> Nginx, web2py includes a setup script:
>
> http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
>
> You can either run the script as-is or, a better idea is to just manually 
> run each step so you get an understanding for what's going on and can fix 
> any problems.
>
>

[web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Cliff Kachinske
Some googles:

http request
http response



On Thursday, June 7, 2012 6:15:26 AM UTC-4, Omar Ali wrote:
>
> I'm a total newbie. I have programmed extensively during the VB days 
> (event driven programming) (I know, you'd hardly call that programming!) so 
> ... Web programming is taking a toll on me.
>
> Could someone explain to me the dynamics of web2py programming in a way 
> that an event driven programming dude can understand, maybe using analogies 
> and such..
>
>
>

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-06-07 Thread Luc Chase
I would say a CMS becomes a wiki when it allows links to pages which don't
yet exist ( it dynamically creates it when the link is created).
On Jun 7, 2012 8:07 PM, "Andrew"  wrote:

> Yes, me too.
> Can anyone point me to the documentation referenced on the movu.ca home
> page?  I would like to see what it looks like as a plain cms without the
> social bits, or maybe making some of it available.
>
> To add to this thread,  I've installed Movuca, instant press, and plugin
> wiki,  just to check them out.Although I'm not clear when a wiki
> becomes a cms, or the other way around.
>
> Anyway, having all of them is great.  I have to make a choice for my pet
> project,  but I hope they all continue.
>


Re: [web2py] Dynamic model creation

2012-06-07 Thread Andrew
Check out http://www.web2pyslices.com/slice/show/1491/plugin-lookout

I have a need to open up other databases and inspect their structures, by 
looking at the other system's catalog.  The slice above also does that.


[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2012-06-07 Thread pbreit
Are you committed to Cherokee? I would advise against that since 
development has stalled/stopped and instead consider Apache or Nginx. If 
Nginx, web2py includes a setup script:
http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

You can either run the script as-is or, a better idea is to just manually 
run each step so you get an understanding for what's going on and can fix 
any problems.



On Thursday, June 7, 2012 11:50:06 AM UTC-7, Leopold wrote:
>
> Hello everyone, I'm in need of help to get this configuration (ubuntu + 
> cherokee + web2py + uwsgi) running.
> I used a very similar how to on this (this happened many months ago) and 
> everything worked perfectly.
>
> When I followed the instructions I had an ubuntu version with python 2.6 
> but when I decided to upgrade to ubuntu 12.04 (python 2.7) the problem 
> started. Initially the problem was the 503 Service Unavailable message and 
> by looking at the logs it was obvious the change in python version was 
> responsible for this since uwsgi was saying libpython2.6.so.1.0 missing or 
> something like that. So I reinstalled the latest uwsgi built with python 
> 2.7 and the 503 error went away. However I still couldn't get my web2py app 
> to show, I now get:
>
> *uWSGI Error*Python application not found
>
> I searched all over for this but I can't find how to fix it. I'm posting 
> the cherokee error log and the uwsgi config file hoping you can help me.
>
>
> # cat /var/log/cherokee/cherokee.error
> [uWSGI] parsing config file /var/web2py/config.xml
> [WARNING] option "app" is deprecated: use the more advanced "mount" option
> *** Starting uWSGI 1.2.3 (32bit) on [Thu Jun  7 11:19:17 2012] ***
> compiled with version: 4.6.3 on 07 June 2012 09:24:31
> detected number of CPU cores: 1
> current working directory: /
> detected binary path: /usr/bin/uwsgi
> *** WARNING: you are running uWSGI without its master process manager ***
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> uwsgi socket 0 bound to TCP address 127.0.0.1:40890 fd 4
> Python version: 2.7.3 (default, Apr 20 2012, 23:06:40)  [GCC 4.6.3]
> *** Python threads support is disabled. You can enable it with 
> --enable-threads ***
> Python main interpreter initialized at 0x896f8a0
> your server socket listen backlog is limited to 100 connections
> *** Operational MODE: single process ***
> added /var/web2py/ to pythonpath.
> mounting wsgihandler on /
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI worker 1 (and the only) (pid: 7903, cores: 1)
> [pid: 7903|app: -1|req: -1/1] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
> Jun  7 11:19:17 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> [pid: 7903|app: -1|req: -1/2] 192.1.209.75 () {56 vars in 922 bytes} [Thu 
> Jun  7 11:20:01 2012] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 
> 2 headers in 63 bytes (0 switches on core 0)
> [pid: 7903|app: -1|req: -1/3] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
> Jun  7 11:20:01 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> [pid: 7903|app: -1|req: -1/4] 192.1.209.75 () {54 vars in 891 bytes} [Thu 
> Jun  7 11:20:09 2012] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 
> 2 headers in 63 bytes (0 switches on core 0)
> [pid: 7903|app: -1|req: -1/5] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
> Jun  7 11:20:09 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
>
>
> # cat /var/web2py/config.xml
> 
> /var/web2py/
> 
> wsgihandler
> 
> 
>
> cherokee interpreter:
> /usr/bin/uwsgi -s 127.0.0.1:40890 -x /var/web2py/config.xml
>
>
> Thanks in advance.
>
> On Thursday, January 14, 2010 2:14:09 PM UTC-8, Ivan P wrote:
>>
>> Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
>> FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
>> method and decided to try uWSGI. I am happy I did so, since it proved
>> to be real easy and uWSGI is a real powerhouse and deserves attention
>> of the whole python webdev community. On to the howto.
>>
>> I. Compile from source and run the latest uWSGI, 0.9.3 in my case
>> (available here http://projects.unbit.it/uwsgi/wiki).
>> 1. Download the source from and unzip.
>>
>> 2. To compile you must install packages python-dev and libxml2-dev (at
>> least thats what they are called on a debian-based system)
>>
>> 3. When compiling simply run pick a makefile which matches your OS and
>> python version and run something like "make -f Makefile.Linux.Py26".
>> This produces only one executable named uwsgi26, where 26 is my python
>> version. You can put it in /usr/local/bin.
>>
>> 5. To run it, you have two options:
>>
>> 5a) Create an x

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-06-07 Thread Andrew
Yes, me too.  
Can anyone point me to the documentation referenced on the movu.ca home page?  
I would like to see what it looks like as a plain cms without the social bits, 
or maybe making some of it available.

To add to this thread,  I've installed Movuca, instant press, and plugin wiki,  
just to check them out.Although I'm not clear when a wiki becomes a cms, or 
the other way around.

Anyway, having all of them is great.  I have to make a choice for my pet 
project,  but I hope they all continue. 


[web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread pbreit
I'd suggest running through the "Overview":
http://web2py.com/books/default/chapter/29/3

If I understand correctly, you're not going to see "event driven 
programming". Basic web programming is "Request > Build Response > Send 
Response back to the User".


On Thursday, June 7, 2012 3:15:26 AM UTC-7, Omar Ali wrote:
>
> I'm a total newbie. I have programmed extensively during the VB days 
> (event driven programming) (I know, you'd hardly call that programming!) so 
> ... Web programming is taking a toll on me.
>
> Could someone explain to me the dynamics of web2py programming in a way 
> that an event driven programming dude can understand, maybe using analogies 
> and such..
>
>
>

Re: [web2py] Dynamic model creation

2012-06-07 Thread pbreit
I'm not sure it's a Web2py limitation so much as an SQL limitation. You 
actually might be able to implement dynamic schemas in Web2py I guess by 
building your define_tables() on-the-fly but it doesn't sound like the best 
idea (you'd need to be doing a lot of unpredictable migrations).

But dynamic schemas are where NoSQL DBs really shine. There's some degree 
of support for Mongo in Web2py but I think it's fairly preliminary.

You could also program directly to Mongo but you'd lose DAL features (which 
might not be too bad).


On Thursday, June 7, 2012 3:47:00 AM UTC-7, Christian wrote:
>
> Hi pbreit and thanks for the reply.
> So web2py is not the preferred way to go as DAL needs a scheme? Is there 
> no way to integrate DAL in a dynamic way?
>
> Regards,
> Christian
>
> Am Sonntag, 3. Juni 2012 schrieb pbreit :
>
>> My guess is it's NoSQL, probably Mongo which seems to be the preferred DB 
>> behind a lot of these "real-time" JavaScript frameworks.
>>
>>
>> On Sunday, June 3, 2012 2:35:34 AM UTC-7, Christian wrote:
>>>
>>> Hello group,
>>>
>>> I found a backend service, mostly for mobile apps, called parse.com. 
>>> Looking at their REST documentation (https://parse.com/docs/rest), it 
>>> looks like one can e.g. dynamically generate different kind of objects, 
>>> which get persistet (see "creating objects" in the docs to see what I 
>>> mean). These objects can get relationships to other objects and can also be 
>>> queried. So if the client posts GameScore or GameScores, both are valid 
>>> (but different) objects (in different tables?)  and get persisted,
>>> My questions: how looks sth. like this on the model side? How is this 
>>> done? How to model general tables and still make them queryable. Or does 
>>> the model generate tables dynamically? Could something like this be modeled 
>>> with DAL? 
>>> On the controller side: could such a dynamic model be made available via 
>>> sth like @request.restful?
>>>
>>> I would be happy for any hint, as I have no idea, how this is done!
>>>
>>> Thanks and regards,
>>> Christian
>>>
>>> P.S.: I also found a open source clone, which rebuilds the iOS client 
>>> library and the server with node and MongoDB, if this might be of any help. 
>>> I do not speak JS and have no clue about mongo. 
>>> https://github.com/eaigner/**DataKit
>>>
>>>

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2012-06-07 Thread Leopold
Hello everyone, I'm in need of help to get this configuration (ubuntu + 
cherokee + web2py + uwsgi) running.
I used a very similar how to on this (this happened many months ago) and 
everything worked perfectly.

When I followed the instructions I had an ubuntu version with python 2.6 
but when I decided to upgrade to ubuntu 12.04 (python 2.7) the problem 
started. Initially the problem was the 503 Service Unavailable message and 
by looking at the logs it was obvious the change in python version was 
responsible for this since uwsgi was saying libpython2.6.so.1.0 missing or 
something like that. So I reinstalled the latest uwsgi built with python 
2.7 and the 503 error went away. However I still couldn't get my web2py app 
to show, I now get:

*uWSGI Error*Python application not found

I searched all over for this but I can't find how to fix it. I'm posting 
the cherokee error log and the uwsgi config file hoping you can help me.


# cat /var/log/cherokee/cherokee.error
[uWSGI] parsing config file /var/web2py/config.xml
[WARNING] option "app" is deprecated: use the more advanced "mount" option
*** Starting uWSGI 1.2.3 (32bit) on [Thu Jun  7 11:19:17 2012] ***
compiled with version: 4.6.3 on 07 June 2012 09:24:31
detected number of CPU cores: 1
current working directory: /
detected binary path: /usr/bin/uwsgi
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address 127.0.0.1:40890 fd 4
Python version: 2.7.3 (default, Apr 20 2012, 23:06:40)  [GCC 4.6.3]
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0x896f8a0
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
added /var/web2py/ to pythonpath.
mounting wsgihandler on /
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 7903, cores: 1)
[pid: 7903|app: -1|req: -1/1] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
Jun  7 11:19:17 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 7903|app: -1|req: -1/2] 192.1.209.75 () {56 vars in 922 bytes} [Thu 
Jun  7 11:20:01 2012] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 
2 headers in 63 bytes (0 switches on core 0)
[pid: 7903|app: -1|req: -1/3] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
Jun  7 11:20:01 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 7903|app: -1|req: -1/4] 192.1.209.75 () {54 vars in 891 bytes} [Thu 
Jun  7 11:20:09 2012] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 
2 headers in 63 bytes (0 switches on core 0)
[pid: 7903|app: -1|req: -1/5] 192.1.209.75 () {54 vars in 875 bytes} [Thu 
Jun  7 11:20:09 2012] GET /favicon.ico => generated 48 bytes in 0 msecs 
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)


# cat /var/web2py/config.xml

/var/web2py/

wsgihandler



cherokee interpreter:
/usr/bin/uwsgi -s 127.0.0.1:40890 -x /var/web2py/config.xml


Thanks in advance.

On Thursday, January 14, 2010 2:14:09 PM UTC-8, Ivan P wrote:
>
> Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
> FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> method and decided to try uWSGI. I am happy I did so, since it proved
> to be real easy and uWSGI is a real powerhouse and deserves attention
> of the whole python webdev community. On to the howto.
>
> I. Compile from source and run the latest uWSGI, 0.9.3 in my case
> (available here http://projects.unbit.it/uwsgi/wiki).
> 1. Download the source from and unzip.
>
> 2. To compile you must install packages python-dev and libxml2-dev (at
> least thats what they are called on a debian-based system)
>
> 3. When compiling simply run pick a makefile which matches your OS and
> python version and run something like "make -f Makefile.Linux.Py26".
> This produces only one executable named uwsgi26, where 26 is my python
> version. You can put it in /usr/local/bin.
>
> 5. To run it, you have two options:
>
> 5a) Create an xml file and call it, for example, config.xml. Put
> something like this in it:
> 
> /var/web2py/
> 
> wsgihandler
> 
> 
> In this file "pythonpath" is where your web2py directory is and
> "script" is the file you want to run, in this case its web2py's
> "wsgihandler.py". Now run uWSGI like this, but replace "www-data" with
> the owner of your web2py directory, if its the same as your current
> user omit the sudo command:
> sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml
> Why you need to change user is because web2py writes things (session
> data for example) to disc during execution, so the uwsgi process,
> which runs the w

[web2py] Re: For all users using web2py editor on Firefox: solution to the "blurry" or "ghosty" text

2012-06-07 Thread Andrew
I use the trunk editor with Firefox and it works well.  Ie7 on the other hand,  
no line wrap.


Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Anthony
I'm not sure if this is in stable, but in trunk you can specify 
dictionaries of args to pass to SQLFORM, including separate dictionaries 
for create, edit, and view forms: 
http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#1500.

Anthony

On Thursday, June 7, 2012 2:02:34 PM UTC-4, Doug Philips wrote:
>
> On 6/7/12, Richard Vézina  wrote: 
> > I am almost sure I saw a email were Massimo explain how to set a 
> different 
> > text for "submit" button, can't find it back... 
> > 
> > Have you try with SQLFORM attribute ? Or SQLFORM attribute with "_" 
> before 
> > : _submit_button = 'Submit' 
>
> Well, I looked at the code in gluon/sqlhtml.py 
> the SQLFORM class @staticmethod grid() does not take submit_button or 
> _submit_button and doesn't (so far as I can tell) accept *args or 
> **kwargs parameters. Further, the code itself for handling the edit 
> case creates a SQLFORM and passes in the submit_button parameter with 
> a hard coded value. But I'm new to this code base and there may be 
> other paths or other places where things are changed after they are 
> made... 
>
> Thanks! 
>  --Doug 
>


Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Richard Vézina
Do you have the latest trunk?

Because, web2py change rapidly...

Richard

On Thu, Jun 7, 2012 at 2:02 PM, Doug Philips wrote:

> On 6/7/12, Richard Vézina  wrote:
> > I am almost sure I saw a email were Massimo explain how to set a
> different
> > text for "submit" button, can't find it back...
> >
> > Have you try with SQLFORM attribute ? Or SQLFORM attribute with "_"
> before
> > : _submit_button = 'Submit'
>
> Well, I looked at the code in gluon/sqlhtml.py
> the SQLFORM class @staticmethod grid() does not take submit_button or
> _submit_button and doesn't (so far as I can tell) accept *args or
> **kwargs parameters. Further, the code itself for handling the edit
> case creates a SQLFORM and passes in the submit_button parameter with
> a hard coded value. But I'm new to this code base and there may be
> other paths or other places where things are changed after they are
> made...
>
> Thanks!
>  --Doug
>


Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Doug Philips
On 6/7/12, Richard Vézina  wrote:
> I am almost sure I saw a email were Massimo explain how to set a different
> text for "submit" button, can't find it back...
>
> Have you try with SQLFORM attribute ? Or SQLFORM attribute with "_" before
> : _submit_button = 'Submit'

Well, I looked at the code in gluon/sqlhtml.py
the SQLFORM class @staticmethod grid() does not take submit_button or
_submit_button and doesn't (so far as I can tell) accept *args or
**kwargs parameters. Further, the code itself for handling the edit
case creates a SQLFORM and passes in the submit_button parameter with
a hard coded value. But I'm new to this code base and there may be
other paths or other places where things are changed after they are
made...

Thanks!
 --Doug


[web2py] Re: For all users using web2py editor on Firefox: solution to the "blurry" or "ghosty" text

2012-06-07 Thread sesenmaister
Sorry, the good value for *document.getElementById('**
textarea').style.opacity* is *0.1*

Value 0, is thiner than in chrome and the cursor disappear.


Re: [web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Richard Vézina
I am almost sure I saw a email were Massimo explain how to set a different
text for "submit" button, can't find it back...

Have you try with SQLFORM attribute ? Or SQLFORM attribute with "_" before
: _submit_button = 'Submit'

Richard

On Thu, Jun 7, 2012 at 1:20 PM, Doug Philips wrote:

> I know that SQLFORM.grid is marked experimental and thus I shouldn't
> expect it to be as refined as some of the other parts of web2py, but
> I'm hoping that also means it is still a bit open to adjustment?
>
> SQLFORM.grid has saved me a ton of work, but there are few things I
> wish it did slightly better.
>
> 1. The 'Add' button's button text seems to be hard coded. I'd like to
> make that a parameter with a default value of 'Add' (in some forms,
> 'Add' is ok, and in others I'd like to set it to something else, such
> as 'New Proposal').
>
> 2. The submit button's button text on the edit forms for a row (the
> ones you get when use the 'edit' button from the tabular view) is hard
> coded to 'Submit'. I'd like to suggest changing it to a parameter and
> making the default value of that parameter be 'Save Changes'.
>
> 3. Would it be OK to add a "separator" parameter, as in the base
> SQLFORM? (I've gone into the code to just change the hard coded
> value.)
>
> I'll make bug tracker entries (one or three) unless the current
> behaviour can't be changed.
>
> Thanks!
>  --Doug
>


[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Anthony
Yeah, I think you'll have to show more code.

On Thursday, June 7, 2012 12:58:45 PM UTC-4, Joel Robinson wrote:
>
> Thanks for the reply. I tried you sugestion but still no joy. I haven't 
> included all the code 
> so that the examples as simple as possible. I can try to attach some of my 
> code and send it
> to you if you wish. 
>
> If you add some code such as:
> else :
> record = 'No part number URL should read 
> "update_inventory?partnum=something"'
> return dict(record=record)
>
> then it returns that message when you submit an update, but the database 
> is still not being updated.
>
>
> On Thursday, June 7, 2012 11:11:41 AM UTC-5, Anthony wrote:
>>
>> What are you returning in case no rows are found? Also, you can instead 
>> do:
>>
>> row = db(db.invent.partnum == request.vars.partnum).select().first()
>> if row:
>> etc.
>>
>> .first() returns the first row or None if there are no records.
>>
>> Anthony
>>
>> On Thursday, June 7, 2012 10:49:54 AM UTC-4, Joel Robinson wrote:
>>>
>>> Thanks for the reply, but its still not working correctly. I changed the 
>>> code to the following:
>>>
>>> if rows:
>>> row = rows[0]
>>> record = crud.update(db.invent, row.id )
>>> return dict(record=record)
>>>
>>> with a URL like:
>>>
>>> http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4
>>>
>>> I will get the correct web page, but when I change a value and hit the 
>>> submit button I just get sent to
>>> a page that says "None". If I reload the page the values are unchanged.  
>>> Nothing was updated. 
>>>
>>> Joel Robinson
>>>
>>> On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote:

 Same problem -- everything has to go inside your "if rows:" block -- 
 don't attempt to create a crud.update form if no rows have been returned.

 Anthony

 On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel Robinson wrote:
>
> Thanks for the reply. I tried your sugestion but am still getting an 
> error, though a different one:
>
> Traceback (most recent call last):
>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
> restricted
> exec ccode in environment
>   File 
> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> ,
>  line 136, in 
>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
> self._caller = lambda f: f()
>   File 
> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> ,
>  line 131, in update_inventory
> record = crud.update(db.invent, row.id )
> UnboundLocalError: local variable 'row' referenced before assignment
>
> Just to be clear the page is coming up initialy. This error only happens 
> when I click
> on the submit button. Thanks again for your help.
>
> Joel Robinson
>
>
>
> On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:
>>
>> Looks like the error is at
>>
>> row = rows[0] 
>>
>> because rows is empty (no records matching query). You need a check 
>> like 
>>
>> if rows:
>> row = rows[0]
>>
>>
>>
>> On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>>>
>>> First, let me give some background on what I've been trying to do. 
>>> We wanted to set up an inventory system using QR codes which would be 
>>> put 
>>> on stickers on our stock and then scaned with smartphone when removing 
>>> inventory bring up the appropiate web page. The QR code should contain 
>>> something like: 
>>> 
>>> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>>>
>>> and the following is the code I wrote for update_inventory:
>>>
>>> rows = db(db.invent.partnum == request.vars.partnum).select() 
>>> # change rows object to row object
>>> row = rows[0]
>>> 
>>> # display queried object
>>> record = crud.update(db.invent, row.id)
>>> return dict(record=record)
>>>  
>>> initialy it would work fine it would run the query and pull up the 
>>> correct record but 
>>> if I tried to update the record I would get the folling error:
>>> 
>>>
>>> Traceback (most recent call last):
>>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>>> restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>>> ,
>>>  line 123, in 
>>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File 
>>> "/

[web2py] SQLFORM.grid - questions/suggestions

2012-06-07 Thread Doug Philips
I know that SQLFORM.grid is marked experimental and thus I shouldn't
expect it to be as refined as some of the other parts of web2py, but
I'm hoping that also means it is still a bit open to adjustment?

SQLFORM.grid has saved me a ton of work, but there are few things I
wish it did slightly better.

1. The 'Add' button's button text seems to be hard coded. I'd like to
make that a parameter with a default value of 'Add' (in some forms,
'Add' is ok, and in others I'd like to set it to something else, such
as 'New Proposal').

2. The submit button's button text on the edit forms for a row (the
ones you get when use the 'edit' button from the tabular view) is hard
coded to 'Submit'. I'd like to suggest changing it to a parameter and
making the default value of that parameter be 'Save Changes'.

3. Would it be OK to add a "separator" parameter, as in the base
SQLFORM? (I've gone into the code to just change the hard coded
value.)

I'll make bug tracker entries (one or three) unless the current
behaviour can't be changed.

Thanks!
 --Doug


Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Michele Comitini
2012/6/7 Carl Roach :
> Larry, I really enjoyed coding in Pyjs. GWT/Java involves a lot of hoops
> which I'm jumping through.
Of course its Java.

> I'm looking at porting my Pyjs app to GWT.
>
Why hurting yourself?  If you do not like pyjs, try coffescript or cappucino.

mic


[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thanks for the reply. I tried you sugestion but still no joy. I haven't 
included all the code 
so that the examples as simple as possible. I can try to attach some of my 
code and send it
to you if you wish. 

If you add some code such as:
else :
record = 'No part number URL should read 
"update_inventory?partnum=something"'
return dict(record=record)

then it returns that message when you submit an update, but the database is 
still not being updated.


On Thursday, June 7, 2012 11:11:41 AM UTC-5, Anthony wrote:
>
> What are you returning in case no rows are found? Also, you can instead do:
>
> row = db(db.invent.partnum == request.vars.partnum).select().first()
> if row:
> etc.
>
> .first() returns the first row or None if there are no records.
>
> Anthony
>
> On Thursday, June 7, 2012 10:49:54 AM UTC-4, Joel Robinson wrote:
>>
>> Thanks for the reply, but its still not working correctly. I changed the 
>> code to the following:
>>
>> if rows:
>> row = rows[0]
>> record = crud.update(db.invent, row.id )
>> return dict(record=record)
>>
>> with a URL like:
>>
>> http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4
>>
>> I will get the correct web page, but when I change a value and hit the 
>> submit button I just get sent to
>> a page that says "None". If I reload the page the values are unchanged.  
>> Nothing was updated. 
>>
>> Joel Robinson
>>
>> On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote:
>>>
>>> Same problem -- everything has to go inside your "if rows:" block -- 
>>> don't attempt to create a crud.update form if no rows have been returned.
>>>
>>> Anthony
>>>
>>> On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel Robinson wrote:

 Thanks for the reply. I tried your sugestion but am still getting an 
 error, though a different one:

 Traceback (most recent call last):
   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
 restricted
 exec ccode in environment
   File 
 "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
 , 
 line 136, in 
   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
 self._caller = lambda f: f()
   File 
 "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
 , 
 line 131, in update_inventory
 record = crud.update(db.invent, row.id )
 UnboundLocalError: local variable 'row' referenced before assignment

 Just to be clear the page is coming up initialy. This error only happens 
 when I click
 on the submit button. Thanks again for your help.

 Joel Robinson



 On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:
>
> Looks like the error is at
>
> row = rows[0] 
>
> because rows is empty (no records matching query). You need a check 
> like 
>
> if rows:
> row = rows[0]
>
>
>
> On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>>
>> First, let me give some background on what I've been trying to do. We 
>> wanted to set up an inventory system using QR codes which would be put 
>> on 
>> stickers on our stock and then scaned with smartphone when removing 
>> inventory bring up the appropiate web page. The QR code should contain 
>> something like: 
>> 
>> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>>
>> and the following is the code I wrote for update_inventory:
>>
>> rows = db(db.invent.partnum == request.vars.partnum).select() 
>> # change rows object to row object
>> row = rows[0]
>> 
>> # display queried object
>> record = crud.update(db.invent, row.id)
>> return dict(record=record)
>>  
>> initialy it would work fine it would run the query and pull up the 
>> correct record but 
>> if I tried to update the record I would get the folling error:
>> 
>>
>> Traceback (most recent call last):
>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> ,
>>  line 123, in 
>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>> self._caller = lambda f: f()
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> ,
>>  line 116, in update_inventory
>> row = rows[0]
>>   File "/home/joel/Source/web2py/gluon/dal.py", line 775

Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Larry G. Wapnitsky
Cool.  If you have any tips for the n00b to Pyjs, send them my way
(privately, not via the group so that we don't clog this up).


On 6/7/2012 12:41 PM, Carl Roach wrote:
> Larry, I really enjoyed coding in Pyjs. GWT/Java involves a lot of
> hoops which I'm jumping through. I'm looking at porting my Pyjs app to
> GWT.
>
> On 7 June 2012 17:29, Larry Wapnitsky wrote:
>
> I'm slowly learning the PyJS/Pyjamas libraries, so I'll say "yes"
> for me
>
>
> On Thursday, June 7, 2012 11:31:30 AM UTC-4, Richard wrote:
>
> I can't speak for the orthers, but web2py is tigthly bone to
> jQuery and it is very easy to include jQuery UI, so I guest
> many users just use those lib in a similar way they could use
> GWT.
>
> Richard
>
> On Thu, Jun 7, 2012 at 11:18 AM, Carl wrote:
>
> Before I ask specifics, is there anyone using GWT on the
> client and Web2py on the server?
>
>
>




Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Carl Roach
Larry, I really enjoyed coding in Pyjs. GWT/Java involves a lot of hoops
which I'm jumping through. I'm looking at porting my Pyjs app to GWT.

On 7 June 2012 17:29, Larry Wapnitsky wrote:

> I'm slowly learning the PyJS/Pyjamas libraries, so I'll say "yes" for me
>
>
> On Thursday, June 7, 2012 11:31:30 AM UTC-4, Richard wrote:
>>
>> I can't speak for the orthers, but web2py is tigthly bone to jQuery and
>> it is very easy to include jQuery UI, so I guest many users just use
>> those lib in a similar way they could use GWT.
>>
>> Richard
>>
>> On Thu, Jun 7, 2012 at 11:18 AM, Carl wrote:
>>
>>> Before I ask specifics, is there anyone using GWT on the client and
>>> Web2py on the server?
>>
>>
>>


[web2py] trunk and statusbar?

2012-06-07 Thread Martin Weissenboeck
Today I have tried to build a new application using the trunk.
Where has the status-bar gone? I could not find it in layout.html

Regards, Martin


Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Larry Wapnitsky
I'm slowly learning the PyJS/Pyjamas libraries, so I'll say "yes" for me

On Thursday, June 7, 2012 11:31:30 AM UTC-4, Richard wrote:
>
> I can't speak for the orthers, but web2py is tigthly bone to jQuery and it 
> is very easy to include jQuery UI, so I guest many users just use those lib 
> in a similar way they could use GWT.
>
> Richard
>
> On Thu, Jun 7, 2012 at 11:18 AM, Carl  wrote:
>
>> Before I ask specifics, is there anyone using GWT on the client and 
>> Web2py on the server?
>
>
>

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Anthony
What are you returning in case no rows are found? Also, you can instead do:

row = db(db.invent.partnum == request.vars.partnum).select().first()
if row:
etc.

.first() returns the first row or None if there are no records.

Anthony

On Thursday, June 7, 2012 10:49:54 AM UTC-4, Joel Robinson wrote:
>
> Thanks for the reply, but its still not working correctly. I changed the 
> code to the following:
>
> if rows:
> row = rows[0]
> record = crud.update(db.invent, row.id )
> return dict(record=record)
>
> with a URL like:
>
> http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4
>
> I will get the correct web page, but when I change a value and hit the 
> submit button I just get sent to
> a page that says "None". If I reload the page the values are unchanged.  
> Nothing was updated. 
>
> Joel Robinson
>
> On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote:
>>
>> Same problem -- everything has to go inside your "if rows:" block -- 
>> don't attempt to create a crud.update form if no rows have been returned.
>>
>> Anthony
>>
>> On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel Robinson wrote:
>>>
>>> Thanks for the reply. I tried your sugestion but am still getting an 
>>> error, though a different one:
>>>
>>> Traceback (most recent call last):
>>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>>> restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>>> , 
>>> line 136, in 
>>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>>> , 
>>> line 131, in update_inventory
>>> record = crud.update(db.invent, row.id )
>>> UnboundLocalError: local variable 'row' referenced before assignment
>>>
>>> Just to be clear the page is coming up initialy. This error only happens 
>>> when I click
>>> on the submit button. Thanks again for your help.
>>>
>>> Joel Robinson
>>>
>>>
>>>
>>> On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:

 Looks like the error is at

 row = rows[0] 

 because rows is empty (no records matching query). You need a check 
 like 

 if rows:
 row = rows[0]



 On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>
> First, let me give some background on what I've been trying to do. We 
> wanted to set up an inventory system using QR codes which would be put on 
> stickers on our stock and then scaned with smartphone when removing 
> inventory bring up the appropiate web page. The QR code should contain 
> something like: 
> 
> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>
> and the following is the code I wrote for update_inventory:
>
> rows = db(db.invent.partnum == request.vars.partnum).select() 
> # change rows object to row object
> row = rows[0]
> 
> # display queried object
> record = crud.update(db.invent, row.id)
> return dict(record=record)
>  
> initialy it would work fine it would run the query and pull up the 
> correct record but 
> if I tried to update the record I would get the folling error:
> 
>
> Traceback (most recent call last):
>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
> restricted
> exec ccode in environment
>   File 
> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> ,
>  line 123, in 
>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
> self._caller = lambda f: f()
>   File 
> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> ,
>  line 116, in update_inventory
> row = rows[0]
>   File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
> row = self.records[i]
> IndexError: list index out of range
>
> I thought maybe the request variable wasn't getting passed correctly when 
> updated so I made the following change:
>
> session.partnum = request.vars.partnum
> rows = db(db.invent.partnum == session.partnum).select()
>
> which didn't help either, but I then noticed that if I tried to pull up 
> the update_inventory page now without the query string
> it would come up since session varible was already set and it would 
> update correctly!
>
> I was eventualy able to get it work more or less how I wanted by writing

Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Carl
thanks Richard. It's the specifics that are different and where my 
questions lie.


On Thursday, 7 June 2012 16:31:30 UTC+1, Richard wrote:
>
> I can't speak for the others, but web2py is tightly bone to jQuery and it 
> is very easy to include jQuery UI, so I guest many users just use those 
> lib in a similar way they could use GWT.
>
> Richard
>
> On Thu, Jun 7, 2012 at 11:18 AM, Carl wrote:
>
>> Before I ask specifics, is there anyone using GWT on the client and 
>> Web2py on the server?
>
>
>

Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Richard Vézina
I can't speak for the orthers, but web2py is tigthly bone to jQuery and it
is very easy to include jQuery UI, so I guest many users just use those lib
in a similar way they could use GWT.

Richard

On Thu, Jun 7, 2012 at 11:18 AM, Carl  wrote:

> Before I ask specifics, is there anyone using GWT on the client and Web2py
> on the server?


[web2py] Is anyone using GWT?

2012-06-07 Thread Carl
Before I ask specifics, is there anyone using GWT on the client and Web2py 
on the server?

Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-07 Thread Marin Pranjić
I was thinking about this. +1

On Thu, Jun 7, 2012 at 3:27 PM, Ismael Serratos wrote:

> Why don't we make our own web2py cloud environment?
>
>
> On Wed, Jun 6, 2012 at 4:34 PM, Bruno Rocha  wrote:
>
>> pythonanywhere has easy deployment for web2py
>>
>> http://zerp.ly/rochacbruno
>> Em 06/06/2012 15:10, "sesenmaister"  escreveu:
>>
>> Andrew, I have the same question. Today I wanted to get payed hosting on
>>> FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python
>>> and web2py for pleasure, I've got no idea how to install web2py in a
>>> "normal" server and have no idea if all hostings permit that. So FluxFlex
>>> was my salvation. Now I'm gonna loose so many days for the simple thing of
>>> deploying. If any advice in getting a way, please I'd be very very glad.
>>>
>>> jsesen
>>>
>>> El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:

 So where do we go now?
>>>
>>>
>


[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thanks for the reply, but its still not working correctly. I changed the 
code to the following:

if rows:
row = rows[0]
record = crud.update(db.invent, row.id )
return dict(record=record)

with a URL like:

http://localhost:8000/GeorgesTV/qrinv/update_inventory?partnum=LAMP-4

I will get the correct web page, but when I change a value and hit the 
submit button I just get sent to
a page that says "None". If I reload the page the values are unchanged.  
Nothing was updated. 

Joel Robinson

On Thursday, June 7, 2012 9:33:57 AM UTC-5, Anthony wrote:
>
> Same problem -- everything has to go inside your "if rows:" block -- don't 
> attempt to create a crud.update form if no rows have been returned.
>
> Anthony
>
> On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel Robinson wrote:
>>
>> Thanks for the reply. I tried your sugestion but am still getting an 
>> error, though a different one:
>>
>> Traceback (most recent call last):
>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> , 
>> line 136, in 
>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>> self._caller = lambda f: f()
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> , 
>> line 131, in update_inventory
>> record = crud.update(db.invent, row.id )
>> UnboundLocalError: local variable 'row' referenced before assignment
>>
>> Just to be clear the page is coming up initialy. This error only happens 
>> when I click
>> on the submit button. Thanks again for your help.
>>
>> Joel Robinson
>>
>>
>>
>> On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> Looks like the error is at
>>>
>>> row = rows[0] 
>>>
>>> because rows is empty (no records matching query). You need a check like 
>>>
>>> if rows:
>>> row = rows[0]
>>>
>>>
>>>
>>> On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:

 First, let me give some background on what I've been trying to do. We 
 wanted to set up an inventory system using QR codes which would be put on 
 stickers on our stock and then scaned with smartphone when removing 
 inventory bring up the appropiate web page. The QR code should contain 
 something like: 
 
 http://GeorgesTV/qrinv/update_inventory?partnum=12345

 and the following is the code I wrote for update_inventory:

 rows = db(db.invent.partnum == request.vars.partnum).select() 
 # change rows object to row object
 row = rows[0]
 
 # display queried object
 record = crud.update(db.invent, row.id)
 return dict(record=record)
  
 initialy it would work fine it would run the query and pull up the 
 correct record but 
 if I tried to update the record I would get the folling error:
 

 Traceback (most recent call last):
   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
 restricted
 exec ccode in environment
   File 
 "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
 , 
 line 123, in 
   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
 self._caller = lambda f: f()
   File 
 "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
 , 
 line 116, in update_inventory
 row = rows[0]
   File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
 row = self.records[i]
 IndexError: list index out of range

 I thought maybe the request variable wasn't getting passed correctly when 
 updated so I made the following change:

 session.partnum = request.vars.partnum
 rows = db(db.invent.partnum == session.partnum).select()

 which didn't help either, but I then noticed that if I tried to pull up 
 the update_inventory page now without the query string
 it would come up since session varible was already set and it would update 
 correctly!

 I was eventualy able to get it work more or less how I wanted by writing a 
 page whose only function was to take the 
 query string set a session variable and then redirect you to the 
 update_inventory page. But I worry that using session varibles
 may cause unforseen problems eventualy.

 So what I would like to know, is this a bug I've found or am I going about 
 doing this incorrectly? Could someone explains
 what happens when you use crud.update and why I get this error when I try

[web2py] Re: Dynamic model creation

2012-06-07 Thread Anthony
Once you specify a given type of object, will its schema always remain the 
same? If so, you should be able to dynamically generate the DAL table 
definition and have the DAL create the table. However, if you need to make 
arbitrary dynamic changes to the schema within a given class of object, 
you're probably better off with a document database like MongoDB. The DAL 
does have an experimental MongoDB adapter, but I'm not sure how complete it 
is and whether it could easily handle this use case -- if not, though, I 
think MongoDB is fairly easy to work with natively via the Python driver.

Anthony

On Sunday, June 3, 2012 5:35:34 AM UTC-4, Christian wrote:
>
> Hello group,
>
> I found a backend service, mostly for mobile apps, called parse.com. 
> Looking at their REST documentation (https://parse.com/docs/rest), it 
> looks like one can e.g. dynamically generate different kind of objects, 
> which get persistet (see "creating objects" in the docs to see what I 
> mean). These objects can get relationships to other objects and can also be 
> queried. So if the client posts GameScore or GameScores, both are valid 
> (but different) objects (in different tables?)  and get persisted,
> My questions: how looks sth. like this on the model side? How is this 
> done? How to model general tables and still make them queryable. Or does 
> the model generate tables dynamically? Could something like this be modeled 
> with DAL? 
> On the controller side: could such a dynamic model be made available via 
> sth like @request.restful?
>
> I would be happy for any hint, as I have no idea, how this is done!
>
> Thanks and regards,
> Christian
>
> P.S.: I also found a open source clone, which rebuilds the iOS client 
> library and the server with node and MongoDB, if this might be of any help. 
> I do not speak JS and have no clue about mongo. 
> https://github.com/eaigner/DataKit
>
>

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Anthony
Same problem -- everything has to go inside your "if rows:" block -- don't 
attempt to create a crud.update form if no rows have been returned.

Anthony

On Thursday, June 7, 2012 10:30:17 AM UTC-4, Joel Robinson wrote:
>
> Thanks for the reply. I tried your sugestion but am still getting an 
> error, though a different one:
>
> Traceback (most recent call last):
>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in restricted
> exec ccode in environment
>   File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> , 
> line 136, in 
>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
> self._caller = lambda f: f()
>   File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> , 
> line 131, in update_inventory
> record = crud.update(db.invent, row.id )
> UnboundLocalError: local variable 'row' referenced before assignment
>
> Just to be clear the page is coming up initialy. This error only happens when 
> I click
> on the submit button. Thanks again for your help.
>
> Joel Robinson
>
>
>
> On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:
>>
>> Looks like the error is at
>>
>> row = rows[0] 
>>
>> because rows is empty (no records matching query). You need a check like 
>>
>> if rows:
>> row = rows[0]
>>
>>
>>
>> On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>>>
>>> First, let me give some background on what I've been trying to do. We 
>>> wanted to set up an inventory system using QR codes which would be put on 
>>> stickers on our stock and then scaned with smartphone when removing 
>>> inventory bring up the appropiate web page. The QR code should contain 
>>> something like: 
>>> 
>>> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>>>
>>> and the following is the code I wrote for update_inventory:
>>>
>>> rows = db(db.invent.partnum == request.vars.partnum).select() 
>>> # change rows object to row object
>>> row = rows[0]
>>> 
>>> # display queried object
>>> record = crud.update(db.invent, row.id)
>>> return dict(record=record)
>>>  
>>> initialy it would work fine it would run the query and pull up the 
>>> correct record but 
>>> if I tried to update the record I would get the folling error:
>>> 
>>>
>>> Traceback (most recent call last):
>>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>>> restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>>> , 
>>> line 123, in 
>>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>>> , 
>>> line 116, in update_inventory
>>> row = rows[0]
>>>   File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
>>> row = self.records[i]
>>> IndexError: list index out of range
>>>
>>> I thought maybe the request variable wasn't getting passed correctly when 
>>> updated so I made the following change:
>>>
>>> session.partnum = request.vars.partnum
>>> rows = db(db.invent.partnum == session.partnum).select()
>>>
>>> which didn't help either, but I then noticed that if I tried to pull up the 
>>> update_inventory page now without the query string
>>> it would come up since session varible was already set and it would update 
>>> correctly!
>>>
>>> I was eventualy able to get it work more or less how I wanted by writing a 
>>> page whose only function was to take the 
>>> query string set a session variable and then redirect you to the 
>>> update_inventory page. But I worry that using session varibles
>>> may cause unforseen problems eventualy.
>>>
>>> So what I would like to know, is this a bug I've found or am I going about 
>>> doing this incorrectly? Could someone explains
>>> what happens when you use crud.update and why I get this error when I try 
>>> to use query strings?
>>>
>>> Thanks in advance for your help.
>>>
>>> Joel Robinson
>>>
>>>

[web2py] Re: web2py: crud interface and query strings

2012-06-07 Thread Joel Robinson
Thanks for the reply. I tried your sugestion but am still getting an error, 
though a different one:

Traceback (most recent call last):
  File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in restricted
exec ccode in environment
  File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
, line 
136, in 
  File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
self._caller = lambda f: f()
  File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
, line 
131, in update_inventory
record = crud.update(db.invent, row.id )
UnboundLocalError: local variable 'row' referenced before assignment

Just to be clear the page is coming up initialy. This error only happens when I 
click
on the submit button. Thanks again for your help.

Joel Robinson



On Wednesday, June 6, 2012 4:14:29 PM UTC-5, Massimo Di Pierro wrote:
>
> Looks like the error is at
>
> row = rows[0] 
>
> because rows is empty (no records matching query). You need a check like 
>
> if rows:
> row = rows[0]
>
>
>
> On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>>
>> First, let me give some background on what I've been trying to do. We 
>> wanted to set up an inventory system using QR codes which would be put on 
>> stickers on our stock and then scaned with smartphone when removing 
>> inventory bring up the appropiate web page. The QR code should contain 
>> something like: 
>> 
>> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>>
>> and the following is the code I wrote for update_inventory:
>>
>> rows = db(db.invent.partnum == request.vars.partnum).select() 
>> # change rows object to row object
>> row = rows[0]
>> 
>> # display queried object
>> record = crud.update(db.invent, row.id)
>> return dict(record=record)
>>  
>> initialy it would work fine it would run the query and pull up the 
>> correct record but 
>> if I tried to update the record I would get the folling error:
>> 
>>
>> Traceback (most recent call last):
>>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> , 
>> line 123, in 
>>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
>> self._caller = lambda f: f()
>>   File 
>> "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
>> , 
>> line 116, in update_inventory
>> row = rows[0]
>>   File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
>> row = self.records[i]
>> IndexError: list index out of range
>>
>> I thought maybe the request variable wasn't getting passed correctly when 
>> updated so I made the following change:
>>
>> session.partnum = request.vars.partnum
>> rows = db(db.invent.partnum == session.partnum).select()
>>
>> which didn't help either, but I then noticed that if I tried to pull up the 
>> update_inventory page now without the query string
>> it would come up since session varible was already set and it would update 
>> correctly!
>>
>> I was eventualy able to get it work more or less how I wanted by writing a 
>> page whose only function was to take the 
>> query string set a session variable and then redirect you to the 
>> update_inventory page. But I worry that using session varibles
>> may cause unforseen problems eventualy.
>>
>> So what I would like to know, is this a bug I've found or am I going about 
>> doing this incorrectly? Could someone explains
>> what happens when you use crud.update and why I get this error when I try to 
>> use query strings?
>>
>> Thanks in advance for your help.
>>
>> Joel Robinson
>>
>>

Re: [web2py] Re: Embed youtube videos

2012-06-07 Thread Kevin Miller
Yes thanks. I was thinking about that. Thank you very much for your
responses.
I recently started to use web2py and I think its a wonderful python
framework. This is my first project with it.

On Thu, Jun 7, 2012 at 2:15 AM, pbreit  wrote:

> You could write a little but of code to figure out if the user put in the
> whole URL or just the code and then just save the code.
>
>
> On Wednesday, June 6, 2012 10:46:55 PM UTC-7, dundee wrote:
>>
>> Ok thanks for answering. Thanks for the idea. I include the first part of
>> the url and replace the code section with the argument passed to the view.
>> When I used the entire URL it did not work. The only problem I don't like
>> with this approach is that the user has to enter the code (which is
>> sometimes hard to extract for some users) in the form. Is there an easy way
>> for the user? To just copy the url or something like that.
>>
>> Thanks again.
>>
>>
>> On Wed, Jun 6, 2012 at 10:48 PM, pbreit  wrote:
>>
>>> Should be pretty easy. Once you capture the YouTube URL, just pass it to
>>> a view and then:
>>>
>>> === view.html ===
>>> >>   src="{{=video.url}}?autoplay=**1&origin=http://example.com";
>>>   frameborder="0"/>
>>>
>>> === controller.py ===
>>> def play_video():
>>> video = db.video(request.args(0))
>>> return dict(video=video)
>>>
>>>  video.url would need to be something like "
>>> http://www.youtube.com/embed/**u1zgFlCw8Aw".
>>> You can store the whole URL or just the YouTube code ("u1zgFlCw8Aw").
>>>
>>> From:
>>> https://developers.google.com/**youtube/player_parameters#**
>>> Embedding_a_Player
>>>
>>>
>>> On Wednesday, June 6, 2012 7:26:45 PM UTC-7, dundee wrote:

 I have been trying to figure out the best way to embed a youtube video
 in web2py. I would like a form with an entry for the youtube video
 link/code then at some point it will be displayed.
 I found this comment using the widget from plugin_wiki, but that did
 not work for me:

 https://groups.google.com/**foru**m/?fromgroups#!topic/**web2py/**
 j8-EG58VbA4


 Thanks very much.


>>
>>
>> --
>> Kevin Miller
>> Acting Data Controller
>> Department of Computing
>> UWI, Mona
>> Kingston 7
>>
>


-- 
Kevin Miller
Acting Data Controller
Department of Computing
UWI, Mona
Kingston 7


[web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Anthony
It might be easier if you go through 
http://web2py.com/books/default/chapter/29/1#Model-View-Controller, 
http://web2py.com/books/default/chapter/29/4#Workflow, and 
http://web2py.com/books/default/chapter/29/4#Dispatching, and then come 
back with specific questions.

Anthony

On Thursday, June 7, 2012 6:15:26 AM UTC-4, Omar Ali wrote:
>
> I'm a total newbie. I have programmed extensively during the VB days 
> (event driven programming) (I know, you'd hardly call that programming!) so 
> ... Web programming is taking a toll on me.
>
> Could someone explain to me the dynamics of web2py programming in a way 
> that an event driven programming dude can understand, maybe using analogies 
> and such..
>
>
>

Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-07 Thread Ismael Serratos
Why don't we make our own web2py cloud environment?

On Wed, Jun 6, 2012 at 4:34 PM, Bruno Rocha  wrote:

> pythonanywhere has easy deployment for web2py
>
> http://zerp.ly/rochacbruno
> Em 06/06/2012 15:10, "sesenmaister"  escreveu:
>
> Andrew, I have the same question. Today I wanted to get payed hosting on
>> FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python
>> and web2py for pleasure, I've got no idea how to install web2py in a
>> "normal" server and have no idea if all hostings permit that. So FluxFlex
>> was my salvation. Now I'm gonna loose so many days for the simple thing of
>> deploying. If any advice in getting a way, please I'd be very very glad.
>>
>> jsesen
>>
>> El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:
>>>
>>> So where do we go now?
>>
>>


Re: [web2py] Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Jim Steil
I think it would really help for you to get the web2py book and read 
it.  It does a great job explaining the flow of control and how data 
gets passed around.


-Jim

On 6/7/2012 5:15 AM, Omar Ali wrote:
I'm a total newbie. I have programmed extensively during the VB days 
(event driven programming) (I know, you'd hardly call that 
programming!) so ... Web programming is taking a toll on me.


Could someone explain to me the dynamics of web2py programming in a 
way that an event driven programming dude can understand, maybe using 
analogies and such..



No virus found in this message.
Checked by AVG - www.avg.com 
Version: 2012.0.1913 / Virus Database: 2433/5053 - Release Date: 06/06/12



--
Jim Steil
VP of Information Technology
Quality Liquid Feeds, Inc.
608.935.2345 office
608.341.9896 cell


[web2py] Re: Errors creating/reading tickets

2012-06-07 Thread Chris
Following up on some of the clues others have suggested -- I have this 
problem when running web2py version 1.99.7 on Red Hat Enterprise 6.2 (very 
similar to CentOS) and mod_wsgi with Apache.

Happy to provide copies of the error tickets if that would help with 
troubleshooting -- ?



On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>
> This has actually been plaguing me for a while but finally annoyed me 
> enough to ask.  I have several web2py (1.99.4) apps running under 
> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
> not when an error happens and a ticket is generated, the ticket seems to be 
> corrupt.  Attempting to view the ticket creates another error for which the 
> ticket says something like:
>
>  Version  web2py™ (1, 99, 4, 
> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "C:\vantage_dashboard\xampp\web2py\gluon\restricted.py", line 204, in 
> restricted
> exec ccode in environment
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1341, in 
>   File "C:\vantage_dashboard\xampp\web2py\gluon\globals.py", line 172, in 
> 
> self._caller = lambda f: f()
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1082, in errors
> error = pickle.load(fullpath_file)
>   File "C:\Python26\Lib\pickle.py", line 1370, in load
> return Unpickler(file).load()
>   File "C:\Python26\Lib\pickle.py", line 858, in load
> dispatch[key](self)
>   File "C:\Python26\Lib\pickle.py", line 880, in load_eof
> raise EOFError
> EOFError
>
>
> Which means that I have to attempt to read the original error ticket in a 
> text editor which is just slightly less than idea.  Any ideas what might be 
> happening? This problem doesn't seem to happen in my dev environment (also 
> Windows but just using rocket instead of apache/mod_wsgi).
>
> Thanks,
> Brian
>

On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>
> This has actually been plaguing me for a while but finally annoyed me 
> enough to ask.  I have several web2py (1.99.4) apps running under 
> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
> not when an error happens and a ticket is generated, the ticket seems to be 
> corrupt.  Attempting to view the ticket creates another error for which the 
> ticket says something like:
>
>  Version  web2py™ (1, 99, 4, 
> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "C:\vantage_dashboard\xampp\web2py\gluon\restricted.py", line 204, in 
> restricted
> exec ccode in environment
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1341, in 
>   File "C:\vantage_dashboard\xampp\web2py\gluon\globals.py", line 172, in 
> 
> self._caller = lambda f: f()
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1082, in errors
> error = pickle.load(fullpath_file)
>   File "C:\Python26\Lib\pickle.py", line 1370, in load
> return Unpickler(file).load()
>   File "C:\Python26\Lib\pickle.py", line 858, in load
> dispatch[key](self)
>   File "C:\Python26\Lib\pickle.py", line 880, in load_eof
> raise EOFError
> EOFError
>
>
> Which means that I have to attempt to read the original error ticket in a 
> text editor which is just slightly less than idea.  Any ideas what might be 
> happening? This problem doesn't seem to happen in my dev environment (also 
> Windows but just using rocket instead of apache/mod_wsgi).
>
> Thanks,
> Brian
>

On Saturday, March 10, 2012 9:48:04 PM UTC-5, Brian M wrote:
>
> This has actually been plaguing me for a while but finally annoyed me 
> enough to ask.  I have several web2py (1.99.4) apps running under 
> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
> not when an error happens and a ticket is generated, the ticket seems to be 
> corrupt.  Attempting to view the ticket creates another error for which the 
> ticket says something like:
>
>  Version  web2py™ (1, 99, 4, 
> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10

Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Cornelius Kölbel

Am 07.06.2012 12:46, schrieb Johann Spies:
> On 7 June 2012 11:01, Cornelius Kölbel  > wrote:
>
> Hi,
> is it possible to add more than one button to a SQLFORM.smartgrid?
>
> Yes.
>  
>
> At the moment I would add one button like this...|
> links = [lambda row: A(T('Add a contact to this
> customer'),_href=URL("customer","add_contact",args=[row.id
> ]))]
>
> |
>
>
> There will be a button for each item in links if you use links=links
> in arguments for SQLFORM.smartgrid.
>
> Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>
Hello Johann,

thanks for your response.
But I'd like to have two buttons per item, and I wonder if this could be
implemented.
At the moment the lambda function returns one link for an item resulting
in one button per item.

I can not figure out, what to pass, if I want to have several buttons
and I wonder if this is supported at all.

Kind regards
Cornelius



signature.asc
Description: OpenPGP digital signature


[web2py] Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Omar Ali
I'm a total newbie. I have programmed extensively during the VB days (event 
driven programming) (I know, you'd hardly call that programming!) so ... 
Web programming is taking a toll on me.

Could someone explain to me the dynamics of web2py programming in a way 
that an event driven programming dude can understand, maybe using analogies 
and such..




Re: [web2py] Dynamic model creation

2012-06-07 Thread Christian Hoffmann
Hi pbreit and thanks for the reply.
So web2py is not the preferred way to go as DAL needs a scheme? Is there no
way to integrate DAL in a dynamic way?

Regards,
Christian

Am Sonntag, 3. Juni 2012 schrieb pbreit :

> My guess is it's NoSQL, probably Mongo which seems to be the preferred DB
> behind a lot of these "real-time" JavaScript frameworks.
>
>
> On Sunday, June 3, 2012 2:35:34 AM UTC-7, Christian wrote:
>>
>> Hello group,
>>
>> I found a backend service, mostly for mobile apps, called parse.com.
>> Looking at their REST documentation (https://parse.com/docs/rest), it
>> looks like one can e.g. dynamically generate different kind of objects,
>> which get persistet (see "creating objects" in the docs to see what I
>> mean). These objects can get relationships to other objects and can also be
>> queried. So if the client posts GameScore or GameScores, both are valid
>> (but different) objects (in different tables?)  and get persisted,
>> My questions: how looks sth. like this on the model side? How is this
>> done? How to model general tables and still make them queryable. Or does
>> the model generate tables dynamically? Could something like this be modeled
>> with DAL?
>> On the controller side: could such a dynamic model be made available via
>> sth like @request.restful?
>>
>> I would be happy for any hint, as I have no idea, how this is done!
>>
>> Thanks and regards,
>> Christian
>>
>> P.S.: I also found a open source clone, which rebuilds the iOS client
>> library and the server with node and MongoDB, if this might be of any help.
>> I do not speak JS and have no clue about mongo.
>> https://github.com/eaigner/**DataKit 
>>
>>


Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Johann Spies
On 7 June 2012 11:01, Cornelius Kölbel wrote:

>  Hi,
> is it possible to add more than one button to a SQLFORM.smartgrid?
>
> Yes.


> At the moment I would add one button like this...
> links = [lambda row: A(T('Add a contact to this
> customer'),_href=URL("customer","add_contact",args=[row.id]))]
>
>
There will be a button for each item in links if you use links=links in
arguments for SQLFORM.smartgrid.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-07 Thread Andrew
Hi Paolo,
I'm afraid I can't reproduce it anymore.  The caret is there and I now see 
buttons on the nav menu.   I updated to the latest layout.html, and 
reverted back and it's still fixed !?  Sorry for the time waster but I 
swear I tried everything yesterday ?   
I've just put your two files above back on my old app and it still works 
like a charm.

After that small diversion,   I'm still looking forward to seeing your 
changes in the source.

Regards
Andrew W





On Thursday, June 7, 2012 8:29:48 PM UTC+12, LightDot wrote:
>
> Yes, I thought it might be a feature, not a bug :)
>
> I was just testing the bootstrap integration and capabilities, so no great 
> harm. Thanks for clarifying.
>
>
> On Thursday, June 7, 2012 10:24:44 AM UTC+2, Paolo Caruccio wrote:
>>
>> I'm afraid you can not do it. The first item in the dropdown menu (having 
>> class="dropdown") can not contain an URL. The structure of the dropdown 
>> menu is as follows (taken from this page 
>> http://twitter.github.com/bootstrap/components.html#navbar):
>>
>> Adding dropdown menus
>>
>> Adding dropdowns and dropups to the nav is super simple, but does require 
>> the use of our javascript 
>> plugin
>> .
>>
>>
>>1. 
>>2.   
>>3. >4.   class="dropdown-toggle"
>>5.   data-toggle="dropdown">
>>6.   Account
>>7.   
>>8. 
>>9. 
>>10.   ...
>>11. 
>>12.   
>>13. 
>>
>>
>> Il giorno giovedì 7 giugno 2012 04:13:19 UTC+2, LightDot ha scritto:
>>>
>>> I can confirm this, using fresh welcome application and Bootstrap 
>>> upgraded to 2.0.4.
>>>
>>> If a menu item has both an URL specified and also additional submenus, 
>>> these don't get displayed. Regardless if this is a first or a second level 
>>> menu item. If the URL is set as None, additional submenus display properly.
>>>
>>> Regards
>>>
>>> On Wednesday, June 6, 2012 11:13:48 PM UTC+2, Paolo Caruccio wrote:

 Szimszon,

 is it a new application or have you replaced an old layout with that 
 new one?


 Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>
> I have issue with dropdown menu when the main menu is a link too.
>
> If I click on the main menu than that menu is activated and I can't 
> access the items below it with any means :(
>

 Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>
> I have issue with dropdown menu when the main menu is a link too.
>
> If I click on the main menu than that menu is activated and I can't 
> access the items below it with any means :(
>


[web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Cornelius Kölbel
Hi,
is it possible to add more than one button to a SQLFORM.smartgrid?

At the moment I would add one button like this...|
links = [lambda row: A(T('Add a contact to this
customer'),_href=URL("customer","add_contact",args=[row.id]))]

|Thanks a lot and kind regards
CorneliusKölbel


signature.asc
Description: OpenPGP digital signature


[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-07 Thread LightDot
Yes, I thought it might be a feature, not a bug :)

I was just testing the bootstrap integration and capabilities, so no great 
harm. Thanks for clarifying.


On Thursday, June 7, 2012 10:24:44 AM UTC+2, Paolo Caruccio wrote:
>
> I'm afraid you can not do it. The first item in the dropdown menu (having 
> class="dropdown") can not contain an URL. The structure of the dropdown 
> menu is as follows (taken from this page 
> http://twitter.github.com/bootstrap/components.html#navbar):
>
> Adding dropdown menus
>
> Adding dropdowns and dropups to the nav is super simple, but does require 
> the use of our javascript 
> plugin
> .
>
>
>1. 
>2.   
>3. 4.   class="dropdown-toggle"
>5.   data-toggle="dropdown">
>6.   Account
>7.   
>8. 
>9. 
>10.   ...
>11. 
>12.   
>13. 
>
>
> Il giorno giovedì 7 giugno 2012 04:13:19 UTC+2, LightDot ha scritto:
>>
>> I can confirm this, using fresh welcome application and Bootstrap 
>> upgraded to 2.0.4.
>>
>> If a menu item has both an URL specified and also additional submenus, 
>> these don't get displayed. Regardless if this is a first or a second level 
>> menu item. If the URL is set as None, additional submenus display properly.
>>
>> Regards
>>
>> On Wednesday, June 6, 2012 11:13:48 PM UTC+2, Paolo Caruccio wrote:
>>>
>>> Szimszon,
>>>
>>> is it a new application or have you replaced an old layout with that new 
>>> one?
>>>
>>>
>>> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:

 I have issue with dropdown menu when the main menu is a link too.

 If I click on the main menu than that menu is activated and I can't 
 access the items below it with any means :(

>>>
>>> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:

 I have issue with dropdown menu when the main menu is a link too.

 If I click on the main menu than that menu is activated and I can't 
 access the items below it with any means :(

>>>

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-07 Thread Paolo Caruccio
I'm afraid you can not do it. The first item in the dropdown menu (having 
class="dropdown") can not contain an URL. The structure of the dropdown 
menu is as follows (taken from this page 
http://twitter.github.com/bootstrap/components.html#navbar):

Adding dropdown menus

Adding dropdowns and dropups to the nav is super simple, but does require 
the use of our javascript 
plugin
.


   1. 
   2.   
   3. 
   6.   Account
   7.   
   8. 
   9. 
   10.   ...
   11. 
   12.   
   13. 


Il giorno giovedì 7 giugno 2012 04:13:19 UTC+2, LightDot ha scritto:
>
> I can confirm this, using fresh welcome application and Bootstrap upgraded 
> to 2.0.4.
>
> If a menu item has both an URL specified and also additional submenus, 
> these don't get displayed. Regardless if this is a first or a second level 
> menu item. If the URL is set as None, additional submenus display properly.
>
> Regards
>
> On Wednesday, June 6, 2012 11:13:48 PM UTC+2, Paolo Caruccio wrote:
>>
>> Szimszon,
>>
>> is it a new application or have you replaced an old layout with that new 
>> one?
>>
>>
>> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>>>
>>> I have issue with dropdown menu when the main menu is a link too.
>>>
>>> If I click on the main menu than that menu is activated and I can't 
>>> access the items below it with any means :(
>>>
>>
>> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>>>
>>> I have issue with dropdown menu when the main menu is a link too.
>>>
>>> If I click on the main menu than that menu is activated and I can't 
>>> access the items below it with any means :(
>>>
>>

Re: [web2py] niphlod tvseries error

2012-06-07 Thread Niphlod
There are a few places here and there stating that web2py supports python 
2.5 , 2.6 and 2.7, preferring 2.5 .

I contacted Massimo the last week just about that the binary 
distribution with a recent python version could enable some new features 
that are in stable. Builds against 2.7 seems to work ok with small 
modifications, and I sent Massimo my patches for it.

I'm pretty sure that for the 2.0 release binary version will be built 
against python 2.7 ...


Il giorno giovedì 7 giugno 2012 09:48:37 UTC+2, blye ha scritto:
>
> thanks again
> I am curious.. 
> in light of above, my web2py runs very fine most of time but newer apps 
> are having this issue
> why does the web2py distrib bin version have py 25 dll etc
>
> Are there any references to this issue in the lit or books
> Is a new main thread worthwhile in this regard?
>
>
> On Wednesday, 6 June 2012 23:32:55 UTC+2, Niphlod wrote:
>>
>> if you're using binary version there is a good chance that web2py will 
>> run under 2.5
>>
>> if you have also 2.7 installed, download the source code version, unzip 
>> in a folder, then python web2py.py and voilà.
>>
>> Il giorno mercoledì 6 giugno 2012 22:18:34 UTC+2, blye ha scritto:
>>>
>>> Thanks very much for prompt reply. Never quite sure if its a bug ...  or 
>>> me :-(
>>> This issue has happened with other apps, not sure if I understand.
>>> w2p has its own internal Python 2.5.. ???
>>> I have py 2.5 and 2.7 installed on my machine
>>>
>>> How do I resolve the w2p 2.7 issue?
>>> Should I be running w2p from source code? How do I resolve on a 
>>> production host server?
>>>
>>> OTT All the work of you guys is both inspirational, showing web2py power 
>>> and educational. What a great ongoing creation.
>>>
>>> Thanks.
>>>
>>> On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:

 yeah, forgot to mention in the main page that w2p_tvseries won't work 
 with python 2.5 (the scheduler part needs the multiprocessing module)

 BTW, the function this line is in is not used for the moment, but a 
 one-line fix will avoid the error, so as soon as possible I'll release an 
 update.

 @all: if you want to discuss it further, maybe this can be a right 
 place, but if it's for filing a bug, let's keep this list uncluttered and 
 move to github's pages ;-)

 Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha scritto:
>
> whats the Python version?
>
> this is a python issue you can solve with this (if not running 2.7)
>
> return UL(*lis, **{"_class": 'nav'})
>
>
>
> On Tue, Jun 5, 2012 at 12:05 PM, blye  wrote:
>
>> return UL(*lis, _class='nav')
>
>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

Re: [web2py] niphlod tvseries error

2012-06-07 Thread blye
thanks again
I am curious.. 
in light of above, my web2py runs very fine most of time but newer apps are 
having this issue
why does the web2py distrib bin version have py 25 dll etc

Are there any references to this issue in the lit or books
Is a new main thread worthwhile in this regard?


On Wednesday, 6 June 2012 23:32:55 UTC+2, Niphlod wrote:
>
> if you're using binary version there is a good chance that web2py will run 
> under 2.5
>
> if you have also 2.7 installed, download the source code version, unzip in 
> a folder, then python web2py.py and voilà.
>
> Il giorno mercoledì 6 giugno 2012 22:18:34 UTC+2, blye ha scritto:
>>
>> Thanks very much for prompt reply. Never quite sure if its a bug ...  or 
>> me :-(
>> This issue has happened with other apps, not sure if I understand.
>> w2p has its own internal Python 2.5.. ???
>> I have py 2.5 and 2.7 installed on my machine
>>
>> How do I resolve the w2p 2.7 issue?
>> Should I be running w2p from source code? How do I resolve on a 
>> production host server?
>>
>> OTT All the work of you guys is both inspirational, showing web2py power 
>> and educational. What a great ongoing creation.
>>
>> Thanks.
>>
>> On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:
>>>
>>> yeah, forgot to mention in the main page that w2p_tvseries won't work 
>>> with python 2.5 (the scheduler part needs the multiprocessing module)
>>>
>>> BTW, the function this line is in is not used for the moment, but a 
>>> one-line fix will avoid the error, so as soon as possible I'll release an 
>>> update.
>>>
>>> @all: if you want to discuss it further, maybe this can be a right 
>>> place, but if it's for filing a bug, let's keep this list uncluttered and 
>>> move to github's pages ;-)
>>>
>>> Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha scritto:

 whats the Python version?

 this is a python issue you can solve with this (if not running 2.7)

 return UL(*lis, **{"_class": 'nav'})



 On Tue, Jun 5, 2012 at 12:05 PM, blye  wrote:

> return UL(*lis, _class='nav')




 -- 

 Bruno Rocha
 [http://rochacbruno.com.br]



Re: [web2py] Re: Embed youtube videos

2012-06-07 Thread pbreit
You could write a little but of code to figure out if the user put in the 
whole URL or just the code and then just save the code.


On Wednesday, June 6, 2012 10:46:55 PM UTC-7, dundee wrote:
>
> Ok thanks for answering. Thanks for the idea. I include the first part of 
> the url and replace the code section with the argument passed to the view. 
> When I used the entire URL it did not work. The only problem I don't like 
> with this approach is that the user has to enter the code (which is 
> sometimes hard to extract for some users) in the form. Is there an easy way 
> for the user? To just copy the url or something like that.
>
> Thanks again.
>
>
> On Wed, Jun 6, 2012 at 10:48 PM, pbreit  wrote:
>
>> Should be pretty easy. Once you capture the YouTube URL, just pass it to 
>> a view and then:
>>
>> === view.html ===
>> >   src="{{=video.url}}?autoplay=1&origin=http://example.com";
>>   frameborder="0"/>
>>
>> === controller.py ===
>> def play_video():
>> video = db.video(request.args(0))
>> return dict(video=video)
>>
>>  video.url would need to be something like "
>> http://www.youtube.com/embed/u1zgFlCw8Aw";. You can store the whole URL 
>> or just the YouTube code ("u1zgFlCw8Aw").
>>
>> From:
>> https://developers.google.com/youtube/player_parameters#Embedding_a_Player
>>
>>
>> On Wednesday, June 6, 2012 7:26:45 PM UTC-7, dundee wrote:
>>>
>>> I have been trying to figure out the best way to embed a youtube video 
>>> in web2py. I would like a form with an entry for the youtube video 
>>> link/code then at some point it will be displayed.
>>> I found this comment using the widget from plugin_wiki, but that did not 
>>> work for me:
>>>
>>> https://groups.google.com/**forum/?fromgroups#!topic/**
>>> web2py/j8-EG58VbA4
>>>
>>>
>>> Thanks very much.
>>>
>>>
>
>
> -- 
> Kevin Miller
> Acting Data Controller
> Department of Computing
> UWI, Mona
> Kingston 7
>