[web2py] Re: Err 24: too many files open

2013-07-24 Thread dederocks
Thank you Paolo for the benchmark!
In my case, I start at 107, and at the end of the process the count is at 
672!! nginx on the other hand is stable around 55.
And the culprit is (drums ...): redis! The large majority of the files 
opened are the redis port.
Extract from lsof:
uwsgi   2128 www-data  511u  IPv4  62305  0t0 TCP 
localhost:56632->localhost:6379 (ESTABLISHED)
uwsgi   2128 www-data  512u  IPv4  62536  0t0 TCP 
localhost:56661->localhost:6379 (ESTABLISHED)
uwsgi   2128 www-data  513u  IPv4  62361  0t0 TCP 
localhost:56639->localhost:6379 (ESTABLISHED)
uwsgi   2128 www-data  514u  IPv4  62377  0t0 TCP 
localhost:56641->localhost:6379 (ESTABLISHED)
uwsgi   2128 www-data  515u  IPv4  62392  0t0 TCP 
localhost:56643->localhost:6379 (ESTABLISHED)

Does someone know how to fix this?

Le jeudi 25 juillet 2013 08:28:08 UTC+2, Paolo Valleri a écrit :
>
> dederocks, I've just tried to run lsof -p  on a ubuntu server 
> running web2py
> In my case, it returns 138 opened files among libraries, sockets and so 
> on; the most opened file is /dev/zero, opened 55 times.  
>
> Paolo
>
> On Thursday, July 25, 2013 8:18:32 AM UTC+2, dederocks wrote:
>>
>> Thanks a lot for the link. Unfortunately it didn't help.
>> @roberto: the uwsgi process is then indeed eating all the CPU - but I'm 
>> not sure it means uwsgi is the culprit, at least at this stage (could be 
>> the case earlier though).
>> Is there in linux a way to know who opened which file and when? lsof 
>> gives only the process, not the time.
>>
>> Le mercredi 24 juillet 2013 23:56:10 UTC+2, Niphlod a écrit :
>>>
>>> it's a problem on the layers "at the base" of web2py, such as the os, 
>>> nginx or uwsgi.
>>> http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/
>>> let's see if @roberto (the developer behind uwsgi) passes by with some 
>>> useful tips too. 
>>>
>>> On Wednesday, July 24, 2013 4:30:51 PM UTC+2, dederocks wrote:

 I'm running web2py on nginx /uwsgi.
 And in a sequence implying frequent serveur calls, I eventually get an 
 error 500 from the server, which is actualy an error 24: too many files 
 open (see ticket in attachement).

 I checked former reports on this error, but none seems to match this 
 case: I'm not using rocket, and running the latest web2py stable version.
 I checked also on opening files myself, but that is never the case 
 (e.g. always done by web2py).
 I tried to increase the file opened limit (ulimit -SHn 4048), but to no 
 improvement.

 Any suggestion?

 Thanks in advance, Andre




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Link to default value for db table field

2013-07-24 Thread shapovalovdenis
sorry to bump it up.

But still looking for a simple way to avoid keeping the same values in 
fields, there should be some way similar to symlinks, no?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Err 24: too many files open

2013-07-24 Thread Paolo Valleri
dederocks, I've just tried to run lsof -p  on a ubuntu server 
running web2py
In my case, it returns 138 opened files among libraries, sockets and so on; 
the most opened file is /dev/zero, opened 55 times.  

Paolo

On Thursday, July 25, 2013 8:18:32 AM UTC+2, dederocks wrote:
>
> Thanks a lot for the link. Unfortunately it didn't help.
> @roberto: the uwsgi process is then indeed eating all the CPU - but I'm 
> not sure it means uwsgi is the culprit, at least at this stage (could be 
> the case earlier though).
> Is there in linux a way to know who opened which file and when? lsof gives 
> only the process, not the time.
>
> Le mercredi 24 juillet 2013 23:56:10 UTC+2, Niphlod a écrit :
>>
>> it's a problem on the layers "at the base" of web2py, such as the os, 
>> nginx or uwsgi.
>> http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/
>> let's see if @roberto (the developer behind uwsgi) passes by with some 
>> useful tips too. 
>>
>> On Wednesday, July 24, 2013 4:30:51 PM UTC+2, dederocks wrote:
>>>
>>> I'm running web2py on nginx /uwsgi.
>>> And in a sequence implying frequent serveur calls, I eventually get an 
>>> error 500 from the server, which is actualy an error 24: too many files 
>>> open (see ticket in attachement).
>>>
>>> I checked former reports on this error, but none seems to match this 
>>> case: I'm not using rocket, and running the latest web2py stable version.
>>> I checked also on opening files myself, but that is never the case (e.g. 
>>> always done by web2py).
>>> I tried to increase the file opened limit (ulimit -SHn 4048), but to no 
>>> improvement.
>>>
>>> Any suggestion?
>>>
>>> Thanks in advance, Andre
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Niphlod
just ensure that the user running apache has rw permissions on the web2py 
root dir, epsecially the uploads one.

Il giorno giovedì 25 luglio 2013 00:48:12 UTC+2, Joe Barnhart ha scritto:
>
> Well it's entirely possible I don't understand my problem.
>
> Running on my macbook locally everything works like a charm.  On the 
> "play" deployment server, which uses Apache, the script that deletes files 
> after processing fails because it lacks "permission" (according to the 
> web2py error log).  Also, when uploading the files Apache goes to 100% cpu 
> and stays there, consuming RAM until I get tired of watching.  Admittedly, 
> they are very large files (~200MB) but I don't see why Apache should 
> consume >2G of RAM while spinning in some kind of loop.
>
> Everything is set up as in the book and messages here -- I used Debian 
> Linux for the play server and used www-data for the user and group, and put 
> web2py under /home/www-user/.  The website works fine in all other ways, 
> but just has issues uploading/downloading files from my web page file 
> loader.
>
> I must say this web deployment step is much harder than using web2py to 
> create the site!
>
> -- Joe B.
>
> On Wednesday, July 24, 2013 2:58:07 PM UTC-7, Niphlod wrote:
>>
>> there are no special permissions because apache can't serve the uploads 
>> directory by itself. Remember that "uploads" is not the same as "static". 
>> The uploads are interely managed by web2py.
>>
>> On Wednesday, July 24, 2013 11:51:05 AM UTC+2, Joe Barnhart wrote:
>>>
>>> So a central part of my website is a repository of files/objects that 
>>> are added and removed.  I've chosen to use the "uploads" folder in my 
>>> application directory, with additional feature of scattering the files into 
>>> subdirectories (because I expect a LOT of them).
>>>
>>> I'm trying the stock apache2 setup from the book but I find it has no 
>>> provision for permissions on the uipload directory.  I copied the setup for 
>>> the "static" directory and was able to put files in the directory, but I 
>>> can't delete files from the directory within my site.
>>>
>>> Has anyone worked out the changes needed to the stock Apache2 setup that 
>>> accommodates the upload directory?  Seems like it would be a nice 
>>> addition/update to the book setup.
>>>
>>> Joe B.
>>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Err 24: too many files open

2013-07-24 Thread dederocks
Thanks a lot for the link. Unfortunately it didn't help.
@roberto: the uwsgi process is then indeed eating all the CPU - but I'm not 
sure it means uwsgi is the culprit, at least at this stage (could be the 
case earlier though).
Is there in linux a way to know who opened which file and when? lsof gives 
only the process, not the time.

Le mercredi 24 juillet 2013 23:56:10 UTC+2, Niphlod a écrit :
>
> it's a problem on the layers "at the base" of web2py, such as the os, 
> nginx or uwsgi.
> http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/
> let's see if @roberto (the developer behind uwsgi) passes by with some 
> useful tips too. 
>
> On Wednesday, July 24, 2013 4:30:51 PM UTC+2, dederocks wrote:
>>
>> I'm running web2py on nginx /uwsgi.
>> And in a sequence implying frequent serveur calls, I eventually get an 
>> error 500 from the server, which is actualy an error 24: too many files 
>> open (see ticket in attachement).
>>
>> I checked former reports on this error, but none seems to match this 
>> case: I'm not using rocket, and running the latest web2py stable version.
>> I checked also on opening files myself, but that is never the case (e.g. 
>> always done by web2py).
>> I tried to increase the file opened limit (ulimit -SHn 4048), but to no 
>> improvement.
>>
>> Any suggestion?
>>
>> Thanks in advance, Andre
>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Massimo Di Pierro
Strange. They are the same app and same server, just different processes. 
They all seem to be up now.
One issue I have discovered is that pythonanywhere ignores regex in static 
files in config and therefore it lets web2py serve static files. Some 
static files are large and this cause processes to occasionally run out of 
memory and fail until re-started. I am working with PythonAnywhere to 
figure out how to properly deal with serving static files.

Massimo

On Thursday, 25 July 2013 00:37:45 UTC+2, Ovidio Marinho wrote:
>
> No www.web2py.com  olny web2py.com
>
> ok
>
>   
>
>
>  Ovidio Marinho Falcao Neto
>   ITJP.NET.BR
>  ovid...@gmail.com  
>83   8826 9088 - Oi
>83   9336 3782 - Claro
> Brasil
>   
>
>
> 2013/7/24 Rob Paire >
>
>> When I browse to www.web2py.com in chrome I get a page which says:
>> 502 bad gateway, I tried this from two different connections. 
>> PythonAnywhere.com seems to resolve correctly. 
>>
>> -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Appending for validation using jQuery.

2013-07-24 Thread Prasad Muley
Hello All,
I am newbie web2py programmer. I tried to do custom validation 
 using jQuery but not gettng expected result. Code is as followed:

*Model-db.py*

db.define_table('taxpayer',
Field('name'),
Field('married','boolean'),
Field('spouse_name')
)
# I don't want use IS_NOT_EMPTY() in this table

*Controller-default.py*

def taxer():
grid=SQLFORM.grid(db.taxpayer,user_signature=False)
if request.args(0) in ['edit']:
form=grid.update_form
if form.process(hiderrors=False).accepted:
response.flash=form.vars
return dict(grid=grid)

*
*
*View- default/taxer.html*

{{extend 'layout.html'}}
{{=grid}}

jQuery(document).ready( function(){
var flag=0
jQuery('.web2py_form').submit(function(){
//Getting value from tracker status
var get_name=jQuery('#taxpayer_name').val()
if(get_name =="") {
if(flag==0) {
   //alert("Please Enter valid Name");  WORKING
   jQuery("
Please Enter Valid Name
").appendTo("#taxpayer_name__label") // WORKING jQuery("
Please Enter Valid Name
").appendTo("#taxpayer_name") // NOT WORKING flag=1 } return false } }); }); Please help me for this. I want to display error message for 'name' field as IS_NOT_EMPTY() does. It successfully does for taxpayer_name__label even as well as taxpayer_name__row but isn't working for taxpayer_name id. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.

Re: [web2py] Re: Minify (compress) response HTML

2013-07-24 Thread Kernc
On Thu, Jul 25, 2013 at 1:15 AM, Elcimar  wrote:

> Hmm... Go to listacaiu.com and view source code of the main page..


Oh, yes, of course! Single-line comments need to be skipped too.
Will provide a patch ASAP.
Thanks. :-)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Vinicius Assef
+1 :-)

On Wed, Jul 24, 2013 at 5:17 PM, Richard Vézina
 wrote:
> If you feel you can hack the Vinicius web2py pytest app to embed a python
> BDD tool feel free to clone the repo and publish your improvement here!!
>
> :)
>
> Richard
>
>
> On Wed, Jul 24, 2013 at 3:41 PM, Clarke Bishop 
> wrote:
>>
>> Thanks Richard, this is very helpful!
>>
>> Lettuce let me to Behave. http://pythonhosted.org/behave/index.html
>>
>> And, they have a comparison with Lettuce and Freshen,
>> http://pythonhosted.org/behave/comparison.html.
>>
>> I guess I should have thought to do a search for Behavior Driven
>> Development in Python instead of in Web2Py.
>>
>> I'll keep playing with this and report back what I learn.
>>
>>  Clarke
>>
>>
>> On Wednesday, July 24, 2013 1:59:40 PM UTC-4, Clarke Bishop wrote:
>>>
>>> I've been doing the online course, CS169x, from Coursera. The course uses
>>> Ruby/Rails, but I like Python better. They picked Rails because they said it
>>> was the best for programmer productivity. Maybe once you get way down the
>>> learning curve, they are right. However, I find all the Rails "magic" to be
>>> confusing and hard to debug.
>>>
>>> So, I started looking for Rails for Python, and it seems Web2Py is the
>>> answer!
>>>
>>> I do understand MVC, and have learned some Python, but I am still more of
>>> a newbie than not.
>>>
>>> Here's my question. Are there behavior driven development tools for
>>> Web2Py? Like Cucumber for Rails. I had not known about this approach before,
>>> and learned a lot from the link below:
>>> https://www.youtube.com/watch?v=bAu9j0nHOYw&feature=player_embedded
>>>
>>> Actually, I think Cucumber could be used with Web2Py — I don't think it
>>> is Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly
>>> tool.
>>>
>>> Thanks for any ideas or pointers,
>>>
>>>  Clarke
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Alan Etkin


Note: If you are restoring data with the DAL method import_from_csv_file 
(not the Table class method) using id_map={}, which is the method that 
should be used to keep references in sync, you should not have issues 
keeping reference values. I have tested it with a trivial db (a few records 
and a list:reference table field) and it worked. AFAIK, appadmin does not 
provide an interface to make dumps of or loading the entire database, but 
it is really simple to use them in a web2py shell.


BTW: I have noticed that there is a problem on database the dump method 
(DAL's export_to_csv_file) and filed this issue. 

http://code.google.com/p/web2py/issues/detail?id=1605

With that change, you should be able to move data across databases without 
problems (yet not preserving id values).

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Wednesday 24 July 2013 11:52:36 Alan Etkin wrote:


> Also I concluded that because all the references are replaced by mongodb id's 
> it is not possible to say > dump a table with references in one database and 
> then restore it on mongodb.

Neither you can (or should) with other adapters, for example, postgres. Here's 
section of the book about that issue:



"... In order to make a record uniquely identifiable across databases, they 
must:
 *  have a unique id (UUID),
 *  have an event_time (to figure out which one is more recent if multiple 
copies),
 *  reference the UUID instead of the id.
..."


Agreed, but because mongodb is a nosql you could push this away to the 
developer. (What I am not abviously)


> ... Because you have no relation between the records anymore.

There's a possible bug with the import feature or the mongodb adapter. Maybe 
you can file an issue in the project page adding as many info as possible to 
reproduce the problem. While changing the id numbers, the id references should 
be preserved between records.


I am going to see if I can create a testcase to reproduce the error, maybe its 
because of the order of the data in db.py


> 
#I am curious about the reason, would het not be smarter to just keep the 
original id's ? Afterall mongodb uses _id. So it does not bite. 


I did so forget about that :-) Thanks for reminding me. 


And thanks for taking the time to answer me. Its very much appreciated.

--  --- You received this message because you are subscribed to the Google 
Groups "web2py-users" group.To unsubscribe from this group and stop receiving 
emails from it, send an email to web2py+unsubscr...@googlegroups.com.for more 
options, visit https://groups.google.com/groups/opt_out[1].  






[1] https://groups.google.com/groups/opt_out

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: sqlform.factory multiple requires problem

2013-07-24 Thread André Kablu
If you use IS_IN_DB it will automatically check if is not empty.

The function IS_IN_DB, if used inside list brackets [IS_IN_DB(...,...)] 
will not show the dropdown. This is the correct behavior.



Em quarta-feira, 24 de julho de 2013 20h19min18s UTC-3, Antonis 
Konstantinos Tzorvas escreveu:
>
> form = SQLFORM.factory(Field('station', requires=IS_IN_DB(db, '
> station.name'), default=request.args(0)),
>Field('start', requires=[IS_NOT_EMPTY(), 
> IS_IN_DB(db, 'data.year')], default=start),
>Field('end', requires=IS_NOT_EMPTY(), 
> default=end))
>
> if i set Field('start', requires=IS_IN_DB(db, 'data.year') then it shows a 
> dropdown list, but if i do it as above listed, then i can't get the 
> dropdown list (still it looks for both validations)
>
> is this a bug or am i doing something wrong?
> thanks
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] sqlform.factory multiple requires problem

2013-07-24 Thread Antonis Konstantinos Tzorvas
form = SQLFORM.factory(Field('station', requires=IS_IN_DB(db, 
'station.name'), default=request.args(0)),
   Field('start', requires=[IS_NOT_EMPTY(), 
IS_IN_DB(db, 'data.year')], default=start),
   Field('end', requires=IS_NOT_EMPTY(), 
default=end))

if i set Field('start', requires=IS_IN_DB(db, 'data.year') then it shows a 
dropdown list, but if i do it as above listed, then i can't get the 
dropdown list (still it looks for both validations)

is this a bug or am i doing something wrong?
thanks

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Minify (compress) response HTML

2013-07-24 Thread Elcimar
Hmm... Go to listacaiu.com and view source code of the main page..

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Joe Barnhart
Well it's entirely possible I don't understand my problem.

Running on my macbook locally everything works like a charm.  On the "play" 
deployment server, which uses Apache, the script that deletes files after 
processing fails because it lacks "permission" (according to the web2py 
error log).  Also, when uploading the files Apache goes to 100% cpu and 
stays there, consuming RAM until I get tired of watching.  Admittedly, they 
are very large files (~200MB) but I don't see why Apache should consume >2G 
of RAM while spinning in some kind of loop.

Everything is set up as in the book and messages here -- I used Debian 
Linux for the play server and used www-data for the user and group, and put 
web2py under /home/www-user/.  The website works fine in all other ways, 
but just has issues uploading/downloading files from my web page file 
loader.

I must say this web deployment step is much harder than using web2py to 
create the site!

-- Joe B.

On Wednesday, July 24, 2013 2:58:07 PM UTC-7, Niphlod wrote:
>
> there are no special permissions because apache can't serve the uploads 
> directory by itself. Remember that "uploads" is not the same as "static". 
> The uploads are interely managed by web2py.
>
> On Wednesday, July 24, 2013 11:51:05 AM UTC+2, Joe Barnhart wrote:
>>
>> So a central part of my website is a repository of files/objects that are 
>> added and removed.  I've chosen to use the "uploads" folder in my 
>> application directory, with additional feature of scattering the files into 
>> subdirectories (because I expect a LOT of them).
>>
>> I'm trying the stock apache2 setup from the book but I find it has no 
>> provision for permissions on the uipload directory.  I copied the setup for 
>> the "static" directory and was able to put files in the directory, but I 
>> can't delete files from the directory within my site.
>>
>> Has anyone worked out the changes needed to the stock Apache2 setup that 
>> accommodates the upload directory?  Seems like it would be a nice 
>> addition/update to the book setup.
>>
>> Joe B.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Ovidio Marinho
No www.web2py.com  olny web2py.com

ok




 Ovidio Marinho Falcao Neto
  ITJP.NET.BR
 ovidio...@gmail.com
   83   8826 9088 - Oi
   83   9336 3782 - Claro
Brasil



2013/7/24 Rob Paire 

> When I browse to www.web2py.com in chrome I get a page which says:
> 502 bad gateway, I tried this from two different connections.
> PythonAnywhere.com seems to resolve correctly.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py resources

2013-07-24 Thread Niphlod
another resource: web2py's roadmap : 
https://trello.com/b/d3aqBbBl/web2py-roadmap

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Multi column constraint

2013-07-24 Thread villas
Did you try the 'requires' separately,  eg

db.define_table('ts_mileage_rate',
Field('customer_id', 'reference ts_customer', 
required=True, notnull=True),
Field('mileage_rate_year', 'integer', required=True, 
notnull=True))

db.ts_mileage_rate.mileage_rate_year.requires=IS_NOT_IN_DB(db(db.ts_mileage_rate.customer_id
 
== request.vars.customer_id),
  'ts_mileage_rate.mileage_rate_year')

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Niphlod
there are no special permissions because apache can't serve the uploads 
directory by itself. Remember that "uploads" is not the same as "static". 
The uploads are interely managed by web2py.

On Wednesday, July 24, 2013 11:51:05 AM UTC+2, Joe Barnhart wrote:
>
> So a central part of my website is a repository of files/objects that are 
> added and removed.  I've chosen to use the "uploads" folder in my 
> application directory, with additional feature of scattering the files into 
> subdirectories (because I expect a LOT of them).
>
> I'm trying the stock apache2 setup from the book but I find it has no 
> provision for permissions on the uipload directory.  I copied the setup for 
> the "static" directory and was able to put files in the directory, but I 
> can't delete files from the directory within my site.
>
> Has anyone worked out the changes needed to the stock Apache2 setup that 
> accommodates the upload directory?  Seems like it would be a nice 
> addition/update to the book setup.
>
> Joe B.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Err 24: too many files open

2013-07-24 Thread Niphlod
it's a problem on the layers "at the base" of web2py, such as the os, nginx 
or uwsgi.
http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/
let's see if @roberto (the developer behind uwsgi) passes by with some 
useful tips too. 

On Wednesday, July 24, 2013 4:30:51 PM UTC+2, dederocks wrote:
>
> I'm running web2py on nginx /uwsgi.
> And in a sequence implying frequent serveur calls, I eventually get an 
> error 500 from the server, which is actualy an error 24: too many files 
> open (see ticket in attachement).
>
> I checked former reports on this error, but none seems to match this case: 
> I'm not using rocket, and running the latest web2py stable version.
> I checked also on opening files myself, but that is never the case (e.g. 
> always done by web2py).
> I tried to increase the file opened limit (ulimit -SHn 4048), but to no 
> improvement.
>
> Any suggestion?
>
> Thanks in advance, Andre
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Multi column constraint

2013-07-24 Thread Anthony
Answered on SO: http://stackoverflow.com/a/17845372/440323


On Wednesday, July 24, 2013 5:03:19 PM UTC-4, msa...@gmail.com wrote:
>
> I am trying to use the method posted by 
> http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py
>
> db.define_table('ts_customer',
> Field('customer_name', 'string', length=80, required=True, 
> unique=True))
>
> db.define_table('ts_mileage_rate',
> Field('customer_id', 'reference ts_customer', 
> required=True, notnull=True),
> Field('mileage_rate_year', 'integer', required=True, 
> notnull=True,
>   requires=IS_NOT_IN_DB(
>   db(db.ts_mileage_rate.customer_id == 
> request.vars.customer_id),
>   'ts_mileage_rate.mileage_rate_year')
> ))
>
> I get the following error:
>
> type 'exceptions.AttributeError'> 'DAL' object has no attribute 
> 'ts_mileage_rate'
>
> Any idea why? 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Niphlod
https://github.com/niphlod/welcome_augmented

PS: integrating tests for apps (both with py.test or behave) is on the 
todo-list.

On Wednesday, July 24, 2013 10:17:56 PM UTC+2, Richard wrote:
>
> If you feel you can hack the Vinicius web2py pytest app to embed a python 
> BDD tool feel free to clone the repo and publish your improvement here!!
>
> :)
>
> Richard
>
>
> On Wed, Jul 24, 2013 at 3:41 PM, Clarke Bishop 
> 
> > wrote:
>
>> Thanks Richard, this is very helpful!
>>
>> Lettuce let me to Behave. http://pythonhosted.org/behave/index.html
>>
>> And, they have a comparison with Lettuce and Freshen, 
>> http://pythonhosted.org/behave/comparison.html.
>>
>> I guess I should have thought to do a search for Behavior Driven 
>> Development in Python instead of in Web2Py.
>>
>> I'll keep playing with this and report back what I learn.
>>
>>  Clarke
>>
>>
>> On Wednesday, July 24, 2013 1:59:40 PM UTC-4, Clarke Bishop wrote:
>>>
>>> I've been doing the online course, CS169x, from Coursera. The course 
>>> uses Ruby/Rails, but I like Python better. They picked Rails because they 
>>> said it was the best for programmer productivity. Maybe once you get way 
>>> down the learning curve, they are right. However, I find all the Rails 
>>> "magic" to be confusing and hard to debug.
>>>
>>> So, I started looking for Rails for Python, and it seems Web2Py is the 
>>> answer!
>>>
>>> I do understand MVC, and have learned some Python, but I am still more 
>>> of a newbie than not.
>>>
>>> Here's my question. Are there behavior driven development tools for 
>>> Web2Py? Like Cucumber for Rails. I had not known about this approach 
>>> before, and learned a lot from the link below:
>>> https://www.youtube.com/watch?**v=bAu9j0nHOYw&feature=player_**embedded
>>>
>>> Actually, I think Cucumber could be used with Web2Py — I don't think it 
>>> is Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly 
>>> tool.
>>>
>>> Thanks for any ideas or pointers,
>>>
>>>  Clarke
>>>
>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Rob Paire
When I browse to www.web2py.com in chrome I get a page which says:
502 bad gateway, I tried this from two different connections. 
PythonAnywhere.com seems to resolve correctly.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Multi column constraint

2013-07-24 Thread Richard Vézina
Your code seem ok, maybe traceback could help... Or you can look at the
line poited by the traceback... Maybe you forgot "db." somewhere in front
of ts_mileage_rate

Can't say from you code, because it seems ok there. I thought it was caused
by the IS_NOT_IN_DB at first but I don't think so.

Good luck.

Richard


On Wed, Jul 24, 2013 at 5:03 PM,  wrote:

> I am trying to use the method posted by
> http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py
>
> db.define_table('ts_customer',
> Field('customer_name', 'string', length=80, required=True,
> unique=True))
>
> db.define_table('ts_mileage_rate',
> Field('customer_id', 'reference ts_customer',
> required=True, notnull=True),
> Field('mileage_rate_year', 'integer', required=True,
> notnull=True,
>   requires=IS_NOT_IN_DB(
>   db(db.ts_mileage_rate.customer_id ==
> request.vars.customer_id),
>   'ts_mileage_rate.mileage_rate_year')
> ))
>
> I get the following error:
>
> type 'exceptions.AttributeError'> 'DAL' object has no attribute
> 'ts_mileage_rate'
>
> Any idea why?
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Multi column constraint

2013-07-24 Thread msaronw
I am trying to use the method posted by 
http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py

db.define_table('ts_customer',
Field('customer_name', 'string', length=80, required=True, 
unique=True))

db.define_table('ts_mileage_rate',
Field('customer_id', 'reference ts_customer', 
required=True, notnull=True),
Field('mileage_rate_year', 'integer', required=True, 
notnull=True,
  requires=IS_NOT_IN_DB(
  db(db.ts_mileage_rate.customer_id == 
request.vars.customer_id),
  'ts_mileage_rate.mileage_rate_year')
))

I get the following error:

type 'exceptions.AttributeError'> 'DAL' object has no attribute 
'ts_mileage_rate'

Any idea why? 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to use the templating engine as a module

2013-07-24 Thread Massimo Di Pierro
from gluon.template import render
print render("hello {{=data}}",context=dict(data="world"))
help(render) # for more info

Notice that gluon/template.py is a single file with no dependencies.


On Wednesday, 24 July 2013 15:45:34 UTC+2, Eduardo Cruz wrote:
>
> Hello,  I want to use the templating engine as a module so I can use it 
> with weasyprint as a barebones reporting engine, with mako I can do:
>
> from mako.template import Template
> print Template("hello ${data}!").render(data="world")
>
>
> How could I do that in the web2py templating engine?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py][share] ressources

2013-07-24 Thread Paolo Valleri


On Wednesday, July 24, 2013 4:47:37 PM UTC+2, Richard wrote:
>
> Hello,
>
> I recently discover these two lib :
>
> http://johnny.github.io/jquery-sortable/ (avoid jquery ui just to get 
> drag and drop capability)
>

thanks for sharing, I would try to use that with bootstrap tabs.
 

>
> http://fgnass.github.io/spin.js/ (a spinner lib)
>
> :)
>
> Richard
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Google Analytics - 'analytics is not defined' error

2013-07-24 Thread Paolo Valleri
You found an issue, in the welcome app the analytics library is shiped as 
minified, given that the correct file name is 
analytics.min.jsinstead
 of 
analytics.js
btw, it is a bit out of date.

Paolo

On Wednesday, July 24, 2013 4:12:34 PM UTC+2, st...@hurlingstats.com wrote:
>
> Wondering if anyone has seen this.
>
> I've set my tracking id in menu.py
>
> response.google_analytics_id = 'UA--X'
>
> When I load my site, I get js errors:
>
> SyntaxError: syntax error
> http://127.0.0.1:8000/mysite/static/js/analytics.js
> Line 4
>
> ReferenceError: analytics is not defined
> http://127.0.0.1:8000/mysite/controller/default
> Line 2682
>
> This is what I have in layout.html
>
>   {{if response.google_analytics_id:}}
>   
>   
>   analytics.initialize({
> 'Google Analytics':{trackingId:'{{=response.google_analytics_id}}'} 
>   });
>   {{pass}}
>
> Using web2py v2.5.1-stable+timestamp.2013.06.06.10.23.23
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Richard Vézina
If you feel you can hack the Vinicius web2py pytest app to embed a python
BDD tool feel free to clone the repo and publish your improvement here!!

:)

Richard


On Wed, Jul 24, 2013 at 3:41 PM, Clarke Bishop wrote:

> Thanks Richard, this is very helpful!
>
> Lettuce let me to Behave. http://pythonhosted.org/behave/index.html
>
> And, they have a comparison with Lettuce and Freshen,
> http://pythonhosted.org/behave/comparison.html.
>
> I guess I should have thought to do a search for Behavior Driven
> Development in Python instead of in Web2Py.
>
> I'll keep playing with this and report back what I learn.
>
>  Clarke
>
>
> On Wednesday, July 24, 2013 1:59:40 PM UTC-4, Clarke Bishop wrote:
>>
>> I've been doing the online course, CS169x, from Coursera. The course uses
>> Ruby/Rails, but I like Python better. They picked Rails because they said
>> it was the best for programmer productivity. Maybe once you get way down
>> the learning curve, they are right. However, I find all the Rails "magic"
>> to be confusing and hard to debug.
>>
>> So, I started looking for Rails for Python, and it seems Web2Py is the
>> answer!
>>
>> I do understand MVC, and have learned some Python, but I am still more of
>> a newbie than not.
>>
>> Here's my question. Are there behavior driven development tools for
>> Web2Py? Like Cucumber for Rails. I had not known about this approach
>> before, and learned a lot from the link below:
>> https://www.youtube.com/watch?**v=bAu9j0nHOYw&feature=player_**embedded
>>
>> Actually, I think Cucumber could be used with Web2Py — I don't think it
>> is Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly
>> tool.
>>
>> Thanks for any ideas or pointers,
>>
>>  Clarke
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Web2Py + TurnkeyLinux and Apache

2013-07-24 Thread james c.
I easily deployed my Web2Py app "with just a few clicks" through the 
TurnKeyLinux Hub onto Amazon EC2. The Web2Py Admin console shows that the 
app is running with Apache. However, it seems to still be running on Rocket 
from an error message related to SSL. Any SSL connection attempt is 
ignored. The Web2Py deployment recipes provide a length list of commands to 
deploy Apache, but I expect that the TKL Web2Py appliance has already taken 
care of that. Is there a web2py configuration parameter that "points" to 
Rocket Server or Apache?

thanks in advance for any advice, James  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Web2py sem Segredos

2013-07-24 Thread MrEdusi
Legal.. vou assitir!

Em terça-feira, 23 de julho de 2013 19h31min29s UTC-3, Ovidio Marinho 
escreveu:
>
> As 20:00hs hoje não percam 
>
> https://plus.google.com/events/cocblop80ibv4ou44po12j87i2k
>   
>
>
>  Ovidio Marinho Falcao Neto
>   ITJP.NET.BR
>  ovid...@gmail.com  
>83   8826 9088 - Oi
>83   9336 3782 - Claro
> Brasil
>   
>  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Clarke Bishop
Thanks Richard, this is very helpful!

Lettuce let me to Behave. http://pythonhosted.org/behave/index.html

And, they have a comparison with Lettuce and 
Freshen, http://pythonhosted.org/behave/comparison.html.

I guess I should have thought to do a search for Behavior Driven 
Development in Python instead of in Web2Py.

I'll keep playing with this and report back what I learn.

 Clarke

On Wednesday, July 24, 2013 1:59:40 PM UTC-4, Clarke Bishop wrote:
>
> I've been doing the online course, CS169x, from Coursera. The course uses 
> Ruby/Rails, but I like Python better. They picked Rails because they said 
> it was the best for programmer productivity. Maybe once you get way down 
> the learning curve, they are right. However, I find all the Rails "magic" 
> to be confusing and hard to debug.
>
> So, I started looking for Rails for Python, and it seems Web2Py is the 
> answer!
>
> I do understand MVC, and have learned some Python, but I am still more of 
> a newbie than not.
>
> Here's my question. Are there behavior driven development tools for 
> Web2Py? Like Cucumber for Rails. I had not known about this approach 
> before, and learned a lot from the link below:
> https://www.youtube.com/watch?v=bAu9j0nHOYw&feature=player_embedded
>
> Actually, I think Cucumber could be used with Web2Py — I don't think it is 
> Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly 
> tool.
>
> Thanks for any ideas or pointers,
>
>  Clarke
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Why is a uuid string in an upload file name?

2013-07-24 Thread Derek
usually so people can have multiple versions of the same file, or so that 
people with the same name of file don't overwrite each other.

On Wednesday, July 24, 2013 8:06:56 AM UTC-7, Cliff Kachinske wrote:
>
> Storing uploads in the database.
>
> The structure of an encoded name for an uploaded file seems to be this:
>
> 
>
> What is the reason for the uuid string?
>
> Thanks,
> Cliff Kachinske
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Behavior Driven Development in Web2Py

2013-07-24 Thread Richard Vézina
Hello Clarke,

There is lettuce :

http://net.tutsplus.com/tutorials/python-tutorials/behavior-driven-development-in-python/

Recently Vinicius make an aptempt to make it easier to Unit Test with
pytest and web2py :
https://groups.google.com/d/msg/web2py/CHfZTr5xHso/lZlGW5tPk6EJ

More of unittest, but I think that people here if they write test do
unittest, don't remember having read something about BDD on this list...

Cheer.


Richard




On Wed, Jul 24, 2013 at 1:59 PM, Clarke Bishop wrote:

> I've been doing the online course, CS169x, from Coursera. The course uses
> Ruby/Rails, but I like Python better. They picked Rails because they said
> it was the best for programmer productivity. Maybe once you get way down
> the learning curve, they are right. However, I find all the Rails "magic"
> to be confusing and hard to debug.
>
> So, I started looking for Rails for Python, and it seems Web2Py is the
> answer!
>
> I do understand MVC, and have learned some Python, but I am still more of
> a newbie than not.
>
> Here's my question. Are there behavior driven development tools for
> Web2Py? Like Cucumber for Rails. I had not known about this approach
> before, and learned a lot from the link below:
> https://www.youtube.com/watch?v=bAu9j0nHOYw&feature=player_embedded
>
> Actually, I think Cucumber could be used with Web2Py — I don't think it is
> Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly
> tool.
>
> Thanks for any ideas or pointers,
>
>  Clarke
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Alan Etkin
> Also I concluded that because all the references are replaced by mongodb 
id's it is not possible to say 
> dump a table with references in one database and then restore it on 
mongodb.

Neither you can (or should) with other adapters, for example, postgres. 
Here's section of the book about that issue:

"... In order to make a record uniquely identifiable across databases, they 
must:

   - have a unique id (UUID),
   - have an event_time (to figure out which one is more recent if multiple 
   copies),
   - reference the UUID instead of the id.

..."
> ... Because you have no relation between the records anymore.

There's a possible bug with the import feature or the mongodb adapter. 
Maybe you can file an issue in the project page adding as many info as 
possible to reproduce the problem. While changing the id numbers, the id 
references should be preserved between records.

I am curious about the reason, would het not be smarter to just keep the 
> original id's ? Afterall mongodb uses _id. So it does not bite. 
>

I don't think it is a good idea because that way, DAL would have to deal 
with two auto-generated record identifiers (adding redundant and confusing 
id fields) for any database operation.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Google Analytics - 'analytics is not defined' error

2013-07-24 Thread stats
Wondering if anyone has seen this.

I've set my tracking id in menu.py

response.google_analytics_id = 'UA--X'

When I load my site, I get js errors:

SyntaxError: syntax error
http://127.0.0.1:8000/mysite/static/js/analytics.js
Line 4

ReferenceError: analytics is not defined
http://127.0.0.1:8000/mysite/controller/default
Line 2682

This is what I have in layout.html

  {{if response.google_analytics_id:}}
  
  
  analytics.initialize({
'Google Analytics':{trackingId:'{{=response.google_analytics_id}}'} 
  });
  {{pass}}

Using web2py v2.5.1-stable+timestamp.2013.06.06.10.23.23

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Behavior Driven Development in Web2Py

2013-07-24 Thread Clarke Bishop
I've been doing the online course, CS169x, from Coursera. The course uses 
Ruby/Rails, but I like Python better. They picked Rails because they said 
it was the best for programmer productivity. Maybe once you get way down 
the learning curve, they are right. However, I find all the Rails "magic" 
to be confusing and hard to debug.

So, I started looking for Rails for Python, and it seems Web2Py is the 
answer!

I do understand MVC, and have learned some Python, but I am still more of a 
newbie than not.

Here's my question. Are there behavior driven development tools for Web2Py? 
Like Cucumber for Rails. I had not known about this approach before, and 
learned a lot from the link below:
https://www.youtube.com/watch?v=bAu9j0nHOYw&feature=player_embedded

Actually, I think Cucumber could be used with Web2Py — I don't think it is 
Rails-specific. Still, I'm wondering if there is a more Web2Py-friendly 
tool.

Thanks for any ideas or pointers,

 Clarke

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: discovered something cool in web2py DAL

2013-07-24 Thread Derek
I believe that example of counting contains is in the book, so to anyone 
who didn't read the book this is new, however, the example was kind of 
confusing. I remember reading about it on the newsgroup that someone 
couldn't understand what was going on. You give a good example of how to 
rewrite that part of the book.

On Wednesday, July 24, 2013 9:54:18 AM UTC-7, VP wrote:
>
> Maybe this was obvious, but I never thought I could do this kind of 
> queries in DAL.  
>
> Okay, let's say I have 2 tables:
>
> Tags = db.define_table('tag', Field('name'))
> Post = db.define_table('post', Field('title'), Field('tag', 'reference 
> tag'))
>
>
> Now, doing a join is easy using the query *(db.post.tag == db.tag.id)*
>
> But if I have the following 2 tables, where a post might have many tags:
>
> Tags = db.define_table('tag', Field('name'))
> Post = db.define_table('post', Field('title'), Field('tag', 
> 'list:reference tag'))
>
> How do I select tags that occur in posts?  It turns out that this can be 
> done very nice using the query:  *db.post.tag.contains( db.tag.id )*
> *
> *
> I have used "contains", but I had thought that the argument for it must be 
> a constant (e.g. a specific tag such as "news"), not something like 
> db.tag.id.
>
> Nice.
>
> Counting tags occurrence (e.g. if you want to have a tag cloud) turns out 
> to be quite simple:   *db( db.post.tag.contains(db.tag.id) 
> ).select(db.tag.ALL, db.tag.id.count(), groupby=db.tag.name)*
>
> Nice!!
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] discovered something cool in web2py DAL

2013-07-24 Thread VP
Maybe this was obvious, but I never thought I could do this kind of queries 
in DAL.  

Okay, let's say I have 2 tables:

Tags = db.define_table('tag', Field('name'))
Post = db.define_table('post', Field('title'), Field('tag', 'reference 
tag'))


Now, doing a join is easy using the query *(db.post.tag == db.tag.id)*

But if I have the following 2 tables, where a post might have many tags:

Tags = db.define_table('tag', Field('name'))
Post = db.define_table('post', Field('title'), Field('tag', 'list:reference 
tag'))

How do I select tags that occur in posts?  It turns out that this can be 
done very nice using the query:  *db.post.tag.contains( db.tag.id )*
*
*
I have used "contains", but I had thought that the argument for it must be 
a constant (e.g. a specific tag such as "news"), not something like 
db.tag.id.

Nice.

Counting tags occurrence (e.g. if you want to have a tag cloud) turns out 
to be quite simple:   *db( db.post.tag.contains(db.tag.id) 
).select(db.tag.ALL, db.tag.id.count(), groupby=db.tag.name)*

Nice!!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: This javascript worked in older version of web2py - not in trunk version.

2013-07-24 Thread Richard Vézina
Johann don't forget to update the other files too...

https://groups.google.com/d/msg/web2py/tVyL7z7WHkw/mce13Vh-k3UJ

Richard

On Wed, Jul 24, 2013 at 4:46 AM, Johann Spies wrote:

>
>
> On Wednesday, 24 July 2013 09:54:28 UTC+2, Johann Spies wrote:
>>
>>
>> I have not been able to determine the exact course of the problem.
>>
>>
> It seems that static/js/jquery.js is the problem.  Replacing the file in
> the working app with the one from the Welcome app, breaks things.
>
> Regards
> Johann
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Richard Vézina
Ok, Thank you for clarification!

Richard


On Wed, Jul 24, 2013 at 11:55 AM, Anthony  wrote:

> On Wednesday, July 24, 2013 10:34:22 AM UTC-4, Richard wrote:
>
>> Anthony, what the advantage of that over @auth.requires_login() ??
>>
>
> @auth.requires_login() has to be applied separately to each function you
> want to protect. David asked about protecting an entire controller. To
> avoid having to repeat the same decorator on every function in the
> controller (possibly forgetting when you add a new function), you can
> instead protect the entire controller with a single line at the top.
>
> You can also do it in a model file to protect the entire application, but
> in that case you should add some logic to exclude /default/user from the
> check -- otherwise, users won't be able to get to the login page.
>
> Anthony
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Anthony
On Wednesday, July 24, 2013 10:34:22 AM UTC-4, Richard wrote:

> Anthony, what the advantage of that over @auth.requires_login() ??
>

@auth.requires_login() has to be applied separately to each function you 
want to protect. David asked about protecting an entire controller. To 
avoid having to repeat the same decorator on every function in the 
controller (possibly forgetting when you add a new function), you can 
instead protect the entire controller with a single line at the top.

You can also do it in a model file to protect the entire application, but 
in that case you should add some logic to exclude /default/user from the 
check -- otherwise, users won't be able to get to the login page.

Anthony

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Link to default value for db table field

2013-07-24 Thread shapovalovdenis
Hi!

Let's say I've following table defined:
db.define_table('page',
   Field('is_index', 'boolean'),
   Field('title', 'text', default=''),
   Field('block_content', 'text', default=''),
   Field('block_ad', 'text', default=''),
   Field('block_footer', 'text', default=''),
   format='%(title)s'
}

I've inserted several pages (rows) in it.

What would be the best way for block_footer to have the same value as in 
'index' rows, i.e. like the footer on many (if not all) pages of a web site 
stays the same.

Basically I'm looking for a way to reference index row's footer value in 
other page's block_footer filed leaving a possibility for customization in 
case some page would require a different footer. 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Why is a uuid string in an upload file name?

2013-07-24 Thread Cliff Kachinske
Storing uploads in the database.

The structure of an encoded name for an uploaded file seems to be this:



What is the reason for the uuid string?

Thanks,
Cliff Kachinske

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] offtopic : beautiful code

2013-07-24 Thread António Ramos
Also this book just came out.

Seems very good

http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP002658.html


2013/7/23 Ykä Marjanen 

> I've watched this at least 10 times. Definately would recommend all web2py
> developers to watch and learn from this.
>
> Ykä
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py][share] ressources

2013-07-24 Thread Richard
Hello,

I recently discover these two lib :

http://johnny.github.io/jquery-sortable/ (avoid jquery ui just to get drag 
and drop capability)

http://fgnass.github.io/spin.js/ (a spinner lib)

:)

Richard

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Richard Vézina
Anthony, what the advantage of that over @auth.requires_login() ??

Thanks

Richard


On Wed, Jul 24, 2013 at 9:36 AM, Anthony  wrote:

> On Wednesday, July 24, 2013 7:56:48 AM UTC-4, Marin Pranjić wrote:
>
>> put the logic on top of controller file:
>>
>> if not auth.is_logged_in():
>> redirect( ... )
>>
>
> Or if you want to get the automatic redirect and messaging behavior of the
> @auth.requires_login() decorator, you can use this trick:
>
> # At the top of the controller
> auth.requires_login()(lambda: None)()
>
> auth.requires_login() returns a decorator that takes a function and
> returns another function -- above just passes a dummy lambda function to
> the decorator and then calls the resulting function to run the
> requires_login code. Works with the other Auth decorators as well (all of
> which ultimately call auth.requires(), which is the method that produces
> the decorator).
>
> Anthony
>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] auth_event logging

2013-07-24 Thread Marin Pranjić
I am using trunk. When I register, login or update profile, auth_event 
records are not created.
Sorry I don't have time to look more into it. 

Marin

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to use the templating engine as a module

2013-07-24 Thread Eduardo Cruz
Hello,  I want to use the templating engine as a module so I can use it 
with weasyprint as a barebones reporting engine, with mako I can do:

from mako.template import Template
print Template("hello ${data}!").render(data="world")


How could I do that in the web2py templating engine?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Anthony
On Wednesday, July 24, 2013 7:56:48 AM UTC-4, Marin Pranjić wrote:

> put the logic on top of controller file:
>
> if not auth.is_logged_in():
> redirect( ... )
>

Or if you want to get the automatic redirect and messaging behavior of the 
@auth.requires_login() decorator, you can use this trick:

# At the top of the controller
auth.requires_login()(lambda: None)()

auth.requires_login() returns a decorator that takes a function and returns 
another function -- above just passes a dummy lambda function to the 
decorator and then calls the resulting function to run the requires_login 
code. Works with the other Auth decorators as well (all of which ultimately 
call auth.requires(), which is the method that produces the decorator).

Anthony

>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Inconsisten crud form processing

2013-07-24 Thread w2p user
I'm trying to use the custom CRUD form processing but am getting a strange 
result. For a simple two field form, the default form of the crud behaves 
as expected. The custom form doesn't process. Why are they different?


Thank you for any help.


{{=crud_form}}

{{=crud_form.custom.begin}}

 shift x:{{=crud_form.custom.widget.shift_x}}
 shift y:{{=crud_form.custom.widget.shift_y}} 
 {{=crud_form.custom.submit}}

{{=crud_form.custom.end}}


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] What is the import order for model files when using subfolders based on controller names ?

2013-07-24 Thread Vinicius Assef
alphabetical.

On Wed, Jul 24, 2013 at 3:59 AM, David Marko  wrote:
> I'm using model subfolders for specific controllers based on docs here "By
> default, this is set automatically to load /a/models/*.py, /a/models/c/*.py,
> and /a/models/c/f/*.py files when /a/c/f is requested." What is the import
> order for this?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread dhmorgan
usually this setup makes "www-data" the owner of /var/www/ and everything 
beneath it, so you'll have to (a) do file operations as 
root/sudo/administrator, (b) add yourself to www-data group and give write 
permission to group, or (c) temporarily give yourself ownership and then 
change it back

in order to have uploaded files deleted when removed from the database, set 
"autodelete=True" in table definition "Field('image', 'upload', 
autodelete=True)"



On Wednesday, July 24, 2013 4:51:05 AM UTC-5, Joe Barnhart wrote:
>
> So a central part of my website is a repository of files/objects that are 
> added and removed.  I've chosen to use the "uploads" folder in my 
> application directory, with additional feature of scattering the files into 
> subdirectories (because I expect a LOT of them).
>
> I'm trying the stock apache2 setup from the book but I find it has no 
> provision for permissions on the uipload directory.  I copied the setup for 
> the "static" directory and was able to put files in the directory, but I 
> can't delete files from the directory within my site.
>
> Has anyone worked out the changes needed to the stock Apache2 setup that 
> accommodates the upload directory?  Seems like it would be a nice 
> addition/update to the book setup.
>
> Joe B.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Marin Pranjić
put the logic on top of controller file:

if not auth.is_logged_in():
redirect( ... )


On Wed, Jul 24, 2013 at 1:38 PM, David Marko  wrote:

> How can I protect the entire controller to be available only for logged in
> users? Something like @auth.requires_login() but for the entire controller
> instead of each method ?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread David Marko
How can I protect the entire controller to be available only for logged in 
users? Something like @auth.requires_login() but for the entire controller 
instead of each method ?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] online web2py book inaccessible

2013-07-24 Thread David S
Everything seems to work. Thanks!

On Wednesday, July 24, 2013 4:28:38 AM UTC-4, Massimo Di Pierro wrote:
>
> I was doing an upgrade. Can you confirm everything is ok now?
>
> On Tuesday, 23 July 2013 12:15:42 UTC-5, Jonathan Lundell wrote:
>>
>> On 23 Jul 2013, at 9:59 AM, David S  wrote:
>>
>> It seems the online web2py book (http://web2py.com/book) isn't working 
>> for me and is giving an unknown error.
>>
>> Is anyone seeing this issue?
>>
>>
>> Yeah, it's broken.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Need Apache help for "uploads" directory

2013-07-24 Thread Joe Barnhart
So a central part of my website is a repository of files/objects that are 
added and removed.  I've chosen to use the "uploads" folder in my 
application directory, with additional feature of scattering the files into 
subdirectories (because I expect a LOT of them).

I'm trying the stock apache2 setup from the book but I find it has no 
provision for permissions on the uipload directory.  I copied the setup for 
the "static" directory and was able to put files in the directory, but I 
can't delete files from the directory within my site.

Has anyone worked out the changes needed to the stock Apache2 setup that 
accommodates the upload directory?  Seems like it would be a nice 
addition/update to the book setup.

Joe B.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] strange decimal form field comparison result

2013-07-24 Thread 黄祥
hi folks,

i have a decimal form field that validate during submit (running on web2py 
2.5.1):

e.g. on controller
def product():
grid=SQLFORM.grid(db.product, onvalidation=__onvalidation_product)
return locals()

def __onvalidation_product(form):
*if form.vars.price_list >= form.vars.selling_price:*
form.errors.selling_price = 'Selling Price must Greater than Price 
List'

when i insert price_list = 3 and selling_price = 3 the notification appears 
in the form field  prevent the data to be inserted. i think, it should be : 
when i insert price_list = 3 and selling_price = 3 the notification not 
appears and the data can be inserted

but
def __onvalidation_product(form):
*if form.vars.price_list > form.vars.selling_price:*
form.errors.selling_price = 'Selling Price must Greater than Price 
List'

when i insert price_list = 3 and selling_price = 3 the notification not 
appears and the data can be insert. i think, it should be : when i insert 
price_list = 3 and selling_price = 3 the notification appears to prevent 
the data to be inserted

is there any mistake in my logic or code above?

thanks and best regards

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: This javascript worked in older version of web2py - not in trunk version.

2013-07-24 Thread Johann Spies


On Wednesday, 24 July 2013 09:54:28 UTC+2, Johann Spies wrote:
>
>
> I have not been able to determine the exact course of the problem.
>
>
It seems that static/js/jquery.js is the problem.  Replacing the file in 
the working app with the one from the Welcome app, breaks things.

Regards
Johann 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Failing to execute python script from the Windows CMD

2013-07-24 Thread Massimo Di Pierro
If you use the binary distribution you do not need "python" and you should 
call web2py with:

> web2py.exe -S myApp - M -R applications/myApp/scripts/myAppScript.py

but since you have python installed, you should follow Anthony's advice and 
run web2py form source. 

On Tuesday, 23 July 2013 16:58:46 UTC-5, Zeke Schmois wrote:
>
> I'm sure I'm missing something very fundamental here but whenever I try to 
> run my script on the windows command line I get 
>
> >python web2py.exe -S myApp - M -R 
> applications/myApp/scripts/myAppScript.py
>   File "web2py.exe", line 1
> SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but 
> no enc
> oding declared; see http://www.python.org/peps/pep-0263.html for details
>
> If I use web2py.py it breaks because there's no such file in my web2py 
> folder.
>
> I'm out of ideas as how to execute it, any pointers?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] online web2py book inaccessible

2013-07-24 Thread Massimo Di Pierro
I was doing an upgrade. Can you confirm everything is ok now?

On Tuesday, 23 July 2013 12:15:42 UTC-5, Jonathan Lundell wrote:
>
> On 23 Jul 2013, at 9:59 AM, David S > 
> wrote:
>
> It seems the online web2py book (http://web2py.com/book) isn't working 
> for me and is giving an unknown error.
>
> Is anyone seeing this issue?
>
>
> Yeah, it's broken.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: web2py book multilanguage

2013-07-24 Thread Massimo Di Pierro
Sorry. Was in the middle of an upgrade.

On Tuesday, 23 July 2013 10:05:09 UTC-5, Richard wrote:
>
> Book is down!
>
> http://web2py.com/admin/default/ticket/unknown
>
>
> On Tue, Jul 23, 2013 at 10:23 AM, Massimo Di Pierro 
> 
> > wrote:
>
>> Here is the book in Italian (older version):
>> https://dl.dropboxusercontent.com/u/18065445/web2py/web2py_manual_it2.pdf
>>
>>
>>
>> On Tuesday, 23 July 2013 07:35:41 UTC-5, Andrea Bonini wrote:
>>>
>>> is not possible recreate pdf of italian version? link is not valid...
>>>
>>> Il giorno giovedì 11 agosto 2011 11:23:37 UTC+2, Massimo Di Pierro ha 
>>> scritto:

 The web2py book online http://web2py.com/book is not multilanguage. 

 If your browser is set to English it is in Eglish 
 If your browser is set to Italian it is in Italian (traduzione di 
 Giovanni Cannata) 

 I do not have other translations but I can enable them if you have 
 them. Let me know. 

 massimo
>>>
>>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Monday 22 July 2013 05:16:56 Alan Etkin wrote:


I am just playing around with mongodb and web2py 

I noticed that when I just make a web2py dump of my mysql db and then upload it 
to mongodb some of the "joins" now just rec id's are right and some are newly 
generated. 

Also would it be possible to keep id to be web2py specific and to use _id for 
mongodb ? 




 
I was wondering if it was a bug. In this case in the setup table the pointers 
to the frame work fine, but the pointers in the setupprofile named lparprofile 
do not exist anymore in the lparprofile table. 




#

Sorry I am a bit slow, being busy.

But I did upload it from csv file. So  it should keep the reverences. But it 
did not do so for all tables.

Also I concluded that because all the references are replaced by mongodb id's 
it is not possible to say dump a table  with references in one database and 
then restore it on mongodb. Because you have no relation between the records 
anymore. You replaced the web2py id's in mongodb with mongodb id's.

I am curious about the reason, would het not be smarter to just keep the 
original id's ? Afterall mongodb uses _id. So it does not bite.  


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.