[web2py] Re: jquery ajax post vars not accessible

2014-09-30 Thread seank
Well this is embarrassing. Issue wasn't the ajax or web2py, it was a typo 
in controller.

For future reference,
The reason why web2py error came up as above (None post vars) was that I 
was double clicking on the failed network request in the chrome devtool and 
it was opening controller/upload_file, which obviously will not get any 
vars.

Everything's good now.

-- 
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] jquery ajax post vars not accessible

2014-09-30 Thread seank
I'm getting a strange behavior with ajax call. I can print the 
request.post_vars andd see they are there but when I try to access them, 
they are None.
And it was working fine until I added extra data into FormData. I've 
removed the new data (back to when it was working) but it doesn't work 
anymore.
This isn't the first time I ran into this. Seems to happen when I add new 
data varas to the already working ajax calls. They usually go away when I 
revert back.

[view]

function uploader(event) {
var form_data = new FormData();
var file = event.target.files[0];
form_data.append('uploading', file, file.name);
   
//form_data.append('category', 'summary'); /* this is the new bit added 
that started causing problem - removed but no change */

$.ajax({
url: '{{=URL("upload_file")}}',
type: 'POST',
data: form_data,
cache: false,
processData: false,
contentType: false,
}).done(function(data) {/* do stuff */});
}


[controller]

def upload_file():
print 'vars', request.post_vars  # shows vars passed properly

# error here  'NoneType' object has 
no attribute 'file'
upload_file = request.post_vars.uploading.file  


-- 
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: EditArea not working in 2.3.2

2013-01-30 Thread seank
I should've deleted the previous one..

Anyways, the issue is I use the online editor often and the current default 
editor (codemirror) seems too buggy:
constantly jumping back to the top, can't disable syntax highlight, wrap 
lines, etc..

It's fine if EditArea is not supported anymore. Ace will do. Thanks.

On Wednesday, January 30, 2013 2:56:57 PM UTC-5, seank wrote:
>
> deleted double post
>
> On Wednesday, January 30, 2013 1:56:50 PM UTC-5, Massimo Di Pierro wrote:
>>
>> We do not support editarea any more in admin. What are you trying to do?
>>
>> On Wednesday, January 30, 2013 10:51:45 AM UTC-6, seank wrote:
>>>
>>> Just installed 2.3.2, added EditArea. When I go to edit files, it gives 
>>> me this error:
>>>
>>> Uncaught ReferenceError: area is undefined
>>> // default/edit.html 228
>>> window.textarea = area.textarea;
>>>
>>> So it seems ajax_editor's getData() fails to get the data from the 
>>> editor and save will replace the file content with the word 'undefined'.
>>>
>>

-- 

--- 
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: EditArea not working in 2.3.2

2013-01-30 Thread seank
deleted double post

On Wednesday, January 30, 2013 1:56:50 PM UTC-5, Massimo Di Pierro wrote:
>
> We do not support editarea any more in admin. What are you trying to do?
>
> On Wednesday, January 30, 2013 10:51:45 AM UTC-6, seank wrote:
>>
>> Just installed 2.3.2, added EditArea. When I go to edit files, it gives 
>> me this error:
>>
>> Uncaught ReferenceError: area is undefined
>> // default/edit.html 228
>> window.textarea = area.textarea;
>>
>> So it seems ajax_editor's getData() fails to get the data from the editor 
>> and save will replace the file content with the word 'undefined'.
>>
>

-- 

--- 
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] EditArea not working in 2.3.2

2013-01-30 Thread seank
Just installed 2.3.2, added EditArea. When I go to edit files, it gives me 
this error:

Uncaught ReferenceError: area is undefined
// default/edit.html 228
window.textarea = area.textarea;

So it seems ajax_editor's getData() fails to get the data from the editor 
and save will replace the file content with the word 'undefined'.

-- 

--- 
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] EditArea error web2py 2.3.2

2013-01-30 Thread seank
Just installed 2.3.2, added EditArea. Going into edit mode gives the 
following error:

Uncaught ReferenceError: area is undefined
window.textarea = area.textarea; // admin/default/edit.html

Hitting save will replace file content with 'undefined'. So, ajax_editor.js 
is not getting the editor data.

-- 

--- 
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.