Re: [web2py] Write Inline query

2014-12-03 Thread Niphlod
not_in = db(db.table2.id>0)._select(db.table2.column2)


query = db(~db.table1.column1.belongs(not_in)).select()



On Tuesday, December 2, 2014 12:06:42 PM UTC+1, vijay@agnicient.com 
wrote:
>
>
> Hi All,
>
> I really need help with a query?
>
> this is my query:
>
>
> Select * from Table1 where Column1 not in (Select Column2 from Table2);
>
> How to write Query in Web2py DAL Sql From Grid
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-03 Thread Lisandro Rostagno
Actually I was referring to max-procs parameter of the fastcgi server that
is setup in lighttpd virtual host configuration. I don't know if you mean
that. In my virtual host configuration, I setup the fastcgi server like
this:

fastcgi.server = (
".fcgi" => ("localhost" => (
"check-local" => "disable",
"max-procs" => 2,
"socket" => "/var/tmp/lighttpd/diarioprimicia.sock",
"bin-path" => "/var/www/diarioprimicia/diarioprimicia.fcgi")
)
)

Is that what you mean by fastcgi server parameters?

Yesterday I changed from "fcgi_fork" to "fcgi" (still using flup), and I
set "max-procs" to 2 (like example above), and then used pgrep to check for
processes, and now I see 2 as expected. I also noticed a better usage of
ram as you said!

I must ask: ¿is there an obvious reason not to use flup? I have to say that
I'm no "server administrator guru". I just started using web2py, everything
scaled quick, and after some time, step by step, I ended up where I'm now,
with linode with ubuntu server, running web2py on production with several
sites.. I already have scripts that I can easily run to setup a full site:
as I said, the app installed in every site is the same, so my script takes
care of creating the folders, the database, cloning repository, creating
virtual host configuration, fcgi handler, etc.
So now if I want to switch to something else, I must have a very good
reason because I would have to rewrite the scripts and migrate all the
current sites. So that's why I'm asking if there is an obvious reason to
stop using flup (I've read some place that the author has discontinuated it
but I'm not shure).
I also read good stuff about nginx, some say that I should change from
lighttpd to nging, but everythin is working so fine that I'm not shure if I
should change anything :P


In the other hand, in relation to the database connections and pooling
mechanism, I posta question in the mailing list of pgbouncer, to clarify a
couple of doubts I had specifically about pgbouncer. Here is the full
conversation, if it helps anybody:
http://comments.gmane.org/gmane.comp.db.postgresql.pgbouncer.general/1168


Just to tell, now I have pgbouncer running on transaction pooling mode
(web2py's pooling mechanism is disabled, that is, DAL with pool_size=0). I
started lowering the pool_size of one of the database/user pairs (that is,
lowering the pool_size of one of the sites), and in turn out to one point
where I couldn't access the website, my browser kept "waiting for site".
That is what I was looking for, so for the moment I'm going to use this
configuration.

Notice that in pgbouncer the pool_size is asigned to the database/user
pair, so regardless of the number of "max-procs" in fastcgi server, if
every process connects with DAL(...) to the same database/user, all the
fastcgi processes will "share" the pool (I mean, it's transparent to
pgbouncer).


Thanks again and sorry about the extense emails. I'm working on that :P


2014-12-02 18:57 GMT-03:00 Michele Comitini :

> Everything ok with your plan.  One note, instead of playing with the
> max-procs in lighttpd you can use the fastcgi server parameters. btw don't
> use flup use this:
> https://github.com/momyc/gevent-fastcgi
> and arrange the num_workers parameter.
> to do that differently for each application may end up with one adapter
> script for each different application.
>
>
>
> 2014-12-01 23:33 GMT+01:00 Lisandro Rostagno :
>
>> Thank you very much Niphlod and Michele for your help! Now I have a more
>> clear understanding of all this. I understand now why I was seeing 5
>> fastcgi processes regardless of the "max-procs" configuration (that was
>> because I was using fcgi_fork, and I was actually seeing one process and
>> its 5 children).
>>
>> Michele, abount using pgbouncer when having more clients connections than
>> max postgresql connections, I think that's my case (correct me if I'm
>> wronk). All the sites I'm hosting are news sites, and ocassionally some of
>> them have sudden spikes in traffic. The last time one of the sites
>> presented a high peak on traffic, connections reached the postgresql
>> max_connections limit and, therefor, **all** the applications started
>> throwing intermitent HTTP 500 errors.
>>
>> So I started my research to see what could I do to **avoid compromising
>> some apps when one of them is getting high traffic**. Above all, I want to
>> be able to **control "the limits" for every app**. I started setting
>> server.kbytes-per-second  and connection.kbytes-per-second for every app.
>> However that didn't resolve the problem of high database connection
>> requests.
>>
>> With the last info you gave me, I think now I can achieve my goal
>> "playing around" a little with this settings (please correct me if I'm
>> worng):
>>
>>  - max-procs for the fastcgi of every app: I could set it to 1 for apps
>> with lower traffic, and set it to a higher value for apps with higher
>> traffi

Re: [web2py] using a requirements file with a web2py application

2014-12-03 Thread Vinicius Assef
The correct approach is using virtualenv and installing dependencies
inside your virtualenv.

On Mon, Dec 1, 2014 at 11:49 AM, Jason Solack  wrote:
> Hello, i'm deploying some sites to apache and i'm wondering if there's built
> in support for a "requirements" file to ensure my project is using the
> correct versions of packages.  I had a recent sitiuation where updating
> pandas created a bit of headache and i'd like to avoid that in the future by
> making sure my libraries don't update.
>
> Thank you for any advice!
>
> Jason
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-03 Thread Michele Comitini
why not flup?
- not event based.  Event based servers are usually more responsive under
load.
- seems pretty unmantained.
- misses some tuning options.

max-procs in lighttpd configuration:
- leave it to 1
- work with the following options in your script:
WSGIServer(application, minSpare=1, maxSpare=5, maxChildren=50,
 maxRequests=0)

explanation from flup code:
"""
A preforked server model conceptually similar to Apache httpd(2). At
any given time, ensures there are at least minSpare children ready to
process new requests (up to a maximum of maxChildren children total).
If the number of idle children is ever above maxSpare, the extra
children are killed.

If maxRequests is positive, each child will only handle that many
requests in its lifetime before exiting.

   """



2014-12-03 15:43 GMT+01:00 Lisandro Rostagno :

> Actually I was referring to max-procs parameter of the fastcgi server that
> is setup in lighttpd virtual host configuration. I don't know if you mean
> that. In my virtual host configuration, I setup the fastcgi server like
> this:
>
> fastcgi.server = (
> ".fcgi" => ("localhost" => (
> "check-local" => "disable",
> "max-procs" => 2,
> "socket" => "/var/tmp/lighttpd/diarioprimicia.sock",
> "bin-path" => "/var/www/diarioprimicia/diarioprimicia.fcgi")
> )
> )
>
> Is that what you mean by fastcgi server parameters?
>
> Yesterday I changed from "fcgi_fork" to "fcgi" (still using flup), and I
> set "max-procs" to 2 (like example above), and then used pgrep to check for
> processes, and now I see 2 as expected. I also noticed a better usage of
> ram as you said!
>
> I must ask: ¿is there an obvious reason not to use flup? I have to say
> that I'm no "server administrator guru". I just started using web2py,
> everything scaled quick, and after some time, step by step, I ended up
> where I'm now, with linode with ubuntu server, running web2py on production
> with several sites.. I already have scripts that I can easily run to setup
> a full site: as I said, the app installed in every site is the same, so my
> script takes care of creating the folders, the database, cloning
> repository, creating virtual host configuration, fcgi handler, etc.
> So now if I want to switch to something else, I must have a very good
> reason because I would have to rewrite the scripts and migrate all the
> current sites. So that's why I'm asking if there is an obvious reason to
> stop using flup (I've read some place that the author has discontinuated it
> but I'm not shure).
> I also read good stuff about nginx, some say that I should change from
> lighttpd to nging, but everythin is working so fine that I'm not shure if I
> should change anything :P
>
>
> In the other hand, in relation to the database connections and pooling
> mechanism, I posta question in the mailing list of pgbouncer, to clarify a
> couple of doubts I had specifically about pgbouncer. Here is the full
> conversation, if it helps anybody:
> http://comments.gmane.org/gmane.comp.db.postgresql.pgbouncer.general/1168
>
>
> Just to tell, now I have pgbouncer running on transaction pooling mode
> (web2py's pooling mechanism is disabled, that is, DAL with pool_size=0). I
> started lowering the pool_size of one of the database/user pairs (that is,
> lowering the pool_size of one of the sites), and in turn out to one point
> where I couldn't access the website, my browser kept "waiting for site".
> That is what I was looking for, so for the moment I'm going to use this
> configuration.
>
> Notice that in pgbouncer the pool_size is asigned to the database/user
> pair, so regardless of the number of "max-procs" in fastcgi server, if
> every process connects with DAL(...) to the same database/user, all the
> fastcgi processes will "share" the pool (I mean, it's transparent to
> pgbouncer).
>
>
> Thanks again and sorry about the extense emails. I'm working on that :P
>
>
> 2014-12-02 18:57 GMT-03:00 Michele Comitini :
>
> Everything ok with your plan.  One note, instead of playing with the
>> max-procs in lighttpd you can use the fastcgi server parameters. btw don't
>> use flup use this:
>> https://github.com/momyc/gevent-fastcgi
>> and arrange the num_workers parameter.
>> to do that differently for each application may end up with one adapter
>> script for each different application.
>>
>>
>>
>> 2014-12-01 23:33 GMT+01:00 Lisandro Rostagno 
>> :
>>
>>> Thank you very much Niphlod and Michele for your help! Now I have a more
>>> clear understanding of all this. I understand now why I was seeing 5
>>> fastcgi processes regardless of the "max-procs" configuration (that was
>>> because I was using fcgi_fork, and I was actually seeing one process and
>>> its 5 children).
>>>
>>> Michele, abount using pgbouncer when having more clients connections
>>> than max postgresql connections, I think that's my case (correct me if I'm
>>> wronk). All the 

[web2py] Re: Dynamic Upload Uploadfolder

2014-12-03 Thread James Burke
Final solution was this:

_tables.py
def store_file(file, filename=None, path=None):
path = path #"applications/init/uploads"
if not os.path.exists(path):
 os.makedirs(path)
pathfilename = os.path.join(path, filename)
dest_file = open(pathfilename, 'wb')
try:
shutil.copyfileobj(file, dest_file)
finally:
dest_file.close()
return filename


## Repository


db.define_table('repository',
Field('name', type='string'),
Field('directory', default='applications/init/uploads'),
Field('priority', 'integer', default=100),
format='%(name)s')


## File - Files stored in the repository


db.define_table('workbench',
Field('repository', 'reference repository'),
Field('name')
Field('workbench', type='upload', required=True, custom_store=store_file
, custom_retrieve=retrieve_file), #  
Field('sequence', 'integer', required=True),
Field('created_date', 'datetime', default=request.now, readable=False, 
writable=False),
Field('modified_date', 'datetime', update=request.now, readable=False, 
writable=False),
format='%(name)s')

Repository.py
def onvalidation(form):
repository = db.repository(form.vars.repository)
if repository is None:
raise HTTP(404)
db.workbench.workbench.uploadfolder = repository.directory


def oncreate(form):
db(db.workbench.id==form.vars.id).update(name=form.vars.workbench)


def onupdate(form):
db(db.workbench.id==form.vars.id).update(name=form.vars.workbench)


def index():
"""
Additional code here
"""
form = SQLFORM.smartgrid(db.repository, 
fields=fields, 
orderby=orderby, 
searchable=True, 
details=details, 
editable=editable, 
deletable=deletable,
oncreate=oncreate,
onupdate=onupdate,
onvalidation=onvalidation,
links=links, 
paginate=paginate, 
linked_tables=linked_tables)


return dict(form=form)

Need to use onvalidation to set the upload directory, oncreate is executed 
after the record is created.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Code that must run only once

2014-12-03 Thread Alan Evangelista
Where should I put code that should run only once at web server startup 
(not once per http request) (eg application initialization) ?

Thanks in advance!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread Matjaz P
I'll be there.
Matjaz

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] A newbe needs help

2014-12-03 Thread paul_eieio via web2py-users
 

I really want to learn Web2py and get it working on my P.C.

I have LinuxMint17 (a Ubuntu derivative); Python2.7 was installed; I 
installed python-web2py.

Trying to follow the documentation.


When I type *python web2py.py -S welcome* into my terminal I get:

python: can't open file 'web2py.py': [Errno 2] No such file or directory


My  $PYTHONPATH shows:

bash: :/usr/bin:/usr/share/web2py: *No such file* or directory

   $PATH shows: 

bash: 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
 
No such file or directory


When I type * python /usr/bin/web2py -S welcome* I get


 web2py Web Framework 

Created by Massimo Di Pierro, Copyright 2007-2011 

Version 1.99.7 (2012-03-04 22:12:08) stable 

Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP 

ERROR:web2py.cache:corrupted file applications/welcome/cache/cache.shelve, 
will try delete it! 

WARNING:web2py.cache:*unable to delete* file 
applications/welcome/cache/cache.shelve 

WARNING:web2py:import IPython error; use default python shell 

Python 2.7.6 (default, Mar 22 2014, 22:59:38) 

[GCC 4.8.2] on linux2 

Type "help", "copyright", "credits" or "license" for more information. 

(InteractiveConsole) 

>>> 


 I assumed the cashe was protected, so I changed the owner from * root* to 
user * paul* (me) on all directories and files below /usr/share/web2py/ but 
I get the same thing


 However, when I type* python /usr/bin/web2py* I get 

python /usr/bin/web2py

web2py Web Framework 

Created by Massimo Di Pierro, Copyright 2007-2011 

Version 1.99.7 (2012-03-04 22:12:08) stable 

Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP 

Starting hardcron... 


 and the server starts


 What am I doing wrong? Why won't* python web2py.py -S welcome* work, as 
stated in the documentation?


 Thanks for any help


 Paul


 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Modules and controllers running in processes - global variables

2014-12-03 Thread Alan Evangelista
Most of my application code is running in Python modules in the modules 
directory. In the modules directory, I have a few singletons which are 
implemented as variables defined in the main body of a globals module. 
However, it seems that web2py runs my modules and the controller in 
different processes and controller is unable to see the globals defined in 
the modules directory. I do not have this issue in other web frameworks 
such as Django. How do you usually handle this problem?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Widget in custom FORM

2014-12-03 Thread Jean-François Milants
Hi,

I would like to apply a widget (ckeditor) to an INPUT field of a custom 
FORM (not a SQLFORM).

When using SQLFORM and FIELD(...,widget=ckeditor.widget), the widget is 
correctly applied to the field of the FORM. Can I do the same thing with a 
custom FORM? 
The data I'm manipulating in the FORM are not directly linked to data in 
DB, so I can't use SQLFORM.

Thanks!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Deploying web2py website

2014-12-03 Thread PZ R
Hi , 

I'm fairly new to web development so this may be a silly question but how 
do I deploy a website I made in web2py?

Thank you :) 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread Chris Sears
I'll go.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread Juan Shishido
So glad I came across this. I'll be there. Thanks! Looking forward to it.

J

On Wednesday, November 5, 2014 11:48:14 PM UTC-8, weheh wrote:
>
> *Massimo Di Pietro, web2py's originator, will attend our own Bay Area* 
> *web2py 
> meetup* to meet, greet and present. Additional talks by Dexter Hadley, of 
> Stanford University and Richard Gordon, of YAKiToMe! will be given. Details 
> follow:
>
> Date: *Friday, December 5*
> Time: *6:30PM to 9:00PM*
> Location: *1125 Jackson Street, Albany, CA (directly off the Buchanan 
> freeway ramp)*
> Sponsor: *YAKiToMe.com* (a development-stage web2py-based TTS app)
> Cost: *Free*
> RSVP: *please RSVP by replying inline to this post*
> Parking: Plentiful free parking is readily available directly in front of 
> the meeting room
>
> *Agenda: *
> - 6:30PM to 7:00PM Informal mixer with pizza
> - 7:00PM to 8:00PM Massimo Di Pierro, Assoc. Prof. High Performance and 
> Scientific Computing, School of Computing, De Paul University, creator of 
> web2py
> - 8:00PM to 8:30PM Dexter Hadley, Md/PhD, Stanford University Division of 
> Systems Medicine Department of Pediatrics on using web2py to crowd source 
> disease signatures from open functional genomics data
> - 8:30PM to 9:00PM Richard Gordon, MSEE Stanford University, YAKiToMe.com, 
> on Extreme Off-roading With Web2py -- Lessons Learned
>
> Each talk will have some time for Q&A
>
> *Equipment Needs: *We still need a quality digital projector that can 
> plug into a laptop. If you are coming and can lend a working projector for 
> the night, please let me know as it would be much appreciated. Otherwise, I 
> will rent one. If you are giving a presentation, please plan on bringing 
> your own laptop. I will have a Windows laptop available just in case.
>
> *Spread The Word*. If you belong to the python user's group in San 
> Francisco or elsewhere in the Bay Area or are a member of a Django, Drupal, 
> Ruby or other web framework user's group, please help spread the word about 
> this meetup. This posting will be the official organizing document for the 
> meetup, so post your questions and comments here.
>
> Thanks, and hope to meet a bunch of web2py'ers on December 5!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread Geoffrey Wakeling
I will attend, will there be WiFi access?

On Wednesday, November 5, 2014 11:48:14 PM UTC-8, weheh wrote:
>
> *Massimo Di Pietro, web2py's originator, will attend our own Bay Area* 
> *web2py 
> meetup* to meet, greet and present. Additional talks by Dexter Hadley, of 
> Stanford University and Richard Gordon, of YAKiToMe! will be given. Details 
> follow:
>
> Date: *Friday, December 5*
> Time: *6:30PM to 9:00PM*
> Location: *1125 Jackson Street, Albany, CA (directly off the Buchanan 
> freeway ramp)*
> Sponsor: *YAKiToMe.com* (a development-stage web2py-based TTS app)
> Cost: *Free*
> RSVP: *please RSVP by replying inline to this post*
> Parking: Plentiful free parking is readily available directly in front of 
> the meeting room
>
> *Agenda: *
> - 6:30PM to 7:00PM Informal mixer with pizza
> - 7:00PM to 8:00PM Massimo Di Pierro, Assoc. Prof. High Performance and 
> Scientific Computing, School of Computing, De Paul University, creator of 
> web2py
> - 8:00PM to 8:30PM Dexter Hadley, Md/PhD, Stanford University Division of 
> Systems Medicine Department of Pediatrics on using web2py to crowd source 
> disease signatures from open functional genomics data
> - 8:30PM to 9:00PM Richard Gordon, MSEE Stanford University, YAKiToMe.com, 
> on Extreme Off-roading With Web2py -- Lessons Learned
>
> Each talk will have some time for Q&A
>
> *Equipment Needs: *We still need a quality digital projector that can 
> plug into a laptop. If you are coming and can lend a working projector for 
> the night, please let me know as it would be much appreciated. Otherwise, I 
> will rent one. If you are giving a presentation, please plan on bringing 
> your own laptop. I will have a Windows laptop available just in case.
>
> *Spread The Word*. If you belong to the python user's group in San 
> Francisco or elsewhere in the Bay Area or are a member of a Django, Drupal, 
> Ruby or other web framework user's group, please help spread the word about 
> this meetup. This posting will be the official organizing document for the 
> meetup, so post your questions and comments here.
>
> Thanks, and hope to meet a bunch of web2py'ers on December 5!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] web2py and pylint

2014-12-03 Thread Alan Evangelista
pylint checks fail on web2py controllers and models because web2py 
automatically imports several modules/classes/variables at runtime. I 
assume this is a known issue and there is no workaround?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread tajalliji
See you Friday.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Dynamically change highlighted class for response.menu

2014-12-03 Thread Moises Roth
if you need a simple menu you can use this code on "MODELS" > "menu.py"


def _():
# shortcuts
app = request.application
ctr = request.controller

# flags
pesquisa_h = 'highlighted' if ctr=='pesquisa' else ''
relatorios_h = 'highlighted' if ctr=='relatorios' else ''

response.menu += [
  (SPAN('Pesquisa', _class=pesquisa_h), False, 
URL('pesquisa', 'index'), []),
  (SPAN('Histórico', _class=relatorios_h), False, 
URL('relatorios', 'index'), [])
  ]

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-12-03 Thread Daniel Roesler
I would like to attend! Thanks! -Daniel Roesler

On Wednesday, November 5, 2014 11:48:14 PM UTC-8, weheh wrote:
>
> *Massimo Di Pietro, web2py's originator, will attend our own Bay Area* 
> *web2py 
> meetup* to meet, greet and present. Additional talks by Dexter Hadley, of 
> Stanford University and Richard Gordon, of YAKiToMe! will be given. Details 
> follow:
>
> Date: *Friday, December 5*
> Time: *6:30PM to 9:00PM*
> Location: *1125 Jackson Street, Albany, CA (directly off the Buchanan 
> freeway ramp)*
> Sponsor: *YAKiToMe.com* (a development-stage web2py-based TTS app)
> Cost: *Free*
> RSVP: *please RSVP by replying inline to this post*
> Parking: Plentiful free parking is readily available directly in front of 
> the meeting room
>
> *Agenda: *
> - 6:30PM to 7:00PM Informal mixer with pizza
> - 7:00PM to 8:00PM Massimo Di Pierro, Assoc. Prof. High Performance and 
> Scientific Computing, School of Computing, De Paul University, creator of 
> web2py
> - 8:00PM to 8:30PM Dexter Hadley, Md/PhD, Stanford University Division of 
> Systems Medicine Department of Pediatrics on using web2py to crowd source 
> disease signatures from open functional genomics data
> - 8:30PM to 9:00PM Richard Gordon, MSEE Stanford University, YAKiToMe.com, 
> on Extreme Off-roading With Web2py -- Lessons Learned
>
> Each talk will have some time for Q&A
>
> *Equipment Needs: *We still need a quality digital projector that can 
> plug into a laptop. If you are coming and can lend a working projector for 
> the night, please let me know as it would be much appreciated. Otherwise, I 
> will rent one. If you are giving a presentation, please plan on bringing 
> your own laptop. I will have a Windows laptop available just in case.
>
> *Spread The Word*. If you belong to the python user's group in San 
> Francisco or elsewhere in the Bay Area or are a member of a Django, Drupal, 
> Ruby or other web framework user's group, please help spread the word about 
> this meetup. This posting will be the official organizing document for the 
> meetup, so post your questions and comments here.
>
> Thanks, and hope to meet a bunch of web2py'ers on December 5!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Deploying web2py website

2014-12-03 Thread Massimo Di Pierro
You can use any web hosting service but this one is the 
easiest: https://www.pythonanywhere.com/try-web2py/

On Wednesday, 3 December 2014 10:37:44 UTC-6, PZ R wrote:
>
> Hi , 
>
> I'm fairly new to web development so this may be a silly question but how 
> do I deploy a website I made in web2py?
>
> Thank you :) 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: A newbe needs help

2014-12-03 Thread Massimo Di Pierro
Hello Paul,

Where are you installing this from? You are using a version that is 3 years 
old. You should download and unzip the version from the web2py.com web 
site. The version issue may or may not be related to the cache problem.

Massimo

On Wednesday, 3 December 2014 11:32:49 UTC-6, paul_...@yahoo.com wrote:
>
> I really want to learn Web2py and get it working on my P.C.
>
> I have LinuxMint17 (a Ubuntu derivative); Python2.7 was installed; I 
> installed python-web2py.
>
> Trying to follow the documentation.
>
>
> When I type *python web2py.py -S welcome* into my terminal I get:
>
> python: can't open file 'web2py.py': [Errno 2] No such file or directory
>
>
> My  $PYTHONPATH shows:
>
> bash: :/usr/bin:/usr/share/web2py: *No such file* or directory
>
>$PATH shows: 
>
> bash: 
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
>  
> No such file or directory
>
>
> When I type * python /usr/bin/web2py -S welcome* I get
>
>
>  web2py Web Framework 
>
> Created by Massimo Di Pierro, Copyright 2007-2011 
>
> Version 1.99.7 (2012-03-04 22:12:08) stable 
>
> Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP 
>
> ERROR:web2py.cache:corrupted file applications/welcome/cache/cache.shelve, 
> will try delete it! 
>
> WARNING:web2py.cache:*unable to delete* file 
> applications/welcome/cache/cache.shelve 
>
> WARNING:web2py:import IPython error; use default python shell 
>
> Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
>
> [GCC 4.8.2] on linux2 
>
> Type "help", "copyright", "credits" or "license" for more information. 
>
> (InteractiveConsole) 
>
> >>> 
>
>
>  I assumed the cashe was protected, so I changed the owner from * root* 
> to user * paul* (me) on all directories and files below 
> /usr/share/web2py/ but I get the same thing
>
>
>  However, when I type* python /usr/bin/web2py* I get 
>
> python /usr/bin/web2py
>
> web2py Web Framework 
>
> Created by Massimo Di Pierro, Copyright 2007-2011 
>
> Version 1.99.7 (2012-03-04 22:12:08) stable 
>
> Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP 
>
> Starting hardcron... 
>
>
>  and the server starts
>
>
>  What am I doing wrong? Why won't* python web2py.py -S welcome* work, as 
> stated in the documentation?
>
>
>  Thanks for any help
>
>
>  Paul
>
>
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Modules and controllers running in processes - global variables

2014-12-03 Thread Tim Richardson
Because requests are handled by threads, the way to do this may be to use 
the current object.
Note that you should replace "processes" with "threads" in your question. 
Most web2py execution environments are multi-threaded not not-multiprocess.

You set your global variables in one of the code bodies executed at each 
request; example the default model db.py, and assign them to the current 
object.
This is often done for passing to modules web2py global variables like DAL 
instances. 
Therefore the documentation in the book concentrates on solving this 
problem 
http://www.web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules
but the idea is extendable to all globals.

Then in each *function* in a module, you retrieve them. Don't retrieve them 
in the lexical global scope of the module file (i.e. outside a function 
body) because that code is not run in the thread you are interested in (the 
thread in which your module function is running).




On Wednesday, 3 December 2014 05:01:04 UTC+11, Alan Evangelista wrote:
>
> Most of my application code is running in Python modules in the modules 
> directory. In the modules directory, I have a few singletons which are 
> implemented as variables defined in the main body of a globals module. 
> However, it seems that web2py runs my modules and the controller in 
> different processes and controller is unable to see the globals defined in 
> the modules directory. I do not have this issue in other web frameworks 
> such as Django. How do you usually handle this problem?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: long running rpc call

2014-12-03 Thread Tim Richardson
Does your RPC call actually block other requests?


On Tuesday, 2 December 2014 06:29:36 UTC+11, Matt Broadstone wrote:
>
> Hi,
> We're making a number of rpc calls to other services using jsonrpc, and a 
> few of them are particularly long running. I'd rather not use the 
> scheduler, but instead was wondering if I could associate a jsonrpc 
> httpclient in python to the current context so that longer tasks wouldn't 
> block other incoming requests. I tried initially to just do a setattr on 
> current (it's thread local storage as far as I understand), but that 
> doesn't seem to work. Anyone have better ideas? Or am I just doing this 
> completely wrong.
>
> Cheers,
> Matt
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Modules and controllers running in processes - global variables

2014-12-03 Thread Anthony
Can you show some code (i.e, both some module code and how you are 
importing/accessing the objects from the controller)?

On Tuesday, December 2, 2014 1:01:04 PM UTC-5, Alan Evangelista wrote:
>
> Most of my application code is running in Python modules in the modules 
> directory. In the modules directory, I have a few singletons which are 
> implemented as variables defined in the main body of a globals module. 
> However, it seems that web2py runs my modules and the controller in 
> different processes and controller is unable to see the globals defined in 
> the modules directory. I do not have this issue in other web frameworks 
> such as Django. How do you usually handle this problem?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: How to upload web2py code to git

2014-12-03 Thread Tim Richardson
Are you trying to do this via the web2py admin interface, is that what you 
mean? What type of web2py installation do you have? (did you clone github, 
a "source" installation)
The  git integration built in to the admin app worked last time I used it 
as long as the python git modules are available, but most of the time I use 
git in a shell. 





On Monday, 1 December 2014 15:39:18 UTC+11, Andrea Baric wrote:
>
> Hi everyone,
>
> I am trying to figure out how to upload my code to GitHub from one of my 
> applications on web2py. This must be simple to do without saving every file 
> locally!
>
> Please help? Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


[web2py] Re: Deploying web2py website

2014-12-03 Thread Jim S
Have you read through this yet?

http://web2py.com/books/default/chapter/29/13/deployment-recipes

-Jim

On Wednesday, December 3, 2014 10:37:44 AM UTC-6, PZ R wrote:
>
> Hi , 
>
> I'm fairly new to web development so this may be a silly question but how 
> do I deploy a website I made in web2py?
>
> Thank you :) 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.