Re: [web2py] Re: crud edit

2014-11-14 Thread Alex Glaros
thanks Richard 1. will update CRUD later but need to finish project now; sqlFORM raises errors I can't solve for this one function. 2. can you please tell me how to get these two vars from grandparent to persist so that child can return to parent? vars=dict(filter=db.SuperObjectComment.superO

[web2py] Constructing a query which references multiple tables, and passing that query to SQLFORM.grid()

2014-11-14 Thread Spokes
I have a two tables, one of which references the other. I would like to create a complex query involving those two tables, and pass this query to an SQLFORM.grid() to view entries in the first table. Basically, I'd like the grid to show table1 entries which meet some preliminary set of conditi

Re: [web2py] Re: crud edit

2014-11-14 Thread Richard Vézina
Alex, Massimo has wrote on this list in the pass that he don't want to maintain CRUD in the future. He didn't says when the support for could end though. Since SQLFORM is almost as easy then crud and more flexible, I suggest you to not start using CRUD if you write new code... auth.has_permission

[web2py] Re: Convert MongoDB / dict into a DAL Row

2014-11-14 Thread Leonel Câmara
Why are you talking to mongodb directly? This completely ruins the purpose of using a DAL. What's happening here is that when you do: print(Row(user)) Row.__str__ is called which in turn calls Row.as_dict, well Row.as_dict does not know how to serialize ObjectId so it just ignores it. One t

[web2py] Re: web2py deployment: Apache, Nginx and Plesk Panel

2014-11-14 Thread LightDot
Er... why would you run a VPS deployment script on a server with a working control panel..? I hope you have backups :/ If 1) is still your goal, the best thing you could do now is to try and revert everything the deployment script broke, then rethink your approach. I'd advise you to follow Ples

Re: [web2py] Convert MongoDB / dict into a DAL Row

2014-11-14 Thread António Ramos
Never used mongo but what happens if you assign row.gender to a var ? 2014-11-14 16:55 GMT+00:00 Francisco Costa : > Hi, > > I'm unable to fully convert a dict into a Row(), specially if there is a > foreign key (ObjectId) > > I have the following code (I've commented the prints): > > db = DAL(

[web2py] Convert MongoDB / dict into a DAL Row

2014-11-14 Thread Francisco Costa
Hi, I'm unable to fully convert a dict into a Row(), specially if there is a foreign key (ObjectId) I have the following code (I've commented the prints): db = DAL( 'mongodb://localhost/%s' % request.application, pool_size=10, adapter_args={'safe': False}, check_reserved=['all']

[web2py] Re: Grid links in component do not open in new window properly

2014-11-14 Thread Jim Karsten
I think I can make this work. Thanks for your help Anthony and Leonel. Jim On Thursday, November 13, 2014 9:33:04 AM UTC-5, Anthony wrote: > > A simpler option might be to check whether the request is being made via > Ajax, and conditionally change the view: > > def inner(): > response.view

[web2py] Re: Sending email from server

2014-11-14 Thread Niphlod
so the problem is that your server can't reach the smtp server. not a web2py issue. On Friday, November 14, 2014 11:39:28 AM UTC+1, Yang wrote: > > > On Friday, November 14, 2014 12:37:19 AM UTC+1, Niphlod wrote: >> >> well, to be nerdy. >> >> import telnetlib >> tn = telnetlib.Telnet(hostnam

Re: [web2py] Re: upload a file with just a post request

2014-11-14 Thread António Ramos
response.headers['Content-Disposition'] = 'attachment' !! 2014-11-14 13:50 GMT+00:00 António Ramos : > like i did the mp3 is played in the webpage. > > I want the browser to "download" it > > Is there a trick in the code ? > > Thank you > > 2014-11-14 12:56 GMT+00:00 António Ramos : > >> row

Re: [web2py] Re: upload a file with just a post request

2014-11-14 Thread António Ramos
like i did the mp3 is played in the webpage. I want the browser to "download" it Is there a trick in the code ? Thank you 2014-11-14 12:56 GMT+00:00 António Ramos : > row=db(db.mp3s.keyflag==request.args[0]).select().first() > > filename=os.path.join(request.env.web2py_path,"applications",

Re: [web2py] Re: upload a file with just a post request

2014-11-14 Thread António Ramos
row=db(db.mp3s.keyflag==request.args[0]).select().first() filename=os.path.join(request.env.web2py_path,"applications",request.application,"uploads",row['mp3']) response.headers['Content-Type']='audio/mpeg' return open(filename,'rb') It works :) thank you 2014-11-14 12:38 GMT+00:00

Re: [web2py] Re: upload a file with just a post request

2014-11-14 Thread António Ramos
but how do i code a controller that accepts the name or other field and returns the mp3 saved ? 2014-11-14 12:31 GMT+00:00 Leonel Câmara : > Well if you coded it like that you saved the original filename in the name > field, the cloudservice can just use that. > > -- > Resources: > - http://we

[web2py] Re: upload a file with just a post request

2014-11-14 Thread Leonel Câmara
Well if you coded it like that you saved the original filename in the name field, the cloudservice can just use that. -- 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

Re: [web2py] Re: upload a file with just a post request

2014-11-14 Thread António Ramos
another thing i dont know how to do. i have my db.myfile.insert(name=request.post_vars.filename.filename, cloudfile=db.myfile.cloudfile. store(request.post_vars.filename),key=timestamp) i added also a timestamp param in the insert to later get it from the cloud service How to i code the retriev

Re: [web2py] Re: a proposal for form improvement

2014-11-14 Thread António Ramos
Just checking the status of Jform. Any news on it? Regards António 2014-09-10 2:02 GMT+01:00 Massimo Di Pierro : > I agree. I have not implemented but I was planning to add this feature. > > On Tuesday, 9 September 2014 03:44:30 UTC-5, Leonel Câmara wrote: >> >> This is the corresponding JS one

Re: [web2py] Re: import app from one web2py server to another

2014-11-14 Thread Michele Comitini
try removing all the .pyc around. maybe the python version is different on the two machines 2014-11-13 22:50 GMT+01:00 Cliff Kachinske : > Is there a modules/__init__.py ? > > > On Monday, November 10, 2014 2:44:44 PM UTC-5, John Davis wrote: >> >> Hello >> >> I have an app written by someone wh

[web2py] Re: web2py deployment: Apache, Nginx and Plesk Panel

2014-11-14 Thread lesssugar
@LightDot, thanks for your reply. I agree that the first, clean option is the way to go. So, I am trying to make web2py work on Apache, keeping access to Plesk. I will try to make this post up to date, in case anyone has similar issues. First problems that have occurred: 1) After using the dep

[web2py] Re: Sending email from server

2014-11-14 Thread Yang
On Friday, November 14, 2014 12:37:19 AM UTC+1, Niphlod wrote: > > well, to be nerdy. > > import telnetlib > tn = telnetlib.Telnet(hostname, 25, 10) > > > or (even better ?!) > > import socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.settimeout(2) > try: > s.connect(

[web2py] Re: crud edit

2014-11-14 Thread Alex Glaros
ok, the below now works, except for the part where it returns to parent controller (highlighted yellow). Seems like there needs to be a way for the child controller to remember the grandparent vars. CHILD CONTROLLER - after form is filled, wants to redirect to parent controller with the correc