[web2py] resizing uploaded image file upload using gluon.contrib.imageutils

2013-12-02 Thread 黄祥
hi,

i'm trying to resizing uploaded image file upload using 
gluon.contrib.imageutils but nothing happens (no error occured and the 
image didn't resized). 

i'm testing it on windows 7 32 bit using web2py 2.8.2 both source and 
binary version, python 2.7.6, Pillow-2.2.1.win32-py2.7.

my code is :
*models/db_wizard_3_product.py*
from gluon.contrib.imageutils import RESIZE

db.product.image.requires = [IS_IMAGE(), RESIZE(220, 220)]

*controllers/master.py*
auth.requires_login()(lambda: None)()
def product():
grid=SQLFORM.grid(db.product)
return locals()

what should i do to resizing uploaded image file upload using 
gluon.contrib.imageutils?

thanks and best regards,
stifan

-- 
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/groups/opt_out.


[web2py] Online classes

2013-12-02 Thread Massimo Di Pierro
Hello everybody,

As you know I teach a certification program about web development with 
Python and I use web2py. 
I posted my most recent classes online:

https://vimeo.com/75499986
https://vimeo.com/76047107
https://vimeo.com/76608898
https://vimeo.com/77179700
https://vimeo.com/77654974

It is about of 13 hours of web2py lessons and coding.
Please join me in thanking the students who enrolled in the program and 
supported these classes.

Massimo

-- 
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/groups/opt_out.


[web2py] most web2py appliances with appengine wont work out of the box.

2013-12-02 Thread ID
Hi all,

I'm trying to setup web2py on Appengine, admin and example app works but, 
most of the apps under appliances wont work out of the box and issues a 
ticket..  in particular i'm interested to setup a little forum with 
pyforum2, that too does not work and issues a ticket. :(

-- 
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/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-12-02 Thread Massimo Di Pierro
Please open a ticket about this. We can do it.

On Monday, 2 December 2013 22:02:10 UTC-6, Dave S wrote:
>
> On Wednesday, November 27, 2013 12:31:05 PM UTC-8, Massimo Di Pierro wrote:
>>
>> Changelog
>>
>>
>> - no more winservice (use nssm instead)
>> - better imap support in DAL
>> - db().select().as_tree()
>> - bootstrap 2.3.2
>> - codemirror 3.19
>> - virtual fields in grid
>> - improved  mongoDB support, thanks Alan
>> - support for wiki custom render function
>> - Wiki(...groups=['x','y']) allows bypassing default permissions
>> - fixed websocket_messaging.py to support newer Tornado
>> - NDB support for GAE, thanks Quint
>> - fixed major concurrecy issue with MEMDB
>> - blocked generic.jsonp for security reasons
>> - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.
>>
>
>
> Upgrade from 2.7.2 via button went pretty well, but I had read the posts 
> about clearing sessions.
>
> Suggestions for the upgrade button:  
>   +   In addition to the flash message to restart the server, the 
> update/upgrade button could maybe turn into a "restart  server" button
>   +  Change the background color of the flash to RED, at least if default 
> css is used (almost didn't see the flash msg)
>   +  Display a checklist (tied to the release notes) of things to do 
> between server shutdown and server restart;
>   such as clearing sessions 
>   (and since it will take a while for all the pre-2.6.1 servers to be 
> upgraded, detect the older server and  show the 2.6.1 checklist)
>
> So far so good with my simple setup, though
> (creaky old Fedora 16 in a VMware Player, W2P+Rocket in a Terminal window 
> with Bash, clients all on local net, SOAP and simple grids)
> (no clients were harmed in this upgrade)
>
> /dps
>
>
>

-- 
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/groups/opt_out.


[web2py] one to many tables in views

2013-12-02 Thread Jesse Ferguson


I have two tables set up and i want to show the TimeCard with all the 
entries for said time card however im unsure of how to create such a view...

CONTOLLER:

def timecard_index():
tcrows =db(db.timecard).select(orderby=~db.timecard.tc_date)
tcinputs =db(db.timecard_entry).select(orderby=db.timecard_entry.timecard)
return locals()

MODEL:

db.define_table('timecard',
Field('tc_date','date'),
Field('employee', 'reference 
employee',requires=IS_IN_DB(db,'employee.id','%(fname)s %(lname)s')),
Field('myid', unique=True, compute=lambda r: str(r.tc_date) + 
str(r.employee))
)

db.define_table('timecard_entry',
Field('timecard', 'reference timecard', readable=False, 
writable=False,),
Field('company', 'reference company', label='Company'),
Field('tc_start', 'time', requires=[IS_TIME(),IS_NOT_EMPTY()], 
label='Start'),
Field('tc_stop', 'time', requires=[IS_TIME(),IS_NOT_EMPTY()], 
label='Stop'),
Field('st' , 'double', label='ST', default=0.0),
Field('ot' , 'double', label='OT', default=0.0),
Field('dt' , 'double', label='DT', default=0.0),
Field('tc_classification' ,'string', label='Classification'),
auth.signature)

VIEW:

{{for timecard in tcrows:}}


{{=A(timecard.employee.fname +' 
'+timecard.employee.lname,_href=URL('view_timecard',args=timecard.id))}} 
{{=timecard.tc_date.strftime("%m.%d.%Y")}}
{{for timecard_entry in tcinputs:}}

{{=timecard_entry.company.name}}{{=timecard_entry.tc_start}}{{=timecard_entry.tc_stop}}{{=timecard_entry.st}}{{=timecard_entry.ot}}{{=timecard_entry.dt}}{{=timecard_entry.tc_classification}}
{{pass}}
 

{{pass}}

This results in the same entries being put into each timecard (not the 
correct ones), I know I'm missing something in the logic but I'm too green 
of a programmer to see it... Im also not sure if im making the correct 
query for tcinputs...

-- 
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/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-12-02 Thread Dave S
On Wednesday, November 27, 2013 12:31:05 PM UTC-8, Massimo Di Pierro wrote:
>
> Changelog
>
>
> - no more winservice (use nssm instead)
> - better imap support in DAL
> - db().select().as_tree()
> - bootstrap 2.3.2
> - codemirror 3.19
> - virtual fields in grid
> - improved  mongoDB support, thanks Alan
> - support for wiki custom render function
> - Wiki(...groups=['x','y']) allows bypassing default permissions
> - fixed websocket_messaging.py to support newer Tornado
> - NDB support for GAE, thanks Quint
> - fixed major concurrecy issue with MEMDB
> - blocked generic.jsonp for security reasons
> - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.
>


Upgrade from 2.7.2 via button went pretty well, but I had read the posts 
about clearing sessions.

Suggestions for the upgrade button:  
  +   In addition to the flash message to restart the server, the 
update/upgrade button could maybe turn into a "restart  server" button
  +  Change the background color of the flash to RED, at least if default 
css is used (almost didn't see the flash msg)
  +  Display a checklist (tied to the release notes) of things to do 
between server shutdown and server restart;
  such as clearing sessions 
  (and since it will take a while for all the pre-2.6.1 servers to be 
upgraded, detect the older server and  show the 2.6.1 checklist)

So far so good with my simple setup, though
(creaky old Fedora 16 in a VMware Player, W2P+Rocket in a Terminal window 
with Bash, clients all on local net, SOAP and simple grids)
(no clients were harmed in this upgrade)

/dps


-- 
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/groups/opt_out.


[web2py] Re: admin interface wrong on 2.8.2

2013-12-02 Thread Dave S


On Monday, December 2, 2013 7:46:46 PM UTC-8, Dave S wrote:
>
> On Monday, December 2, 2013 7:10:10 PM UTC-8, lucas wrote:
>>
>> hey everyone,
>>
>> got web2py 2.8.2 working on apache and centos.  fixed under
>>
>> https://groups.google.com/forum/#!topic/web2py/DexgEESPk38
>>
>> however, i mentioned that admin interface is all messed up.  my admin 
>> interface is not right though.  the cool interface for admin is missing 
>> like the pull-downs and stuff.  
>>
>
> Which pull-downs -- from the navbar?  Or is it the "left-column" files 
> stuff when you are editing a controller or view?
>
>  
>
>> i just get straight html text without the java scripting side of it.  am 
>> i missing another js file that i should copy?  it does work with the 
>> "python web2py.py" interface, but not with apache.  so what would be the 
>> difference in that?
>>
>
> What version were you running the last time you saw it working?  If you 
> were coming from a version older than 2.6.1, then you need to copy some .js 
> from the welcome app (the supplied sample application).  
>

I see from the other thread you came from 2.4 ... make sure you've read the 
2.6.1 release notes:



/dps

 

> If you were coming from a newer version and you are not using the 
> co-packaged Rocket webserver, then you may need to check that the static 
> files versioning is working in your setup.
>
> (I had it simple; I'm running W2P+Rocket, and just had to clear sessions. 
>  But I was at 2.7.2, and had already shuffled .js files around coming from 
> 2.5.1.)
>
>

-- 
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/groups/opt_out.


[web2py] Re: admin interface wrong on 2.8.2

2013-12-02 Thread Dave S
On Monday, December 2, 2013 7:10:10 PM UTC-8, lucas wrote:
>
> hey everyone,
>
> got web2py 2.8.2 working on apache and centos.  fixed under
>
> https://groups.google.com/forum/#!topic/web2py/DexgEESPk38
>
> however, i mentioned that admin interface is all messed up.  my admin 
> interface is not right though.  the cool interface for admin is missing 
> like the pull-downs and stuff.  
>

Which pull-downs -- from the navbar?  Or is it the "left-column" files 
stuff when you are editing a controller or view?

 

> i just get straight html text without the java scripting side of it.  am i 
> missing another js file that i should copy?  it does work with the "python 
> web2py.py" interface, but not with apache.  so what would be the difference 
> in that?
>

What version were you running the last time you saw it working?  If you 
were coming from a version older than 2.6.1, then you need to copy some .js 
from the welcome app (the supplied sample application).  If you were coming 
from a newer version and you are not using the co-packaged Rocket 
webserver, then you may need to check that the static files versioning is 
working in your setup.

(I had it simple; I'm running W2P+Rocket, and just had to clear sessions. 
 But I was at 2.7.2, and had already shuffled .js files around coming from 
2.5.1.)

/dps



-- 
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/groups/opt_out.


[web2py] Re: admin interface wrong on 2.8.2

2013-12-02 Thread Massimo Di Pierro
In your apache config files you need to replace

^/([^/]+)/static/?(.*)

with

^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*)

in two places.

On Monday, 2 December 2013 21:10:10 UTC-6, lucas wrote:
>
> hey everyone,
>
> got web2py 2.8.2 working on apache and centos.  fixed under
>
> https://groups.google.com/forum/#!topic/web2py/DexgEESPk38
>
> however, i mentioned that admin interface is all messed up.  my admin 
> interface is not right though.  the cool interface for admin is missing 
> like the pull-downs and stuff.  i just get straight html text without the 
> java scripting side of it.  am i missing another js file that i should 
> copy?  it does work with the "python web2py.py" interface, but not with 
> apache.  so what would be the difference in that?
>
> thanx again, lucas
>

-- 
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/groups/opt_out.


[web2py] admin interface wrong on 2.8.2

2013-12-02 Thread lucas
hey everyone,

got web2py 2.8.2 working on apache and centos.  fixed under

https://groups.google.com/forum/#!topic/web2py/DexgEESPk38

however, i mentioned that admin interface is all messed up.  my admin 
interface is not right though.  the cool interface for admin is missing 
like the pull-downs and stuff.  i just get straight html text without the 
java scripting side of it.  am i missing another js file that i should 
copy?  it does work with the "python web2py.py" interface, but not with 
apache.  so what would be the difference in that?

thanx again, lucas

-- 
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/groups/opt_out.


[web2py] Re: module-new file - error when saving

2013-12-02 Thread 98ujko9
Found the problem, it is my ignorance. Names that start with digits aren't 
valid identifiers. Thanks. I am new to all this.

On Monday, December 2, 2013 8:03:43 PM UTC-5, 黄祥 wrote:
>
> not sure why it's not work, please try to rename your modules files into 
> friendly name. e.g. rental_master.py
>
> then from your controller
> import rental_master
> def customer():
> return rental_master.grid_0(db.customer)
>
>
> best regards,
> stifan
>

-- 
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/groups/opt_out.


[web2py] Re: module-new file - error when saving

2013-12-02 Thread 黄祥
not sure why it's not work, please try to rename your modules files into 
friendly name. e.g. rental_master.py

then from your controller
import rental_master
def customer():
return rental_master.grid_0(db.customer)


best regards,
stifan

-- 
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/groups/opt_out.


[web2py] Re: Suggestions for multiple files upload in form

2013-12-02 Thread Ruud Schroen
Hi,

I know this is an old thread, but I have a question.

The upload and everything is working fine, but for some reason it doesn't 
work when bootstrap.min.css (the default one by web2py) is NOT included. 
This is kinda stupid because i'm using Foundation. Any idea what's going on?

On Friday, October 28, 2011 2:40:12 AM UTC+2, Paolo Caruccio wrote:
>
> I wasn't able to find in the web, even in this group, a multiple files 
> upload system with the followings requirements:
>
> - upload the files together with form submit
> - no frame, no flash, no ajax form submit but only jquery and python
> - give a title to the uploading files
> - simple to integrate and control in web2py 
>
> so, inspired by 
> http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/,
>  
> I wrote one by my self.
> It's minimalist and the code isn't optimized (I'm not a programmer), but 
> it works for my purposes.
>
> If you would like to test it in default welcome web2py app:
>  - put jquery.multiuploads.js in static/js folder
>  - put multiuploads.css in static/css folder
>  - append the functions to default.py in controllers folder
>  - append the table definition to db.py in models folder
>  - put upload_documents.html in views folder
>
> You'll find some comments in the code and also many errors.
>
> I look forward to your suggestions and opinions.
>
> Ciao.
>
> Paolo
>

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 10:06:38 -0800 (PST)
lucas  escribió:

> 
> 
> > Have you read apache logs?, this line: 
> >
> > WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py 
> >
> > Have in mind that wsgihandler.py is in web2py/handlers in latest 
> > versions of web2py... you might, also, have to fix permissions for
> > this file to rwxr-xr-x 
> >
> 
> yes, that did it.  i happened to have read the README under the
> handlers subdirectory and it says that the appropriate file(s) should
> be copied to the parent (web2py) folder.  so instead of doing the
> copy, i did a symbolic link, like "ln -s handlers/wsgihandler.py".  i
> also did chmod and chown for that link and restarted apache and it
> worked great. 
> 
> can anything be wrong with using the link to the file?  my thinking
> is the when the handler is updated, the link will still be valid.
> 
> lucas
> 

Not sure, but even if it brokes on upgrade you know what is the
solution...

Marco.

-- 
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/groups/opt_out.


[web2py] Re: LOAD Helper produces only "loading..." on fresh install.

2013-12-02 Thread Chris Hepworth
I found my error.

On Monday, December 2, 2013 11:06:45 AM UTC-7, Chris Hepworth wrote:
>
> I have recently installed web2py, so I don't think the issue is out of 
> date files. I have been following the recipe in the documentation, so my 
> code is as follows:
>
> index.html:
> {{extend 'layout.html'}}
>
> {{=LOAD('comments','post.load',ajax=True)}}
>
> post.load:
> {{for post in comments:}}
> 
>   On {{=post.created_on}} {{=post.created_by.first_name}}
>   says {{=post.f_comment}}
> 
> {{pass}}
> {{=form}}
> The table definition I used had f_comment in place of body for the main 
> text of the comment.
>
> comments.py:
>
> @auth.requires_login()
> def post():
> form=SQLFORM(db.t_comment).process()
> comments=db(db.t_comment).select()
> return dict(form=form,comments=comments)
>
> Loading the page my accessing through app/comments/post.load works fine 
> and the functionality is there. But when the index page loads, it never 
> gets beyond "loading...". 
>

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread lucas


> Some things we know have changed:
> - admin uses versioning for static files therefore you need the new 
> handlers/wsgihandler.py
> - sessions use a different format, therefore you have to remove all 
> existing session files (or sessions in db)
> - web2py.js has changed so you must cp applications/welcome/static/js/
> web2py.js  into applications/*/static/js
>
> Yet none of this seems to be the cause of your problem. Did you upgrade 
> mod_wsgi too?
>

hey massimo, good to hear from you and how is school going?

i did delete all session files, done and check.  i copied the web2py.js 
from welcome into all other applications, check.  my mod_wsgi.so should be 
latest and i am showing version 3.2-3, check.

my admin interface is not right though.  i don't have the 404 Not Found 
anymore, but the cool interface for admin is missing like the pull-downs 
and stuff.  i just get straight html text without the java scripting side 
of it.  am i missing another js file that i should copy?

lucas

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread lucas


> Have you read apache logs?, this line: 
>
> WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py 
>
> Have in mind that wsgihandler.py is in web2py/handlers in latest 
> versions of web2py... you might, also, have to fix permissions for this 
> file to rwxr-xr-x 
>

yes, that did it.  i happened to have read the README under the handlers 
subdirectory and it says that the appropriate file(s) should be copied to 
the parent (web2py) folder.  so instead of doing the copy, i did a symbolic 
link, like "ln -s handlers/wsgihandler.py".  i also did chmod and chown for 
that link and restarted apache and it worked great. 

can anything be wrong with using the link to the file?  my thinking is the 
when the handler is updated, the link will still be valid.

lucas

-- 
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/groups/opt_out.


[web2py] LOAD Helper produces only "loading..." on fresh install.

2013-12-02 Thread Chris Hepworth
I have recently installed web2py, so I don't think the issue is out of date 
files. I have been following the recipe in the documentation, so my code is 
as follows:

index.html:
{{extend 'layout.html'}}

{{=LOAD('comments','post.load',ajax=True)}}

post.load:
{{for post in comments:}}

  On {{=post.created_on}} {{=post.created_by.first_name}}
  says {{=post.f_comment}}

{{pass}}
{{=form}}
The table definition I used had f_comment in place of body for the main 
text of the comment.

comments.py:

@auth.requires_login()
def post():
db.t_comment.f_approved.writable = False
db.t_comment.f_approved.readable = False
form=SQLFORM(db.t_comment).process()
comments=db(db.t_comment).select()
return dict(form=form,comments=comments)

Loading the page my accessing through app/comments/post.load works fine and 
the functionality is there. But when the index page loads, it never gets 
beyond "loading...". 

-- 
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/groups/opt_out.


[web2py] Re: Issues with cpdb - references invalid table

2013-12-02 Thread Alan Etkin


> returns the correct order, the same as defined in models/db.py, whereas if 
> I add a print statement 'print table' under  loop 'for table in self.db:' 
> in scripts/cpdb.py it returns the list of tables in alphabetic order. 
>

I belive this is a problem with the DAL class initialization. If you are 
running the script from the command line, sql db table definitions will be 
probably retrieved from database table files, which have, I guess, a 
different order than the model definitions.

-- 
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/groups/opt_out.


Re: [web2py] Re: admin app killed!

2013-12-02 Thread Martin Weissenboeck
I have cleared the sessions and the errors and it worked - thank you!


2013/12/2 Jonathan Lundell 

> On 2 Dec 2013, at 8:05 AM, Marin Pranjić  wrote:
>
> Clear your sessions, clear existing error tickets and then try again.
>
>
> There's a patch post-2.8.2 that makes access.py tolerant of a dict.
>
> -is_mobile = request.user_agent().is_mobile
> +is_mobile = request.user_agent().get('is_mobile')
>
> BTW, that should have been:
>
> -is_mobile = request.user_agent().is_mobile
> +is_mobile = request.user_agent().get('is_mobile', False)
>
>
>
> Marin
>
>
> On Mon, Dec 2, 2013 at 4:59 PM, Jonathan Lundell wrote:
>
>> On 2 Dec 2013, at 7:49 AM, JoeCodeswell  wrote:
>>
>> > Here's a zip of C:\web2py\applications\admin\errors contents.
>>
>> S" 'dict' object has no attribute
>> 'is_mobile'"
>>
>> S'Traceback (most recent call last):\n
>> File "C:\\web2py\\gluon\\restricted.py", line 217, in restricted\n
>>  exec ccode in environment\n
>> File "C:\\web2py\\applications\\admin\\models\\access.py", line 147, in
>> \nis_mobile = request.user_agent().is_mobile\nAttributeError:
>> \'dict\' object has no attribute \'is_mobile\'\n'
>>
>>
>> >
>> > On Monday, December 2, 2013 7:41:29 AM UTC-8, JoeCodeswell wrote:
>> > Dear web2py Community,
>> >
>> > There were problems for me as well, but now they cleared up. On
>> winXpSp3, I had my Firefox-25.0.1 opened while i did an extract into
>> C:\web2py. So then [as best as i remember]:
>> >   • I checked to see if the upgrade happened by refreshing the
>> admin page. result Version did not change.
>> >   • So i left the browser open. Turned off the server & turned it
>> on again. result new welcome page appeared.
>> >   • i clicked on the admin interface button. result:
>> >   • ticket appeared  so i clicked on the link result:
>> >   • ticket appeared  so i clicked on the link result:
>> >   • ticket appeared
>> >   • i closed all the browser tabs & shut down &  restarted the
>> server result:
>> >   • ALL IS WELL ??? It seems OK.
>> >   • ajax in the startup ???
>> > The C:\web2py\logs directory is empty.
>> >
>> > I hope this adds some light to the subject.
>> >
>> > Love and peace,
>> >
>> > Joe
>> >
>> >
>> > On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
>> > Hi,
>> >
>> > I have updated my main system to 2.8.2
>> > Now when I call  my_server/admin  I get an error ticket.
>> > But I cannot analyze the error ticket, because it  needs admin and I
>> get another error.
>> >
>> > Afterwards I have copied the whole admin-app from the source over
>> my_server/admin - same result.
>> >
>> > Any ideas?
>> > Regards Martin
>> >
>>
>> --
>> 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/groups/opt_out.
>>
>
>
> --
> 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/groups/opt_out.
>
>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread Massimo Di Pierro
Some things we know have changed:
- admin uses versioning for static files therefore you need the new 
handlers/wsgihandler.py
- sessions use a different format, therefore you have to remove all 
existing session files (or sessions in db)
- web2py.js has changed so you must cp applications/welcome/static/js/
web2py.js  into applications/*/static/js

Yet none of this seems to be the cause of your problem. Did you upgrade 
mod_wsgi too?

On Monday, 2 December 2013 06:11:05 UTC-6, lucas wrote:
>
>
> have you changed permissions to web2py folder?, in centos user and 
>> group should be apache, unless you have a modified setup: 
>>
>> chown -R apache:apache web2py/ 
>>
>
> good thought but no, it didn't do the trick.  damn, almost.
>
> hey massimo, what could have changed between 2.4 and 2.8, probably 
> specifically in mod_wsgi.so? 
>
> lucas
>

-- 
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/groups/opt_out.


[web2py] Re: intermittent problem with importing dropbox

2013-12-02 Thread Massimo Di Pierro
Did you install this?
https://www.dropbox.com/developers/core/sdks/python

On Monday, 2 December 2013 09:56:30 UTC-6, Peter wrote:
>
> I have some code that writes a file to dropbox.
>
> It includes
>
> from dropbox import client, rest, session
> i
>
> when I run the save_file command from the browser the majority of the time 
> it works fine and does what it is supposed to do. But about 1 in 3 times it 
> comes up with a ticket
>
> File "/opt/web-apps/web2py/applications/new_spin2/controllers/default.py" 
> , 
> line 591, in save_sqlite
> from dropbox import client, rest, session
>   File "/opt/web-apps/web2py/gluon/custom_import.py", line 86, in 
> custom_importer
> return base_importer(pname, globals, locals, fromlist, level)
> ImportError: No module named dropbox
>
>
> I can just sit there and get the same page to reload and arbitrarily it will 
> work or fail.
>
> If I log on to the system with ssh, and run the same version of python and 
> import dropbox it always imports fine, so it is only occasionally failing to 
> import dropbox under web2py.
>
> Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
> (Running on Unknown, Python 2.6.8)
>
> running on centos 5
>
> any ideas?
>
> Thanks
>
> Peter
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-02 Thread Massimo Di Pierro
The scheduler should do what you need. You can start many workers to manage 
the load.

On Monday, 2 December 2013 05:51:26 UTC-6, Yassen D. wrote:
>
> Massimo, thanks a lot for your help!
>
> I will upgrade right away then. (I have very limited time, so I was afraid 
> to break things.)
>
> My comments:
>
> (a) We need to get the import process run instantly on user UI action 
> (link click). Couple of seconds later is okay, but half a minute later is 
> not okay.
>
> (b) We may have several users doing that at the same time, thus n such 
> tasks need to be able to run in parallel.
>
> Will the scheduler allow me to implement an acceptable solution?
>
> Thanks!
> YD
>
>
> On Monday, December 2, 2013 9:41:40 AM UTC+2, Massimo Di Pierro wrote:
>>
>> The first recommendation would be upgrade to 2.8.2 (nothing should break) 
>> and use the scheduler.
>>
>> Do not use threads because they may still be killed by the web server.
>> You can run a simple background process that every minute checks if there 
>> is something to do. Then use an auxiliary table to queue the fb credentials 
>> of those users that need to be processed.
>>
>>

-- 
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/groups/opt_out.


Re: [web2py] Re: admin app killed!

2013-12-02 Thread Jonathan Lundell
On 2 Dec 2013, at 8:05 AM, Marin Pranjić  wrote:

> Clear your sessions, clear existing error tickets and then try again.

There's a patch post-2.8.2 that makes access.py tolerant of a dict.

-is_mobile = request.user_agent().is_mobile
+is_mobile = request.user_agent().get('is_mobile')

BTW, that should have been:

-is_mobile = request.user_agent().is_mobile
+is_mobile = request.user_agent().get('is_mobile', False)


> 
> Marin
> 
> 
> On Mon, Dec 2, 2013 at 4:59 PM, Jonathan Lundell  wrote:
> On 2 Dec 2013, at 7:49 AM, JoeCodeswell  wrote:
> 
> > Here's a zip of C:\web2py\applications\admin\errors contents.
> 
> S" 'dict' object has no attribute 
> 'is_mobile'"
> 
> S'Traceback (most recent call last):\n
> File "C:\\web2py\\gluon\\restricted.py", line 217, in restricted\nexec 
> ccode in environment\n
> File "C:\\web2py\\applications\\admin\\models\\access.py", line 147, in 
> \nis_mobile = request.user_agent().is_mobile\nAttributeError: 
> \'dict\' object has no attribute \'is_mobile\'\n'
> 
> 
> >
> > On Monday, December 2, 2013 7:41:29 AM UTC-8, JoeCodeswell wrote:
> > Dear web2py Community,
> >
> > There were problems for me as well, but now they cleared up. On winXpSp3, I 
> > had my Firefox-25.0.1 opened while i did an extract into C:\web2py. So then 
> > [as best as i remember]:
> >   • I checked to see if the upgrade happened by refreshing the admin 
> > page. result Version did not change.
> >   • So i left the browser open. Turned off the server & turned it on 
> > again. result new welcome page appeared.
> >   • i clicked on the admin interface button. result:
> >   • ticket appeared  so i clicked on the link result:
> >   • ticket appeared  so i clicked on the link result:
> >   • ticket appeared
> >   • i closed all the browser tabs & shut down &  restarted the server 
> > result:
> >   • ALL IS WELL ??? It seems OK.
> >   • ajax in the startup ???
> > The C:\web2py\logs directory is empty.
> >
> > I hope this adds some light to the subject.
> >
> > Love and peace,
> >
> > Joe
> >
> >
> > On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
> > Hi,
> >
> > I have updated my main system to 2.8.2
> > Now when I call  my_server/admin  I get an error ticket.
> > But I cannot analyze the error ticket, because it  needs admin and I get 
> > another error.
> >
> > Afterwards I have copied the whole admin-app from the source over 
> > my_server/admin - same result.
> >
> > Any ideas?
> > Regards Martin
> >
> 
> --
> 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/groups/opt_out.
> 
> 
> -- 
> 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/groups/opt_out.

-- 
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/groups/opt_out.


[web2py] Re: upgrade failed for 2.8.2

2013-12-02 Thread JoeCodeswell
Dear lucas,

Other updating problems & analysis for 2.8.2 are at this post, "admin app 
killed!
".

Love and peace,

Joe

On Sunday, December 1, 2013 8:06:33 PM UTC-8, lucas wrote:
>
> hey everyone,
>
> i have been trying to update to web2py 2.8.2.  i am running under centos 
> 6.3 and apache 2.2.15.  i have done this sort of web2py upgrade on this 
> same system a dozen times or so and never had a problem.  i simply get the 
> error "404 Not Found" under any url like, "http://localhost"; or "
> http://localhost/welcome";.  they also don't work under https or port 
> 443.  any ideas would be great and appreciated.  httpd.conf is left 
> unchanged and is most probable the default.  here are my other configs for 
> apache:
>
> in /etc/httpd/conf.d/wsgi.conf:
>
> LoadModule wsgi_module modules/mod_wsgi.so
> WSGIDaemonProcess web2py user=apache group=apache
> WSGIApplicationGroup %{GLOBAL}
> WSGIProcessGroup web2py
> WSGISocketPrefix run/wsgi
> WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>
> in /etc/httpd/conf.d/default.conf:
>
> NameVirtualHost *:80
> NameVirtualHost *:443
>
> 
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> Order Allow,Deny
> Allow from all
>   
>
>   
> Deny from all
>   
>
>   
> Deny from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
> 
>   SSLEngine on
>   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
>   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key
>
>   WSGIProcessGroup web2py
>
>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> ExpiresActive On
> ExpiresDefault "access plus 1 hour"
> Order Allow,Deny
> Allow from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: admin app killed!

2013-12-02 Thread Marin Pranjić
Clear your sessions, clear existing error tickets and then try again.

Marin


On Mon, Dec 2, 2013 at 4:59 PM, Jonathan Lundell  wrote:

> On 2 Dec 2013, at 7:49 AM, JoeCodeswell  wrote:
>
> > Here's a zip of C:\web2py\applications\admin\errors contents.
>
> S" 'dict' object has no attribute
> 'is_mobile'"
>
> S'Traceback (most recent call last):\n
> File "C:\\web2py\\gluon\\restricted.py", line 217, in restricted\nexec
> ccode in environment\n
> File "C:\\web2py\\applications\\admin\\models\\access.py", line 147, in
> \nis_mobile = request.user_agent().is_mobile\nAttributeError:
> \'dict\' object has no attribute \'is_mobile\'\n'
>
>
> >
> > On Monday, December 2, 2013 7:41:29 AM UTC-8, JoeCodeswell wrote:
> > Dear web2py Community,
> >
> > There were problems for me as well, but now they cleared up. On
> winXpSp3, I had my Firefox-25.0.1 opened while i did an extract into
> C:\web2py. So then [as best as i remember]:
> >   • I checked to see if the upgrade happened by refreshing the admin
> page. result Version did not change.
> >   • So i left the browser open. Turned off the server & turned it on
> again. result new welcome page appeared.
> >   • i clicked on the admin interface button. result:
> >   • ticket appeared  so i clicked on the link result:
> >   • ticket appeared  so i clicked on the link result:
> >   • ticket appeared
> >   • i closed all the browser tabs & shut down &  restarted the
> server result:
> >   • ALL IS WELL ??? It seems OK.
> >   • ajax in the startup ???
> > The C:\web2py\logs directory is empty.
> >
> > I hope this adds some light to the subject.
> >
> > Love and peace,
> >
> > Joe
> >
> >
> > On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
> > Hi,
> >
> > I have updated my main system to 2.8.2
> > Now when I call  my_server/admin  I get an error ticket.
> > But I cannot analyze the error ticket, because it  needs admin and I get
> another error.
> >
> > Afterwards I have copied the whole admin-app from the source over
> my_server/admin - same result.
> >
> > Any ideas?
> > Regards Martin
> >
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] How do I post an image to web2py from HTML5 Canvas

2013-12-02 Thread Michael Hall
If I have the following model:

db.define_table('user_images',
Field('my_image', 'upload',
  label=T('My Image')),
)

and In my rendered html view I have a canvas, the canvas has produced an 
image saved in the variable 
document.getElementById('canvas').src = dataURL;

Underneath the image is an upload button, I wish to POST the canvas image 
to images.myimage when the button is pressed and then move to a new view 
and controller which displays the uploaded image and has some more editing 
options.

What is the best way to achieve this? Is it possible to render a sqlform 
that only has a button which when pressed uploads dataURL and redirects to 
the next controller/view?


-- 
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/groups/opt_out.


Re: [web2py] Re: admin app killed!

2013-12-02 Thread Jonathan Lundell
On 2 Dec 2013, at 7:49 AM, JoeCodeswell  wrote:

> Here's a zip of C:\web2py\applications\admin\errors contents.

S" 'dict' object has no attribute 'is_mobile'"

S'Traceback (most recent call last):\n  
File "C:\\web2py\\gluon\\restricted.py", line 217, in restricted\nexec 
ccode in environment\n  
File "C:\\web2py\\applications\\admin\\models\\access.py", line 147, in 
\nis_mobile = request.user_agent().is_mobile\nAttributeError: 
\'dict\' object has no attribute \'is_mobile\'\n'


> 
> On Monday, December 2, 2013 7:41:29 AM UTC-8, JoeCodeswell wrote:
> Dear web2py Community,
> 
> There were problems for me as well, but now they cleared up. On winXpSp3, I 
> had my Firefox-25.0.1 opened while i did an extract into C:\web2py. So then 
> [as best as i remember]:
>   • I checked to see if the upgrade happened by refreshing the admin 
> page. result Version did not change.
>   • So i left the browser open. Turned off the server & turned it on 
> again. result new welcome page appeared.
>   • i clicked on the admin interface button. result:
>   • ticket appeared  so i clicked on the link result:
>   • ticket appeared  so i clicked on the link result:
>   • ticket appeared  
>   • i closed all the browser tabs & shut down &  restarted the server 
> result:
>   • ALL IS WELL ??? It seems OK.
>   • ajax in the startup ???
> The C:\web2py\logs directory is empty.
> 
> I hope this adds some light to the subject. 
> 
> Love and peace,
> 
> Joe
> 
> 
> On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
> Hi,
> 
> I have updated my main system to 2.8.2
> Now when I call  my_server/admin  I get an error ticket.
> But I cannot analyze the error ticket, because it  needs admin and I get 
> another error.
> 
> Afterwards I have copied the whole admin-app from the source over 
> my_server/admin - same result.
> 
> Any ideas?
> Regards Martin
> 

-- 
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/groups/opt_out.


[web2py] intermittent problem with importing dropbox

2013-12-02 Thread Peter
I have some code that writes a file to dropbox.

It includes

from dropbox import client, rest, session
i

when I run the save_file command from the browser the majority of the time 
it works fine and does what it is supposed to do. But about 1 in 3 times it 
comes up with a ticket

File "/opt/web-apps/web2py/applications/new_spin2/controllers/default.py" 
, 
line 591, in save_sqlite
from dropbox import client, rest, session
  File "/opt/web-apps/web2py/gluon/custom_import.py", line 86, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
ImportError: No module named dropbox


I can just sit there and get the same page to reload and arbitrarily it will 
work or fail.

If I log on to the system with ssh, and run the same version of python and 
import dropbox it always imports fine, so it is only occasionally failing to 
import dropbox under web2py.

Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
(Running on Unknown, Python 2.6.8)

running on centos 5

any ideas?

Thanks

Peter


-- 
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/groups/opt_out.


[web2py] Re: How to display the value of a reference field, instead of the id in sqlform.grid part 2

2013-12-02 Thread Gael Princivalle
Ok, I've found how doing it.

I've made this change in my fields:
fields = (db.enquiries.enquiry_date, db.products.code, db.enquiries.note)

Il giorno lunedì 2 dicembre 2013 16:17:37 UTC+1, Gael Princivalle ha 
scritto:
>
> Hi.
>
> Sorry about that, but I'm gone ask for something already asked before, 
> displaying the reference field in the grid instead of the id:
>
> https://groups.google.com/forum/#!searchin/web2py/how$20to$20display$20the$20value$20of$20a$20reference$20field$2C$20instead$20of$20the$20id$20in$20sqlform.grid/web2py/obVOrS7tKTs/JYgWXYqV6JEJ
>
> So here is my db:
> db.define_table('products',
> Field('id_01', type='integer', unique=True),
> Field('code', unique=True),
> format='%(code)s')
>
> db.define_table('enquiries',
> Field('user_id'),
> Field('product_id_01', 'reference products', requires = 
> IS_IN_DB(db, db.products.id_01, '%(code)s')),
> Field('quantity', type='integer'))
>
> My controller:
> def enquiries():
> query= db.products.id_01 == db.enquiries.product_id_01
> grid=SQLFORM.grid(query=query)
> return dict(grid=grid)
>
> My view:
> {{extend 'layout.html'}}
> {{=H3(T('Your enquiries'))}}
> {{=grid}}
>
> Like that web2py display enquiries.product_id_01 in grid. How can web2py 
> could display products.code instead of enquiries.product_id_01 in grid ?
>
> 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/groups/opt_out.


[web2py] Re: admin app killed!

2013-12-02 Thread JoeCodeswell
Dear web2py Community,

There were problems for me as well, but now they cleared up. On winXpSp3, I 
had my Firefox-25.0.1 opened while i did an extract into C:\web2py. So then 
[as best as i remember]:

   - I checked to see if the upgrade happened by refreshing the admin page. 
   *result* Version did not change.
   - So i left the browser open. Turned off the server & turned it on 
   again. *result* new welcome page appeared.
   - i clicked on the admin interface button. *result*:
  - ticket appeared  so i clicked on the link *result*:
  - ticket appeared  so i clicked on the link *result*:
  - ticket appeared  
  - i closed all the browser tabs & shut down &  restarted the server 
   *result*:
  - ALL IS WELL ??? It seems OK.
  - ajax in the startup ???
   
The C:\web2py\logs directory is empty.

I hope this adds some light to the subject. 

Love and peace,

Joe

On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
>
> Hi,
>
> I have updated my main system to 2.8.2
> Now when I call  my_server/admin  I get an error ticket.
> But I cannot analyze the error ticket, because it  needs admin and I get 
> another error.
>
> Afterwards I have copied the whole admin-app from the source over 
> my_server/admin - same result.
>
> Any ideas?
> Regards Martin
>
>
>  

-- 
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/groups/opt_out.


[web2py] How to display the value of a reference field, instead of the id in sqlform.grid part 2

2013-12-02 Thread Gael Princivalle
Hi.

Sorry about that, but I'm gone ask for something already asked before, 
displaying the reference field in the grid instead of the id:
https://groups.google.com/forum/#!searchin/web2py/how$20to$20display$20the$20value$20of$20a$20reference$20field$2C$20instead$20of$20the$20id$20in$20sqlform.grid/web2py/obVOrS7tKTs/JYgWXYqV6JEJ

So here is my db:
db.define_table('products',
Field('id_01', type='integer', unique=True),
Field('code', unique=True),
format='%(code)s')

db.define_table('enquiries',
Field('user_id'),
Field('product_id_01', 'reference products', requires = 
IS_IN_DB(db, db.products.id_01, '%(code)s')),
Field('quantity', type='integer'))

My controller:
def enquiries():
query= db.products.id_01 == db.enquiries.product_id_01
grid=SQLFORM.grid(query=query)
return dict(grid=grid)

My view:
{{extend 'layout.html'}}
{{=H3(T('Your enquiries'))}}
{{=grid}}

Like that web2py display enquiries.product_id_01 in grid. How can web2py 
could display products.code instead of enquiries.product_id_01 in grid ?

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/groups/opt_out.


Re: [web2py] admin app killed!

2013-12-02 Thread Jonathan Lundell
On 2 Dec 2013, at 5:20 AM, Martin Weissenboeck  wrote:

> I have updated my main system to 2.8.2
> Now when I call  my_server/admin  I get an error ticket.
> But I cannot analyze the error ticket, because it  needs admin and I get 
> another error.
> 
> Afterwards I have copied the whole admin-app from the source over 
> my_server/admin - same result.

Try getting the ticket directly from web2py/applications/admin/errors. You'll 
see the exception message and stack trace at the top & bottom of the file, 
mixed with other stuff. 

Side note: didn't we long ago talk about a standalone ticket parser, or 
something to that effect? It'd be useful to have something like that in 
scripts/ for use when the installation isn't working well enough to show 
tickets itself.

-- 
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/groups/opt_out.


[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-02 Thread Yassen D.
Massimo, thanks a lot for your help!

I will upgrade right away then. (I have very limited time, so I was afraid 
to break things.)

My comments:

(a) We need to get the import process run instantly on user UI action (link 
click). Couple of seconds later is okay, but half a minute later is not 
okay.

(b) We may have several users doing that at the same time, thus n such 
tasks need to be able to run in parallel.

Will the scheduler allow me to implement an acceptable solution?

Thanks!
YD


On Monday, December 2, 2013 9:41:40 AM UTC+2, Massimo Di Pierro wrote:
>
> The first recommendation would be upgrade to 2.8.2 (nothing should break) 
> and use the scheduler.
>
> Do not use threads because they may still be killed by the web server.
> You can run a simple background process that every minute checks if there 
> is something to do. Then use an auxiliary table to queue the fb credentials 
> of those users that need to be processed.
>
>

-- 
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/groups/opt_out.


[web2py] Re: SQLFORM.grid builds create/edit pages for wrong table

2013-12-02 Thread Jim S
Perfect.  Thanks, don't know how I missed that one.

-Jim

On Friday, November 29, 2013 1:20:13 PM UTC-6, Niphlod wrote:
>
> use the field_id argument
>
> On Friday, November 29, 2013 8:12:53 PM UTC+1, Jim S wrote:
>>
>> I have the following code:
>>
>> #  Build query
>> queries = []
>> if searchText and searchText.strip() != '':
>> queries.append((db.auth_group.role.contains(searchText)) |
>>(db.auth_user.firstLast.contains(searchText)) |
>>(db.auth_user.lastFirst.contains(searchText)))
>>
>>
>> queries.append(db.auth_membership.id > 0)
>> query = reduce(lambda a, b: (a & b), queries)
>>
>>
>> orderby = [db.auth_group.role]
>>
>>
>> left = [db.auth_group.on(db.auth_membership.group_id == db.auth_group
>> .id),
>> db.auth_user.on(db.auth_membership.user_id == db.auth_user.id
>> )]
>>
>>
>> db.auth_membership.id.readable = False
>>
>>
>> grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
>> create=create, details=details, left=left,
>> editable=editable, deletable=deletable,
>> csv=False, search_widget=defaultSearch,
>> paginate=15, maxtextlength=45)
>>
>>
>>
>> If my searchText has a value and I filter the query by that value, when I 
>> add a record or edit a record using the grid, it add/edits the auth_user 
>> table instead of auth_membership like I want it to.  If I don't have a 
>> value in searchText, then it add/edits the auth_membership table as 
>> expected.
>>
>> Any pointers on how to get it to add/edit the auth_membership table all 
>> the time?
>>
>> -Jim
>>
>>

-- 
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/groups/opt_out.


Re: [web2py] Testing local site on other machine

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 04:46:51 -0800 (PST)
Ruud Schroen  escribió:

> Hi,
> 
> I'm running web2py on my laptop with Ubuntu and i'd like to test my 
> websites in IE.
> So i'd like to test my local web2py website my desktop, which is a
> Windows machine.
> 
> How do i achieve this?
> 
> Thanks in advance.
> 

set 0.0.0.0 ip to web2py and you can browse web2py server in you lan ip
port 8000, or you can change port too...

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 04:11:05 -0800 (PST)
lucas  escribió:

> 
> 
> > have you changed permissions to web2py folder?, in centos user and 
> > group should be apache, unless you have a modified setup: 
> >
> > chown -R apache:apache web2py/ 
> >
> 
> good thought but no, it didn't do the trick.  damn, almost.
> 
> hey massimo, what could have changed between 2.4 and 2.8, probably 
> specifically in mod_wsgi.so? 
> 
> lucas
> 

Have you read apache logs?, this line:

WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py

Have in mind that wsgihandler.py is in web2py/handlers in latest
versions of web2py... you might, also, have to fix permissions for this
file to rwxr-xr-x

-- 
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/groups/opt_out.


[web2py] admin app killed!

2013-12-02 Thread Martin Weissenboeck
Hi,

I have updated my main system to 2.8.2
Now when I call  my_server/admin  I get an error ticket.
But I cannot analyze the error ticket, because it  needs admin and I get
another error.

Afterwards I have copied the whole admin-app from the source over
my_server/admin - same result.

Any ideas?
Regards Martin

-- 
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/groups/opt_out.


[web2py] Testing local site on other machine

2013-12-02 Thread Ruud Schroen
Hi,

I'm running web2py on my laptop with Ubuntu and i'd like to test my 
websites in IE.
So i'd like to test my local web2py website my desktop, which is a Windows 
machine.

How do i achieve this?

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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread lucas


> have you changed permissions to web2py folder?, in centos user and 
> group should be apache, unless you have a modified setup: 
>
> chown -R apache:apache web2py/ 
>

good thought but no, it didn't do the trick.  damn, almost.

hey massimo, what could have changed between 2.4 and 2.8, probably 
specifically in mod_wsgi.so? 

lucas

-- 
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/groups/opt_out.