[web2py] Re: 1.99.1 and ssl/https

2011-09-24 Thread Massimo Di Pierro
Can you help us debug this? Do you get this error with 1.99.1 and not
with 1.98.2? Could it be related to this:
http://stackoverflow.com/questions/2538723/ssl-received-a-record-that-exceeded-the-maximum-permissible-length-error-code

Massimo

On Sep 24, 9:47 pm, "Cameron"  wrote:
> Just tried ssl via the admin console.
>
> Running windows 7 64 with 32 bit (I think) python 2.7.2.
>
> Got this in firefox version 6.x:
> ""
> Secure Connection Failed
> An error occurred during a connection to 127.0.0.1:8000.
> SSL received a record that exceeded the maximum permissible length.
> (Error code: ssl_error_rx_record_too_long)
> ""
>
> Got this in chrome:
> ""
> Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
> ""
>
> Opera just sits with the hour glass running.
>
> IE doesn't say much of anything, but the site doesn't come up.
>
> Works great without ssl.
>
> Can't find any error log entry in the admin app error page. I'm a beginner
> with web2py but I can do a packet capture if you tell me where to send it.
>
>
>
>
>
>
>
> -Original Message-
> From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of
>
> Massimo Di Pierro
> Sent: Saturday, September 24, 2011 8:02 PM
> To: web2py-users
> Subject: [web2py] 1.99.1 and ssl/https
>
> Has anybody tried 1.99.1 with https (other thank Dirk)? We have a strange
> error logged and we cannot get to the bottom of it. Perhaps if you have
> tried on other OSes/Python version it can help us narrow it downs.  It seems
> to work even if the error is logged.
>
> Massimo


[web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Igor
@Ray (a.k.a. Iceberg):
Very useful information. Thanks!


[web2py] Re: 1.99.1 and ssl/https

2011-09-24 Thread pbreit
I might have fixed mine by reverting this change:
http://code.google.com/p/web2py/source/detail?r=07ae0d6cb4792e6ee7c660add78cc8fa0b9c9d13

I don't really get how string interpolation works here. Would this work?

myversion = "Version 1.97.1 (2011-07-04 00:39:51)"
{{="Version %s.%s.%s (%s)" % myversion}}
or
{{="Version %s.%s.%s (%s) %s" % myversion}}


My admin reports that I am on version 1.97.1 even though my working 
directory is at the current "tip".


[web2py] Re: 1.99.1 and ssl/https

2011-09-24 Thread pbreit
I have my errors set to redirect to an app named "error".

[web2py] Re: 1.99.1 and ssl/https

2011-09-24 Thread pbreit
I had a problem logging in to admin on http. I fixed it by creating the 
"private" directory which I think write_hosts_deny expects.

I then ran into the version parsing problem but I think that's fixed in a 
more current changeset. I can't tell if my admin app gets updated when I do 
"hg pull -u"?

At this point I get a 500 error right after I type in my password and press 
"login". I don't get an error log, though.

http://test.pricetack.com/error/default/index?code=500&ticket=unknown&requested_uri=/admin/default/index&request_url=/admin
http://pricetack.com/error/default/index?code=500&ticket=unknown&requested_uri=/admin/default/index&request_url=/admin

"test" has a self-signed cert. production has a real cert.


[web2py] Re: Creating a Layout Plugin

2011-09-24 Thread Andrew
Thanks Massimo,
It is a good convention to keep consistency across many layouts, so
I'll do the same.
Regards
Andrew

On Sep 25, 12:56 pm, Massimo Di Pierro 
wrote:
> Good point. The name of the plugin (after installed) is not determined
> by the filename (w2p) but determined by the file content of the w2p
> file.
>
> I used the convention to put all layout as subfolder so a
> plugin_layouts so
>
> web2py.plugin.layout_xxx.w2p would contain
> views/layout.html
> views/plugin_layouts/xxx/layout.html
> static/plugin_layouts/xxx/*
>
> This allows me to install multiple layouts and swamp them by replacing
> views/layout.html
> with
> views/plugin_layouts/xxx/layout.html
>
> Massimo
>
> On Sep 24, 6:48 pm, Andrew  wrote:
>
>
>
> > Hi,
> > I'm trying to create a layout plugin, and I'm using the existing
> > layouts atwww.web2py.com/layoutsasa guide.
> > I've noticed that they have names like web2py.plugin.layout_Name.w2p
> > but when I install them they are all called "plugin_layouts".
>
> > I'm guessing the plugin name in the w2p file was changed, or manually
> > created with tar (from another post).  Were they all developed with
> > the name "plugin_layouts".  I don't see that naming convention
> > mentioned anywhere.
>
> > So, to follow the convention, should I develop my layout by calling it
> > plugin_layouts and following the folder and naming conventions of the
> > other layouts, and then rename the packed file from
> > web2py.plugin.plugin_layouts.w2p to
> > web2py.plugin_layout_MyFancyLayoutName.w2p ?
>
> > Thanks
>
> > Andrew W


Re: [web2py] 1.99.1 and ssl/https

2011-09-24 Thread LightDot
This might be a different error you're seeing. Your web2py does not seem to 
be configured for SSL connections. Did you pass the path of your SSL 
certificate to the Rocket server? Do you have the python ssl library 
installed?

This somewhat cryptic error usually means that you're trying to connect to 
an ordinary http-speaking server using a https protocol. Your browser 
expects a SSL certificate in response, but gets an ordinary html response 
header instead... hence the error.


[web2py] Re: featured web2py apps

2011-09-24 Thread pbreit
I assume "it does *not* matter if you wrote or just saw it"?

RE: [web2py] 1.99.1 and ssl/https

2011-09-24 Thread Cameron
Just tried ssl via the admin console.

Running windows 7 64 with 32 bit (I think) python 2.7.2.

Got this in firefox version 6.x:
""
Secure Connection Failed
An error occurred during a connection to 127.0.0.1:8000.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long) 
""

Got this in chrome:
""
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
""

Opera just sits with the hour glass running.

IE doesn't say much of anything, but the site doesn't come up.

Works great without ssl.

Can't find any error log entry in the admin app error page. I'm a beginner
with web2py but I can do a packet capture if you tell me where to send it.


-Original Message-
From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of
Massimo Di Pierro
Sent: Saturday, September 24, 2011 8:02 PM
To: web2py-users
Subject: [web2py] 1.99.1 and ssl/https

Has anybody tried 1.99.1 with https (other thank Dirk)? We have a strange
error logged and we cannot get to the bottom of it. Perhaps if you have
tried on other OSes/Python version it can help us narrow it downs.  It seems
to work even if the error is logged.

Massimo



[web2py] Re: 1.99.1 and ssl/https

2011-09-24 Thread LightDot
Yes, I'm using it. My configuration:

Scientific Linux 6.1 in an openvz virtual machine, fully updated
python 2.6.6-20.el6
apache 2.2.15-9.sl6.2
using mod_wsgi in daemon mode.

I'm using SSL with a self signed cert, standard port 443. So far I have only 
used the admin app briefly, with "parameters_443.py" file present. Nothing 
seems out of the ordinary, no errors...

I can do some specific tests if needed. Is there anything special I should 
be looking for?


Re: [web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Pepe Araya
thank you so much!

[web2py] Re: Can you filter a table before performing a join?

2011-09-24 Thread monotasker
My sql is very rusty, but here's the use case. I have two tables, one with 
quiz questions (db.questions) and one with records for each student's 
performance on each question (db.question_records). The latter table adds a 
new row when a particular student tries a question for the first time, and 
then updates that row on each subsequent attempt. It includes a "date" field 
for the last successful attempt.

What I need to do is select all of the questions (from db.question) *unless* 
the student has attempted it already (i.e. there is a corresponding row in 
db.question_records) AND a successful attempt was already made today 
(db.question_records.last_right == request.now). So far I have done this:

#join the two tables, including questions with no record yet in 
db.question_records
questions = db().select(db.questions.ALL, db.question_records.ALL, 
left=db.question_records.on(db.questions.id == 
db.question_records.question)) 

#exclude questions gotten right today by this user
questions1 = questions.exclude(lambda row: (row.question_records.name == 
auth.user_id) and (db.question_records.last_right != request.now)) 

Problem: I think in the initial left join I'm only getting the first 
matching row from db.question_records. So I'd like to be able to filter that 
table first to include only the rows for the current user.


[web2py] Re: featured web2py apps

2011-09-24 Thread Massimo Di Pierro
This thread did not work as I expected. Let's try again. I am
interested in the set of apps meeting these specs:

- it does matter if you wrote or just saw it, just post below
- the app must be open source
- the app must be under version control and available
- the app must use Auth
- avoid duplicates, but if you saw in a previous thread, please post
it here again
List:
- app name
- app author
- app description
- where to get it
- possibly a link to a screenshot
- whether you think it is stable or not (why not?)


I agree that other types app would be interesting (commercial apps for
example) but please use another thread for that. Also This is not a
thread for discussion. I am hoping to get a useful list.

Massimo


[web2py] 1.99.1 and ssl/https

2011-09-24 Thread Massimo Di Pierro
Has anybody tried 1.99.1 with https (other thank Dirk)? We have a
strange error logged and we cannot get to the bottom of it. Perhaps if
you have tried on other OSes/Python version it can help us narrow it
downs.  It seems to work even if the error is logged.

Massimo


Re: [web2py] Re: Instan Admin

2011-09-24 Thread Javier Quarite
It works!
Thank you so much

I sent an e-mail yesterday but I got no response. I hope this post help
others

On Sat, Sep 24, 2011 at 6:57 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Must be a bug.
>
> from storage import Settings
>
> should be
>
> from gluon.storage import Settings
>
> You may want to report it to the author.
>
> On Sep 24, 6:45 pm, Javier Quarite  wrote:
> > Thanks for your reply, but it keeps the same error message
> >
> > 1.Traceback (most recent call last):
> > 2.  File "gluon/restricted.py", line 181, in restricted
> > 3.  File "PATH web2py
> > folder/web2py/applications/sistema/models/plugin_instant_admin.py"
> >  .>,
> > line 3, in <   module>
> > 4.ImportError: No module named storage
> >
> > I'm not sure how to solve this
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Sep 24, 2011 at 3:36 PM, IK  wrote:
> > > Ops, sorry you have to install it as a plugin not module.
>


[web2py] Re: Instan Admin

2011-09-24 Thread Massimo Di Pierro
Must be a bug.

from storage import Settings

should be

from gluon.storage import Settings

You may want to report it to the author.

On Sep 24, 6:45 pm, Javier Quarite  wrote:
> Thanks for your reply, but it keeps the same error message
>
> 1.Traceback (most recent call last):
> 2.  File "gluon/restricted.py", line 181, in restricted
> 3.  File "PATH web2py
> folder/web2py/applications/sistema/models/plugin_instant_admin.py"
> ,
> line 3, in <   module>
> 4.ImportError: No module named storage
>
> I'm not sure how to solve this
>
>
>
>
>
>
>
> On Sat, Sep 24, 2011 at 3:36 PM, IK  wrote:
> > Ops, sorry you have to install it as a plugin not module.


[web2py] Re: Can you filter a table before performing a join?

2011-09-24 Thread Massimo Di Pierro
Can you provide a sql example?

On Sep 24, 6:51 pm, monotasker  wrote:
> I have a complex select() that would be much easier if I could do a left
> outer join between a db table and a rows object resulting from a previous
> db.select(). Is this possible?


[web2py] Re: Creating a Layout Plugin

2011-09-24 Thread Massimo Di Pierro
Good point. The name of the plugin (after installed) is not determined
by the filename (w2p) but determined by the file content of the w2p
file.

I used the convention to put all layout as subfolder so a
plugin_layouts so

web2py.plugin.layout_xxx.w2p would contain
views/layout.html
views/plugin_layouts/xxx/layout.html
static/plugin_layouts/xxx/*

This allows me to install multiple layouts and swamp them by replacing
views/layout.html
with
views/plugin_layouts/xxx/layout.html

Massimo

On Sep 24, 6:48 pm, Andrew  wrote:
> Hi,
> I'm trying to create a layout plugin, and I'm using the existing
> layouts atwww.web2py.com/layoutsas a guide.
> I've noticed that they have names like web2py.plugin.layout_Name.w2p
> but when I install them they are all called "plugin_layouts".
>
> I'm guessing the plugin name in the w2p file was changed, or manually
> created with tar (from another post).  Were they all developed with
> the name "plugin_layouts".  I don't see that naming convention
> mentioned anywhere.
>
> So, to follow the convention, should I develop my layout by calling it
> plugin_layouts and following the folder and naming conventions of the
> other layouts, and then rename the packed file from
> web2py.plugin.plugin_layouts.w2p to
> web2py.plugin_layout_MyFancyLayoutName.w2p ?
>
> Thanks
>
> Andrew W


[web2py] Can you filter a table before performing a join?

2011-09-24 Thread monotasker
I have a complex select() that would be much easier if I could do a left 
outer join between a db table and a rows object resulting from a previous 
db.select(). Is this possible?



[web2py] Creating a Layout Plugin

2011-09-24 Thread Andrew
Hi,
I'm trying to create a layout plugin, and I'm using the existing
layouts at www.web2py.com/layouts as a guide.
I've noticed that they have names like web2py.plugin.layout_Name.w2p
but when I install them they are all called "plugin_layouts".

I'm guessing the plugin name in the w2p file was changed, or manually
created with tar (from another post).  Were they all developed with
the name "plugin_layouts".  I don't see that naming convention
mentioned anywhere.

So, to follow the convention, should I develop my layout by calling it
plugin_layouts and following the folder and naming conventions of the
other layouts, and then rename the packed file from
web2py.plugin.plugin_layouts.w2p to
web2py.plugin_layout_MyFancyLayoutName.w2p ?

Thanks

Andrew W


Re: [web2py] Re: Instan Admin

2011-09-24 Thread Javier Quarite
Thanks for your reply, but it keeps the same error message


1.Traceback (most recent call last):
2.  File "gluon/restricted.py", line 181, in restricted
3.  File "PATH web2py
folder/web2py/applications/sistema/models/plugin_instant_admin.py"
,
line 3, in <   module>
4.ImportError: No module named storage


I'm not sure how to solve this

On Sat, Sep 24, 2011 at 3:36 PM, IK  wrote:

> Ops, sorry you have to install it as a plugin not module.


[web2py] Re: web2py slides from pycon argentina (spanish)

2011-09-24 Thread Massimo Di Pierro
Fantastic slides. I see you moved to the new form.process().accepted
syntax. ;-)

On Sep 24, 9:25 am, Martín Mulone  wrote:
> web2py slides from pycon argentina (spanish)
>
> --
>  http://martin.tecnodoc.com.ar
>
>  pensandoengrande.pdf
> 1139KViewDownload


[web2py] Re: More Presentations at PyConAr (using deck2py)

2011-09-24 Thread Massimo Di Pierro
+1


On Sep 24, 5:44 pm, Mariano Reingart  wrote:
> I'd taken chinakr       app using deck js to make presentations (thanks!),
> and added some tables to support automatic slides generation using
> markmin.
>
> Included as an example are my tree talks at the conference:
>
> - rad2py
> - Python Sucks
> - gui2py lighting talk
>
> You can see that running here:https://www.web2py.com.ar/deck2py/
>
> To download the app go 
> to:https://www.web2py.com.ar/welcome/static/web2py.app.deck2py.w2p
>
> Best regards
>
> Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com


[web2py] Re: load restricted errors

2011-09-24 Thread Massimo Di Pierro
Yes it should. Please open a ticket this will require some thought and
some work

On Sep 24, 2:01 pm, apple  wrote:
> I can do that then load the component separately to test it as you
> suggested.
>
> But it still feels a bit wrong. Why can't web2py tell me where the
> error has occurred?
>
> On Sep 24, 7:37 pm, pbreit  wrote:
>
>
>
>
>
>
>
> > Can you print each component name? Maybe like:
>
> > {{for component in componentlist:}}
> >     {{=str(component.function}}
> >     {{=LOAD(f=component.function, extension="load", ajax=False,
> > ajaxTrap=True, args=component.args, vars=component.vars)}}
> >     
> > {{pass}}


[web2py] Re: table, grid, smartgrid, getting better

2011-09-24 Thread Massimo Di Pierro
Yes they are:

grid=SQLFORM.smartgrid(db.person,ui='jquery-ui')

On Sep 24, 12:48 pm, Ivica Kralj  wrote:
> Hi,
>
> I'm quite impressed with the features in this release (also it didn't break
> anything :) )
>
> Just a question for Martin or Bruno, or anybody who knows the answer
> regarding smartrgid/grid and Jquery UI themes application. I've spent few
> hours searching through this group and couldn't find  the answer.
>
> Are Jquery UI themes supported by default in grid/smartgrid (I know there
> was talk about this but no sure if it's implemented) and if not how to
> activate it? I've seen there is a patch, but again not sure if it was
> applied to latest release.
>
> I tried few variation, and I'm running out ideas (last option is to check
> the code, but posting this question here might be faster and beneficial to
> other users)
>
>     grid=SQLFORM.smartgrid(db.person,jqueryui=True) ##wrong, do not use###
>
> For example in this demo Jquery UI css is used.
>
> http://labs.blouweb.com/web2pygrid/default/index?jqueryui=true
>
>   While in my app using smartgrid html looks like this
>
>  
> Thanks
> I
>
> On 24 August 2011 11:13, Bruno Rocha  wrote:
>
>
>
>
>
>
>
> > JqueryUI Applied! (Any Theme fromhttp://jqueryui.com/themeroller)
>
> > Take a look in attached screenshots (a patch is comming to Massimo's mail)


[web2py] Re: cs-cz.py

2011-09-24 Thread Massimo Di Pierro
this is in trunk now. thanks sd.

On Sep 23, 1:16 pm, sd  wrote:
> Czech translation
>
> http://pastebin.com/pg4xhzJt
>
> ps: chtelo by to nejakou osvetu na zdrojak.root.cz :)


[web2py] More Presentations at PyConAr (using deck2py)

2011-09-24 Thread Mariano Reingart
I'd taken chinakr   app using deck js to make presentations (thanks!),
and added some tables to support automatic slides generation using
markmin.

Included as an example are my tree talks at the conference:

- rad2py
- Python Sucks
- gui2py lighting talk

You can see that running here:
https://www.web2py.com.ar/deck2py/

To download the app go to:
https://www.web2py.com.ar/welcome/static/web2py.app.deck2py.w2p

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


Re: [web2py] web2py slides from pycon argentina (spanish)

2011-09-24 Thread Ovidio Marinho
+1



   Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
   83   8826 9088 - Oi
 83   9334 0266 - Claro
   Paraiba-Brasil



2011/9/24 Martín Mulone 

> web2py slides from pycon argentina (spanish)
>
> --
>  http://martin.tecnodoc.com.ar
>
>


[web2py] Re: Instan Admin

2011-09-24 Thread IK
Ops, sorry you have to install it as a plugin not module.

Re: [web2py] html in displayed text field

2011-09-24 Thread monotasker
Thanks Bruno. Nice and simple.


[web2py] Re: Instan Admin

2011-09-24 Thread IK
Hi,

As nobody answered this question, I'll give it a try. I only installed this 
module couple of few days ago, and here it's how I've set it up.

Ok so you install iadmin as a module inside the app.

You access it with this link:

https://127.1.1.1/APPNAME/plugin_instant_admin/user/login

You might have to modify username and password for super user if you auth 
is configured to use only email and not username. Not sure what is default 
password.

To change username or password open appadmin page:

https://127.1.1.1/APPNAME/
appadmin/select/db?query=db.auth_user.id%3E0

Cheers
I



Re: [web2py] html in displayed text field

2011-09-24 Thread Bruno Rocha
{{=XML(row.field)}}

http://zerp.ly/rochacbruno
Em 24/09/2011 17:18, "monotasker"  escreveu:
> I have a db text field that is displayed to the user and I'd like to be
able
> to format the text inside using html. But when I retrieve a row (using
> db.select()) and display the field (using {{=row.field}} in my view) the
> html just shows up as normal text. Is there any way to fix this? I.e., to
> have the html be interpreted as markup instead of just text for display?
>
> Thanks


[web2py] html in displayed text field

2011-09-24 Thread monotasker
I have a db text field that is displayed to the user and I'd like to be able 
to format the text inside using html. But when I retrieve a row (using 
db.select()) and display the field (using {{=row.field}} in my view) the 
html just shows up as normal text. Is there any way to fix this? I.e., to 
have the html be interpreted as markup instead of just text for display?

Thanks 


Re: [web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread monotasker
That's really helpful. Somehow I had missed it. Thanks Yota.


Re: [web2py] web2py slides from pycon argentina (spanish)

2011-09-24 Thread Bruno Rocha
Congrats Martin,

Great slides, I am going to stole something for my talk sept 29.

http://zerp.ly/rochacbruno
Em 24/09/2011 11:25, "Martín Mulone"  escreveu:
> web2py slides from pycon argentina (spanish)
>
> --
> http://martin.tecnodoc.com.ar


[web2py] Re: Help Getting Cron Task to run

2011-09-24 Thread Lennon
I also just tried:

*/1 * * * * python /home/www-data/web2py/web2py.py -S sos_test -M -N -
R applications/sos_test/private/scripts/ctest.py

and

*/1 * * * * python /home/www-data/web2py/web2py.py -S sos_test -M -N -
R /private/scripts/ctest.py

I also noticed that my crontab file doesn't have a file extension.  Is
that correct?

On Sep 24, 3:33 pm, Lennon  wrote:
> I'm still not able to get this to run.  I even tried restarting apache
> but to no avail.
>
> */1 * * * * python /home/www-data/web2py/web2py.py -J -S my_app_name -
> R /cron/ctest.py
>
> ctest.py looks like this and runs fine in the command line on the
> server:
>
> FILE = open("pytest.txt","w")
> FILE.writelines('cronification')
> FILE.close()
>
> Any ideas?
>
> On Sep 23, 11:38 am, Ross Peoples  wrote:
>
>
>
>
>
>
>
> > You typically need to run it in the web2py environment (use absolute paths):
>
> > */1 * * * * python /path/to/web2py/web2py.py -J -S app_name -R
> > /path/to/script
>
> > You could also add something like "2&1> /path/to/log.log" so that output
> > gets put into a log file in case there's an error in your script.


[web2py] Re: Help Getting Cron Task to run

2011-09-24 Thread Lennon
I'm still not able to get this to run.  I even tried restarting apache
but to no avail.

*/1 * * * * python /home/www-data/web2py/web2py.py -J -S my_app_name -
R /cron/ctest.py

ctest.py looks like this and runs fine in the command line on the
server:

FILE = open("pytest.txt","w")
FILE.writelines('cronification')
FILE.close()

Any ideas?

On Sep 23, 11:38 am, Ross Peoples  wrote:
> You typically need to run it in the web2py environment (use absolute paths):
>
> */1 * * * * python /path/to/web2py/web2py.py -J -S app_name -R
> /path/to/script
>
> You could also add something like "2&1> /path/to/log.log" so that output
> gets put into a log file in case there's an error in your script.


[web2py] possible bug in LOAD with ajax=false

2011-09-24 Thread apple
When call singleview and submit the form it should print singleview,
edit, edit. However it prints singleview, edit, singleview, edit. Why
is the submit not trapped and sent via ajax to the edit controller?

controller.

def edit():
print("edit")
table=db["customer"]
form=SQLFORM(table,1)
return dict(form=XML(form))

def singleview():
print("singleview")
return dict()
*
edit.load...

{{=form}}

singleview

{{extend 'layout.html'}}
{{=LOAD(f='edit.load', ajax=False, ajaxTrap=True)}}


[web2py] Re: load restricted errors

2011-09-24 Thread apple
I can do that then load the component separately to test it as you
suggested.

But it still feels a bit wrong. Why can't web2py tell me where the
error has occurred?

On Sep 24, 7:37 pm, pbreit  wrote:
> Can you print each component name? Maybe like:
>
> {{for component in componentlist:}}
>     {{=str(component.function}}
>     {{=LOAD(f=component.function, extension="load", ajax=False,
> ajaxTrap=True, args=component.args, vars=component.vars)}}
>     
> {{pass}}


[web2py] Re: load restricted errors

2011-09-24 Thread pbreit
Can you print each component name? Maybe like:

{{for component in componentlist:}}
{{=str(component.function}}
{{=LOAD(f=component.function, extension="load", ajax=False, 
ajaxTrap=True, args=component.args, vars=component.vars)}} 
 
{{pass}} 


[web2py] Re: web2py slides from pycon argentina (spanish)

2011-09-24 Thread pbreit
Martin,

I'm curious about structuring a new app using the new importing and modules. 
I read your blog post:
http://martin.tecnodoc.com.ar/default/post/2011/09/12/7_optimize-your-web2py-app-using-the-new-import-method

Which is very helpful but I couldn't get it to work. I suspect the 
simpleapp.zip download would help but it's 
broken: http://martin.tecnodoc.com.ar/static/others/simpleapp.zip

Thanks for any help.


Re: [web2py] Re: problem changing version 1.95.1 to version 1.98.2

2011-09-24 Thread Phyo Arkar
I already ran into this problem and i beleive theres a need for
announcement section on web2py.com site showing that generic is
disabled by default Starting at ... Version.

I already suggested to massimo i believe he will add an announcement
section when hes free.

On 9/22/11, nick name  wrote:
> Python does, in a way ... if you use a depcreated feature, you get a
> deprecation warning when running the code.
>
> And, the purpose of such a change is to optimize support/googlegroup traffic
> -- this specific issue comes up every single week since it was introduced.
>


Re: [web2py] Re: featured web2py apps

2011-09-24 Thread Phyo Arkar
I am writing a Web UI for   Mercurial TODO Plugin and for that case I
am not going to need Auth. WHy it is a requirment ?

On 9/23/11, Anthony  wrote:
> Why does it have to use Auth? What if access control isn't relevant for the
> particular app?
>
> Anthony
>
> On Thursday, September 22, 2011 2:52:05 PM UTC-4, Massimo Di Pierro wrote:
>>
>> I think we should make a list of featured web2py apps. Please post
>> links below.
>>
>> - it does matter if you wrote or just saw it, just post below
>> - the app must be open source
>> - the app must be under version control and available
>> - the app must use Auth
>> - avoid duplicates, but if you saw in a previous thread, please post
>> it here again
>>
>> List:
>> - app name
>> - app author
>> - app description
>> - where to get it
>> - possibly a link to a screenshot
>> - whether you think it is stable or not (why not?)
>>
>> Massimo
>
>


[web2py] Re: load restricted errors

2011-09-24 Thread apple
I am loading 12 components. The error message "restricted error" on
the LOAD line is unhelpful. It does not tell me which component has
failed. Today it is one component, another day it may be another.

Of course I can amend the code to try one component at a time and then
do what you suggestis there not a better way?

On Sep 24, 6:44 pm, pbreit  wrote:
> Is it the same component that is failing? You can view the component by
> itself in the browser like 
> this:http://localhost:8000/myapp/component/function.load


Re: [web2py] Re: table, grid, smartgrid, getting better

2011-09-24 Thread Ivica Kralj
Hi,

I'm quite impressed with the features in this release (also it didn't break
anything :) )

Just a question for Martin or Bruno, or anybody who knows the answer
regarding smartrgid/grid and Jquery UI themes application. I've spent few
hours searching through this group and couldn't find  the answer.

Are Jquery UI themes supported by default in grid/smartgrid (I know there
was talk about this but no sure if it's implemented) and if not how to
activate it? I've seen there is a patch, but again not sure if it was
applied to latest release.

I tried few variation, and I'm running out ideas (last option is to check
the code, but posting this question here might be faster and beneficial to
other users)

grid=SQLFORM.smartgrid(db.person,jqueryui=True) ##wrong, do not use###


For example in this demo Jquery UI css is used.

http://labs.blouweb.com/web2pygrid/default/index?jqueryui=true

  wrote:

> JqueryUI Applied! (Any Theme from http://jqueryui.com/themeroller)
>
> Take a look in attached screenshots (a patch is comming to Massimo's mail)
>


[web2py] Re: load restricted errors

2011-09-24 Thread pbreit
Is it the same component that is failing? You can view the component by 
itself in the browser like this:
http://localhost:8000/myapp/component/function.load


[web2py] load restricted errors

2011-09-24 Thread apple
I have a loop in a view that loads a set of components (see code
below). However if one of the components fails then I get a
"restricted error" and the line number is the line of the LOAD command
so I do not even know which component failed let alone the real error
message and line number.

Is using LOAD in this way a bad design? Or is there some way I can get
at the errors?


{{for component in componentlist:}}
{{=LOAD(f=component.function, extension="load", ajax=False,
ajaxTrap=True, args=component.args, vars=component.vars)}}

{{pass}}



Re: [web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Yota Ichino
Hi, Pepe

Some time ago, I wrote "how to add applications" to README.md.
Please read this file.
https://github.com/nus/web2py-for-fluxflex/blob/master/README.md

2011/9/25 Pepe Araya :
> Hi, I have same problems here.
> can someone record a step by step screencast?
> when I clone the repo, I only get one folder and 4 files:
>
> public_html> dispatch.fcgi
> icon.png
> README
> tmp_fb_pw
> how I can to add one app?
> Thanks so much!


[web2py] Re: file locations once web2py is deployed on fluxflex

2011-09-24 Thread Pepe Araya
Hi, I have same problems here.

can someone record a step by step screencast?

when I clone the repo, I only get one folder and 4 files:

public_html> dispatch.fcgi
icon.png
README
tmp_fb_pw

how I can to add one app?

Thanks so much!


[web2py] Re: Sort order for related table grids in SQLFORM.smartgrid

2011-09-24 Thread Martin.Mulone
+1 it's confusing every body, I made this way because I don't want to touch 
DAL.

[web2py] Re: problem with updating Form with writable=False Fields

2011-09-24 Thread Cliff
You are correct.  I misspoke.

On Sep 23, 8:30 pm, Anthony  wrote:
> As I understand the term, use of detect_record_change is actually optimistic
> locking. When User 1 loads an update form, User 2 can still read the
> existing record and even load their own update form. However, if User 2 ends
> up updating the record before User 1 submits the form, then User 1's form
> submission will fail. Note, nothing is actually locked at the database level
> -- this is all done via SQLFORM (hence still a small possibility of a race
> condition).
>
> Anthony
>
>
>
> On Friday, September 23, 2011 7:34:43 PM UTC-4, Cliff wrote:
>
> > That would be a way to do pessimistic locking.
>
> > Of course I'm assuming DAL uses optimistic locking as it is sufficient
> > 99% of the time.
>
> > On Sep 23, 5:39 pm, Anthony  wrote:
> > > You can also do:
>
> > > form.accepts(..., detect_record_change=True)
>
> > > and the update will fail if the record has changed in the DB since the
> > form
> > > was originally loaded (the original record is hashed and used as the
> > formkey
> > > and then compared to the DB record again right before update -- I suppose
>
> > > there's still a slight chance of a race condition). In this case, your
> > > method is probably better because different users would be updating
> > > different fields, so no reason to force a failure.
>
> > > Anthony
>
> > > On Friday, September 23, 2011 5:14:01 PM UTC-4, Alex wrote:
>
> > > > thanks for the response! I already thought about using dbio=False
> > > > parameter, with the update_record method this should now be quite
> > > > easy.
>
> > > > explanation why it's important for me: in my scenario the auth_user
> > > > table has many additional fields (address, bank account information,
> > > > etc.), all these settings can only be changed by an admin user. only
> > > > the password can be modified by the user itself. If both the admin and
> > > > the user edit the same record at a time, the last one who saves it
> > > > would overwrite the previous changes. If I only update the fields
> > > > which are shown in the form then both users cannot overwrite the
> > > > changes of each other. I'm also performing optimistic locking (with a
> > > > version nr.) but in this case it is not necessary because both users
> > > > modify different fields.
>
> > > > On 23 Sep., 22:13, DenesL  wrote:
> > > > > It is not a bug. Quoting the book:
> > > > > When a Field is marked with writable=False, the field is not shown in
>
> > > > > create forms, and it is shown readonly in update forms. If a field is
>
> > > > > marked as writable=False and readable=False, then the field is not
> > > > > shown at all, not even in update forms.
>
> > > > > This has nothing to do with the auto-(update, insert or delete)
> > > > > operations performed by form.accepts
>
> > > > > To update only the setting1 field you can do:
>
> > > > > def edit1():
> > > > >     id = request.args(0)
> > > > >     db.mytable.setting2.readable = db.mytable.setting2.writable =
> > > > > False
> > > > >     row = db.mytable(id)
> > > > >     form=SQLFORM(db.mytable, row)
> > > > >     if form.accepts(request.vars, formname='mytable_form',
> > > > > dbio=False):
> > > > >         row.update_record(**form.vars)
> > > > >         logger.debug(db._lastsql)
> > > > >     return dict(form=form)
>
> > > > > as explained in:
> > > >http://web2py.com/book/default/chapter/07#SQLFORM-without-database-IO
>
> > > > > but it really makes no difference, except for some IO, the resulting
> > > > > database record will be identical in both cases, so why bother?.


Re: [web2py] cs-cz.py

2011-09-24 Thread Bruno Rocha
Open a google issue for this...

http://zerp.ly/rochacbruno
Em 23/09/2011 17:42, "sd"  escreveu:
> Czech translation
>
> http://pastebin.com/pg4xhzJt
>
> ps: chtelo by to nejakou osvetu na zdrojak.root.cz :)


[web2py] Re: local_import does not work

2011-09-24 Thread Necati Demir
I started to see error messages again. So it is not about 1.94.

On Sep 24, 10:26 am, Necati Demir  wrote:
> No. But I realized that I was using 1.94 and now switched to 1.99. I
> will use 1.99 and see if there is a problem. Was there a problem like
> that in 1.94?
>
> On Sep 23, 11:44 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > Do you touch sys.path in your code?
>
> > On Sep 23, 3:21 pm, Necati Demir  wrote:
>
> > > I say "randomly" because
>
> > > When i refresh page, it works. And another refresh; it gives error:
> > > ImportError: No module named testapp.modules.mymodule
> > > With another page refresh it works bu if your unlucky it gives error
> > > again.
>
> > > I did not found any patterns.
> > > But I noticed something; when it starts to give errors, I restart
> > > apache* and I do not get errors for some time (say 1 hour).
>
> > > * I use apache+mod_wsgi
>
> > > On Sep 23, 5:08 pm, Massimo Di Pierro 
> > > wrote:
>
> > > > True it is deprecated but still, it should work. What do you me
> > > > "randomly does not work". Is this for a specific module or app?
>
> > > > On Sep 23, 8:50 am, Anthony  wrote:
>
> > > > > As of version 1.96.1, local_import() has been deprecated. You should 
> > > > > be able
> > > > > to do:
>
> > > > > import mymodule
>
> > > > > and it will look in your application's /modules folder before checking
> > > > > sys.path.
> > > > > Anthony
>
> > > > > On Friday, September 23, 2011 3:11:08 AM UTC-4, Necati Demir wrote:
>
> > > > > > Hello,
>
> > > > > > local_import function randomly does not import my modules from 
> > > > > > modules
> > > > > > directory.
> > > > > > I have this problem when i use web2py with apache (with wsgi).
>
> > > > > > Any suggestion?


[web2py] Re: local_import does not work

2011-09-24 Thread Necati Demir
No. But I realized that I was using 1.94 and now switched to 1.99. I
will use 1.99 and see if there is a problem. Was there a problem like
that in 1.94?

On Sep 23, 11:44 pm, Massimo Di Pierro 
wrote:
> Do you touch sys.path in your code?
>
> On Sep 23, 3:21 pm, Necati Demir  wrote:
>
>
>
>
>
>
>
> > I say "randomly" because
>
> > When i refresh page, it works. And another refresh; it gives error:
> > ImportError: No module named testapp.modules.mymodule
> > With another page refresh it works bu if your unlucky it gives error
> > again.
>
> > I did not found any patterns.
> > But I noticed something; when it starts to give errors, I restart
> > apache* and I do not get errors for some time (say 1 hour).
>
> > * I use apache+mod_wsgi
>
> > On Sep 23, 5:08 pm, Massimo Di Pierro 
> > wrote:
>
> > > True it is deprecated but still, it should work. What do you me
> > > "randomly does not work". Is this for a specific module or app?
>
> > > On Sep 23, 8:50 am, Anthony  wrote:
>
> > > > As of version 1.96.1, local_import() has been deprecated. You should be 
> > > > able
> > > > to do:
>
> > > > import mymodule
>
> > > > and it will look in your application's /modules folder before checking
> > > > sys.path.
> > > > Anthony
>
> > > > On Friday, September 23, 2011 3:11:08 AM UTC-4, Necati Demir wrote:
>
> > > > > Hello,
>
> > > > > local_import function randomly does not import my modules from modules
> > > > > directory.
> > > > > I have this problem when i use web2py with apache (with wsgi).
>
> > > > > Any suggestion?