Re: [web2py] Re: Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Andriy
Ok, this is really strange. I changed line 68 (69 after Ricardo`s code 
addition) in *streamer.py* from:
*headers.setdefault('Content-Type', contenttype(static_file))*
to
*headers.setdefault('Content-Type', 'text/css')*

And problem gone! .css file have *text/css *headers, all other files have 
their respective headers. I understand this is a hack, but does this mean 
that problem is with web2py?

But more than that. I reverted *streamer.py *to original default code, 
restarted Apache (many times already) and still problem gone! So now I 
don`t even know is that my *headers.setdefault('Content-Type', 'text/css') 
*line 
that triggered it or what.. And why its persistent if I reverted to default 
*streamer.py *file...

-- 

--- 
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: Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Andriy
Web2py version is 2.4.6.

I did change in stream_file_or_304_or_206 that you proposed, it did not fix 
the problem.

If my static files are served by web2py, then I understand its wrong for 
production? Its better to serve them by Apache directly. But how to do 
this, I`m confused. I thought block **in 
httpd.conf was responsible for that. Or I must turn of web2py static 
file serving somehow?

I forgot to tell this, I think this is important details:* *I get only *
Content-Type* corrupted headers and only with* .css* files. So far I have 
not seen other files or headers corrupted.

-- 

--- 
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 not working

2013-05-17 Thread Monte Milanuk
I'm getting a very similar error when starting web2py from the CLI in 
Xubuntu 13.04:

monte@machin-shin:~/web2py$ python web2py.py 
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.4.6-stable+timestamp.2013.04.06.17.37.38
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), IMAP(imaplib)
please visit:
http://127.0.0.1:8000/
starting browser...

(process:20509): GLib-CRITICAL **: g_slice_set_config: assertion 
`sys_page_size == 0' failed


web2py appears to start and run normally, with no noticeable problems.

-- 

--- 
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.com Internal error

2013-05-17 Thread weheh
Yah, I saw it, too, but then it went away. I recommend trying again.

On Saturday, May 18, 2013 9:49:04 AM UTC+8, samuel bonilla wrote:
>
> http://www.web2py.com/ in the website
>
> Internal errorTicket issued: 
> unknown

-- 

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




[web2py] web2py.com Internal error

2013-05-17 Thread samuel bonilla
http://www.web2py.com/ in the website

Internal errorTicket issued: 
unknown

-- 

--- 
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: hi any webchat web2py apps?

2013-05-17 Thread samuel bonilla
no really i use node.js with www.balloons.io , but if u wanna, u can 
use tornado or twisted

El viernes, 17 de mayo de 2013 00:15:29 UTC-5, Mika Sjöman escribió:
>
> Hi
>
> We wish to add a button on our frontpage that will enable users to contact 
> us via a webchat, something like this> http://mibew.org/demo.php
>
> But we do not want a PHP solution, do you know of any web2py solution?
>
> cheers
>

-- 

--- 
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] Can't get gmaps plugin to work

2013-05-17 Thread Ricardo Pedroso
On Fri, May 17, 2013 at 3:32 PM, Marko Poutiainen wrote:

> I can't seem to get the gmaps plugin to work.
>
>
> The page is https://www2.olka.fi/kiinnostuneet/default/kartta  where you
> can also see from the source what my view is like.
>

Try  http://www2.olka.fi/kiinnostuneet/default/kartta.
Probably it will work in chrome.

Accessing your site through https chromes complains:

[blocked] The page at https://www2.olka.fi/kiinnostuneet/default/kartta ran
insecure content from
http://maps.google.com/maps?file=api&v=2&key=AIzaSyBh_gz9dEsfya4uaCRyNiG0L0rVYbysjqU.
kartta:1 

   1. Uncaught ReferenceError: GBrowserIsCompatible is not defined
kartta:81


if accessing your site with https you should call google api through https
also.

-- 

--- 
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: Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Ricardo Pedroso
On Fri, May 17, 2013 at 7:23 PM, Andriy  wrote:
> I use Python 2.7.3
>
> The problem manifests in all browsers. In FF its really rare. In Opera
with
> "Max Connections To Server" > 2 its almost every time you load a page. In
> Opera with "Max Connections To Server" < 2 its 1 in 30-50 hits, or every
> time if you reload a page with CTRL+F5. In Chrome its similar to Opera if
> you press CTRL+F5.
>
> Site crashed with another problem right now. I hope I will get it running
in
> an hour. You can open it by yourself if you want. Its www.autosim.ru
>
> I think that all static files are served by Apache. But I`m not sure.

No, they are being served by web2py.
What is your web2py version?

This seems like a threads race problem.

Can you open gluon/streamer.py and search for:

def stream_file_or_304_or_206(
static_file,
chunk_size=DEFAULT_CHUNK_SIZE,
request=None,
headers={},
status=200,
error_message=None
):
()

and change to:

def stream_file_or_304_or_206(
static_file,
chunk_size=DEFAULT_CHUNK_SIZE,
request=None,
headers=None,
status=200,
error_message=None
):
headers = headers or {}
()

and then test it to see if it fix the problem.
Even if it does not fixed this change should be applied.

Ricardo

-- 

--- 
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: Stream audio files

2013-05-17 Thread Anthony
OK, now I see -- in your version, the content type was wrong for both .ogg 
and .oga. These were all corrected in trunk about a month ago. Note, 
technically, I believe .ogg should be 'application/ogg', and .oga should be 
'audio/ogg'. In the former case, the browser should figure out whether it 
is audio or video.

Anthony

On Friday, May 17, 2013 1:53:45 PM UTC-4, Zaka Elab wrote:
>
> I finally found the solution. I read this post 
> https://groups.google.com/d/topic/web2py/VxQhildrQew/discussion where I 
> got the idea to change the mime type in gluon/contenttype.py
>
> I replaced this '.ogg': 'video/x-theora+ogg' by '.ogg': 'audio/ogg',
>
> I'm using web2py Version 2.4.5-stable+timestamp.2013.03.18.22.46.22, and 
> maybe this problem is solved in 2.4.6
>
> I forgot to let my web2py version in prior comments, I'm sorry for that, 
> it could have been helpful.
>
> I hope this can help other people.
>
> Thanks for your help.
>
> Best.

-- 

--- 
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: GET and POST issue

2013-05-17 Thread Anthony
Assuming you don't want the whole page to reload on form submission, you 
should do an Ajax post. In that case, you might consider loading the form 
as an Ajax component. Otherwise, you'll have to explicitly set the action 
of the form to the URL where you want it to post. By default, the action is 
simply set to "#", which means it will post to the URL of the current page 
-- if you want it to post elsewhere, you have to specify the URL where it 
should post.

Anthony

On Friday, May 17, 2013 2:21:38 PM UTC-4, Annet wrote:
>
> Hi Derek,
>
> Thanks for you reply. 
>
> The key is, you want to submit via ajax, and make sure you do a 'return 
>> false'. If there is an error in your javascript, you may see the post 
>> getting sent to the current url or the action setting of the form.
>>
>
> At the moment I have a SQLFORM.factory() form which I return to the view 
> in a dict. So there's no JavaScript involved yet, is there? What do I have 
> to do to submit that form via ajax? Could you provide me with an example?
>
>
> Regards,
>
> Annet
>

-- 

--- 
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: GET and POST issue

2013-05-17 Thread Derek
Take a look here...

http://www.web2py.com/book/default/chapter/11#Ajax-form-submission


On Friday, May 17, 2013 11:21:38 AM UTC-7, Annet wrote:
>
> Hi Derek,
>
> Thanks for you reply. 
>
> The key is, you want to submit via ajax, and make sure you do a 'return 
>> false'. If there is an error in your javascript, you may see the post 
>> getting sent to the current url or the action setting of the form.
>>
>
> At the moment I have a SQLFORM.factory() form which I return to the view 
> in a dict. So there's no JavaScript involved yet, is there? What do I have 
> to do to submit that form via ajax? Could you provide me with an example?
>
>
> Regards,
>
> Annet
>

-- 

--- 
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: Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Andriy
I use Python 2.7.3

The problem manifests in all browsers. In FF its really rare. In Opera with 
"Max Connections To Server" > 2 its almost every time you load a page. In 
Opera with "Max Connections To Server" < 2 its 1 in 30-50 hits, or every 
time if you reload a page with CTRL+F5. In Chrome its similar to Opera if 
you press CTRL+F5.

Site crashed with another problem right now. I hope I will get it running 
in an hour. You can open it by yourself if you want. Its www.autosim.ru

I think that all static files are served by Apache. But I`m not sure.

Here is part of my httpd.conf:
*NameVirtualHost *:80

DocumentRoot "d:/web2py/applications"
ServerName autosim.ru

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.autosim\.ru [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.autosim.ru/$1 [L,R,NE]


AllowOverride None
Order allow,deny
Deny from all



Order deny,allow
Allow from all



Order Allow,Deny
Allow from all


WSGIScriptAlias / "d:/web2py/wsgihandler.py"

*

Here is my routes.py:
*routers = dict(
BASE = dict(
default_application = 'mad'
)
)

routes_onerror = [('*/404', '/mad/default/error_404')]*

-- 

--- 
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: GET and POST issue

2013-05-17 Thread Annet
Hi Derek,

Thanks for you reply. 

The key is, you want to submit via ajax, and make sure you do a 'return 
> false'. If there is an error in your javascript, you may see the post 
> getting sent to the current url or the action setting of the form.
>

At the moment I have a SQLFORM.factory() form which I return to the view in 
a dict. So there's no JavaScript involved yet, is there? What do I have to 
do to submit that form via ajax? Could you provide me with an example?


Regards,

Annet

-- 

--- 
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: GET and POST issue

2013-05-17 Thread Derek
Should be fine to have the form in a modal window. I do it on a lot of 
websites.
The key is, you want to submit via ajax, and make sure you do a 'return 
false'. If there is an error in your javascript, you may see the post 
getting sent to the current url or the action setting of the form.

On Friday, May 17, 2013 10:38:16 AM UTC-7, Annet wrote:
>
> Hi Anthony,
>
> My mistake :-(
>
> The problem is that the form is posted to 
> http://127.0.0.1:8000/init/vcard/index/6  and not to 
> http://127.0.0.1:8000/init/vcard/mailVcard/6
> so the index function instead of the mailVcard function and therefore the 
> form isn't being validated and processed.
>
> Maybe it isn't a good idea to have a form in a modal window.
>
> Best regards,
>
> Annet
>

-- 

--- 
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: Stream audio files

2013-05-17 Thread Zaka Elab
I finally found the solution. I read this post 
https://groups.google.com/d/topic/web2py/VxQhildrQew/discussion where I got 
the idea to change the mime type in gluon/contenttype.py

I replaced this '.ogg': 'video/x-theora+ogg' by '.ogg': 'audio/ogg',

I'm using web2py Version 2.4.5-stable+timestamp.2013.03.18.22.46.22, and 
maybe this problem is solved in 2.4.6

I forgot to let my web2py version in prior comments, I'm sorry for that, it 
could have been helpful.

I hope this can help other people.

Thanks for your help.

Best.

-- 

--- 
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: GET and POST issue

2013-05-17 Thread Annet
Hi Anthony,

My mistake :-(

The problem is that the form is posted to 
http://127.0.0.1:8000/init/vcard/index/6  and not to 
http://127.0.0.1:8000/init/vcard/mailVcard/6
so the index function instead of the mailVcard function and therefore the 
form isn't being validated and processed.

Maybe it isn't a good idea to have a form in a modal window.

Best regards,

Annet

-- 

--- 
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: Stream audio files

2013-05-17 Thread Zaka Elab

Same result so far.

On Friday, 17 May 2013 18:56:34 UTC+2, Anthony wrote:
>
> What happens if you change the file extension to .oga?
>
> On Friday, May 17, 2013 10:58:07 AM UTC-4, Zaka Elab wrote:
>>
>> Thanks for your answer,
>>
>> As you can see in:
>> > controls="controls" type="audio/ogg">
>> Your browser does not support the audio element.
>> 
>> the URL content is not the problem. In that case, I would be able to 
>> listen at least one time the audio tag.
>>
>> Nevermind, I corrected the bad once and I still having troubles. I 
>> decided to install Chormium in order to isolate the problem. I realized 
>> that Chromium plays the files without problems, while Firefox only plays 
>> the files with simple htmls examples like this one:
>> 
>> 
>> 
>> Hello World 
>> 
>>   
>>   Your browser does not support the audio element.
>> 
>>
>> 
>> 
>>
>> I'm very confused. Maybe the problem is the combination between FF and 
>> web2py, thought I don't see where could the problem be.
>>
>> Do web2py modify a file before sending it to the client?
>>
>> I have uploaded audio2.ogg file to videobin.org. With the url given FF 
>> can also play the file, but no luck with URL from web2py.
>>
>> 
>> 
>> 
>> Stream ogg audio file: 
>>
>> > autoplay="" src="{{=URL('static','audio2.ogg')}}" tabindex="0">
>>
>> > autoplay="" src="http://videobin.org/+6lp/7r1.ogg"; tabindex="0">
>> 
>> 
>>
>> I hope that you can guide me in order to solve the problem. 
>>
>> Here I give some info. that could be helpful:
>>
>> OS: Ubuntu 12.10 Linux Kernel 3.5.0-27-generic
>> Browsers:
>>   FF 20.0 
>>   FF Nightly Build 23.0a1
>>   Chromium Version 25.0.1364.160 Ubuntu 12.10 
>> (25.0.1364.160-0ubuntu0.12.10.1)
>>
>> Thanks
>
>

-- 

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




[web2py] Re: Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Massimo Di Pierro
This is really bad. It looks like a buffer overflow error to me (in apache 
or in python). Which version of python do you use? Do you get the problem 
only from Opera? How are these CSS served? As static files? Is Apache 
serving directly or via web2py?

On Friday, 17 May 2013 09:06:33 UTC-5, Andriy wrote:
>
> I had this problem for a while, but since I was in development stage, I`ve 
> not paid much attention.
>
> I use Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 
>
> For some reason in some requests Content-Type Response header for .css 
> returns not with "text/css", but with random strings. So browser does not 
> run this css file, and page layout is ruined.
>
> This happens almost every time I reload page with CTRL+F5 in Opera or 
> Chrome. My index page has 12 css files and 1-4 files return with corrupt 
> headers such as:
> - /mad/static/css/mad.css - which is just link to one of css files in 
> directory
> - mad/static/css/web2py.css - another
> - text/plain - simply wrong for .css
> - d:/web2py/applications - path to web2py dir?
>
> Strangely, if I start to send requests from Opera-Dragonfly to one of my 
> .css files (for ex. www.autosim.ru/static/css/mad.css), clicking "Send 
> request" many times, then in 1 in 50 requests I have strings like these in 
> Content-Type header:
> - forum_attachments_sequence - something from source code?
> - too small or too large! - thats just from some validator
> - forum_topics.author_id - name of a Field from one of my db tables!
> - /user/not_authorized 
> - ø   À±´ 
> etc.
>
> In Apache httpd file mime_module is enabled with "TypesConfig 
> conf/mime.types", so I guess Content-Type header should be forced, but it 
> is clearly not...
>
> Could someone suggest something. I do not know even where to look. Is it 
> web2py or is it apache problem?
>
>
> 
>
>
> 
> I`m adding some screenshots:
>

-- 

--- 
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] master master module location

2013-05-17 Thread lucas
hello,

i have a module that has many common functions that i wrote.  most of my 
web2py applications access it for one thing or another and i also use it 
for linux scripting because i prefer python scripting over bash.

anyway, under a common linux filesystem, centos specifically, what is the 
best location and owner:group for the .py file for all such master master 
modules?  keeping in mind the .pyc file that is created also.

thanx in advance.  lucas

-- 

--- 
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: Stream audio files

2013-05-17 Thread Anthony
What happens if you change the file extension to .oga?

On Friday, May 17, 2013 10:58:07 AM UTC-4, Zaka Elab wrote:
>
> Thanks for your answer,
>
> As you can see in:
>  controls="controls" type="audio/ogg">
> Your browser does not support the audio element.
> 
> the URL content is not the problem. In that case, I would be able to 
> listen at least one time the audio tag.
>
> Nevermind, I corrected the bad once and I still having troubles. I decided 
> to install Chormium in order to isolate the problem. I realized that 
> Chromium plays the files without problems, while Firefox only plays the 
> files with simple htmls examples like this one:
> 
> 
> 
> Hello World 
> 
>   
>   Your browser does not support the audio element.
> 
>
> 
> 
>
> I'm very confused. Maybe the problem is the combination between FF and 
> web2py, thought I don't see where could the problem be.
>
> Do web2py modify a file before sending it to the client?
>
> I have uploaded audio2.ogg file to videobin.org. With the url given FF 
> can also play the file, but no luck with URL from web2py.
>
> 
> 
> 
> Stream ogg audio file: 
>
>  autoplay="" src="{{=URL('static','audio2.ogg')}}" tabindex="0">
>
>  autoplay="" src="http://videobin.org/+6lp/7r1.ogg"; tabindex="0">
> 
> 
>
> I hope that you can guide me in order to solve the problem. 
>
> Here I give some info. that could be helpful:
>
> OS: Ubuntu 12.10 Linux Kernel 3.5.0-27-generic
> Browsers:
>   FF 20.0 
>   FF Nightly Build 23.0a1
>   Chromium Version 25.0.1364.160 Ubuntu 12.10 
> (25.0.1364.160-0ubuntu0.12.10.1)
>
> Thanks

-- 

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




[web2py] Re: GET and POST issue

2013-05-17 Thread Anthony
What's the problem with the post? The # isn't sent to the server.

On Friday, May 17, 2013 11:16:56 AM UTC-4, Annet wrote:
>
>
> I have this url:
>
> http://127.0.0.1:8000/init/vcard/index/6
>
> In the view I have a link:
>
>  data-target="#vCardModal" >Attach to mail
>
> When I click the link, Firebug shows me GET 6 
> http://127.0.0.1:8000/init/vcard/mailVcard/6 and in the Request Headers
> referer http://127.0.0.1:8000/init/vcard/index/6 and the form opens in a 
> Bootstrap modal window.
>
> When I submit the form it isn't being validated or processed, Firebug 
> shows me POST 6# http://127.0.0.1:8000/init/vcard/mailVcard/6#
> whereas POST should refer to http://127.0.0.1:8000/init/vcard/mailVcard/6
>
> Is there a way to fix this?
>
> Kind regards,
>
> Annet
>

-- 

--- 
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: behaviour of user_signature in URL

2013-05-17 Thread Anthony
Well, the grid defaults to requiring a user_signature itself, unless the 
requested URL is the same as the base URL for the grid. In this case, you 
are adding your own arg to the base URL but not telling the grid about it. 
Maybe try:

SQLFORM.grid(..., args=[request.args(0)])

In any case, I don't see why this would be different on the two platforms, 
unless maybe you're logged in in one case and not the other.

Anthony

On Friday, May 17, 2013 7:55:27 AM UTC-4, Ramos wrote:
>
> this is my code
>
> *controller*
> def empresa():  
> query= 0 if not request.args(0) else request.args(0)
> mytable = SQLFORM.grid( db.e_docs.f_emp_ref==query , 
> csv=False,  
>etc
> etc
> etc
> *
> *
> *view*
>args=empresa,*user_signature=True*)}}'"
> class="{{=e_error}}" type="button" > 
>   Editar empreiteiro
> 
>
>
> In ubuntu i have to use user_signature_True in the URL , in windows i do 
> not.
>
> The web page where this button is , is called from another page with URL, 
> user_signature=True
>
>
> Is this sufficient info?
> i can put more code...
>
>
>
> 2013/5/17 Anthony >
>
>> Hard to say without seeing any code.
>>
>>
>> On Friday, May 17, 2013 7:24:29 AM UTC-4, Ramos wrote:
>>>
>>> hello
>>> i have my app running in a windows machine.
>>>
>>> I copied it to a ubuntu server and i have a problem with a URL helper in 
>>> my code
>>>
>>> The user goes to a pages via a URL(..., user_signature=True)
>>> in that page he can edit a record via a button 
>>> This button calls a controller function via a URL helper (no 
>>> user_signature this time)
>>>
>>> In windows the button edits the record , in ubuntu i get the error " not 
>>> authorized"
>>>
>>> To have it working in ubuntu i had to add user_signature=True in the 
>>> edit button URL
>>>
>>>
>>> Is this the way it is?
>>>
>>>
>>> Best regards
>>>
>>> António
>>>
>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

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




[web2py] Not a question a thank for all that helped me

2013-05-17 Thread openoc80
Hi all,

I wanted to thank all the persons from this group that helped me to achieve 
my first little web2py's site.

http://openoc.pythonanywhere.com/OpenOc.

It is simple but there is a database (cPickle) of 12247 verbs to conjugate, 
verbs of a language of south of france. it was my first one and I took a 
great pleasure to work with Web2py.

Thanks for all,

Cheers,
Bruno 

-- 

--- 
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] GET and POST issue

2013-05-17 Thread Annet

I have this url:

http://127.0.0.1:8000/init/vcard/index/6

In the view I have a link:

Attach to mail

When I click the link, Firebug shows me GET 6 
http://127.0.0.1:8000/init/vcard/mailVcard/6 and in the Request Headers
referer http://127.0.0.1:8000/init/vcard/index/6 and the form opens in a 
Bootstrap modal window.

When I submit the form it isn't being validated or processed, Firebug shows 
me POST 6# http://127.0.0.1:8000/init/vcard/mailVcard/6#
whereas POST should refer to http://127.0.0.1:8000/init/vcard/mailVcard/6

Is there a way to fix this?

Kind regards,

Annet

-- 

--- 
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: Can't get gmaps plugin to work

2013-05-17 Thread Marko Poutiainen
OK, things have changed.

The map in it's current state doesn't seem to work on Chrome, but it does 
work with IE and Firefox. It didn't work with IE either previously so I 
must have made something to make it work.

I tried this with Chrome both on Ubuntu and Win7.

-- 

--- 
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: Stream audio files

2013-05-17 Thread Zaka Elab
Thanks for your answer,

As you can see in:

Your browser does not support the audio element.

the URL content is not the problem. In that case, I would be able to listen 
at least one time the audio tag.

Nevermind, I corrected the bad once and I still having troubles. I decided 
to install Chormium in order to isolate the problem. I realized that 
Chromium plays the files without problems, while Firefox only plays the 
files with simple htmls examples like this one:



Hello World 

  
  Your browser does not support the audio element.





I'm very confused. Maybe the problem is the combination between FF and 
web2py, thought I don't see where could the problem be.

Do web2py modify a file before sending it to the client?

I have uploaded audio2.ogg file to videobin.org. With the url given FF can 
also play the file, but no luck with URL from web2py.




Stream ogg audio file: 



http://videobin.org/+6lp/7r1.ogg"; tabindex="0">



I hope that you can guide me in order to solve the problem. 

Here I give some info. that could be helpful:

OS: Ubuntu 12.10 Linux Kernel 3.5.0-27-generic
Browsers:
  FF 20.0 
  FF Nightly Build 23.0a1
  Chromium Version 25.0.1364.160 Ubuntu 12.10 
(25.0.1364.160-0ubuntu0.12.10.1)

Thanks 

-- 

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




[web2py] Re: problem creating new controller

2013-05-17 Thread Anthony
Have you tried re-starting the server or reloading routes in the admin 
interface?

On Friday, May 17, 2013 8:57:47 AM UTC-4, Robin Manoli wrote:
>
> Hey,
> I have created a new file, controller.py under controllers, which has an 
> index function that returns a dict.
> I have created a folder under views, named controller/index.html which 
> extends layout.html
>
> Now I thought I should be able to access it under 
> /myapp/controller/index.html, or /myapp/controller/index, but I get the 
> error:
>
> invalid function (default/controller)
>
>
> The only thing I have in routes.py:
>
> routers = dict(
> BASE  = dict(
> domains =
> {
> '127.0.0.1' : 'myapp',
> },
> ),
> )
>
>
> What did I miss? 
>

-- 

--- 
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 limit user votes

2013-05-17 Thread Anthony
You'll have to be a little more specific than "doesn't work." What happens? 
What have you done to diagnose the problem? Does the ajax call get made 
properly? Etc.

#model
> db.define_table('content',
> Field('username'),
> Field('text', 'text'),
> Field('file', 'upload'),
> Field('userpic'),
> Field('time', 'datetime', update=request.now),
> Field('userid', readable=False),
> Field('votesup', 'integer', default=0),
> Field('votesdown', 'integer', default=0),
> Field('votes', 'text', default='0,'),
> )
>

You might instead consider creating a separate table to store the votes 
(with association to the user), but if you want to store the user ID's in a 
single field, you should at least be using the list:integer or 
list:reference field type instead of just a plain text field that you have 
to parse yourself.
 

>
> #controller
> def voteup():
> item = db.content[request.args(0)]
> if auth.user.id not in item.votes:
> item.votes.join(str(auth.user.id)+',')
> new_votes = item.votesup + 1
> item.update_record(votesup=new_votes)
> return str(new_votes)
> elif auth.user.id in item.votes:
> return str(0)
>

When the user has already voted, why not return item.votesup (i.e., the 
current number of votes) rather than 0?
 

>
> #view
> 
> 
>

Why do you specify a 'votesup' input in the Ajax call -- is there one? If 
so, your function doesn't use it (you appear to be passing the ID via the 
URL args). If you don't have any input elements to read, just pass an empty 
[] as the second argument.

Anthony

-- 

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




[web2py] Can't get gmaps plugin to work

2013-05-17 Thread Marko Poutiainen
I can't seem to get the gmaps plugin to work.

I have this in the model:

from gluon.storage import Storage
plugin_gmap=Storage()

plugin_gmap.set=db(db.t_kiinnostuneet).select() 
points=db(db.t_kiinnostuneet.id>0).select()
plugin_gmap.represent=lambda row: '%(db.t_kiinnostuneet.f_lat)s 
%(db.t_kiinnostuneet.f_long)s' % row

This is my controller:

def index():
width = request.vars.width or 400
height = request.vars.height or 300
rows = db(db.t_kiinnostuneet.id>0).select()
for row in rows:
row.plugin_gmap_popup = 'foo' #plugin_gmap.represent(row)
return 
dict(width=width,height=height,rows=rows,GOOGLEMAP_KEY=plugin_gmap.key)

The page is https://www2.olka.fi/kiinnostuneet/default/kartta  where you 
can also see from the source what my view is like. 

This might be an issue with the API key, but I have re-generated it and 
even created a new project in Google apis just for this. As far as I 
understand, all I have to do is to go the project's API Access page and 
copy the key under the "Simple API Access" section. 

This plugin really should be updated to v3. I tried to use v3 (based on 
Margaret's tips) but couldn't get that to work either.

-- 

--- 
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 limit user votes

2013-05-17 Thread Christian Foster Howes
your code never writes the updated votes string.  and i'm not sure that 
using the "in" operator on a string like that will give you the results 
that you want.

you probably want another table say votelog

db.define_table('voetlog',
  Field('content_id', 'reference content'),
  Field('user_id', 'reference auth_user)

then check if logged in user has a record in votelog for that content 
before incrementing the content vote and adding a row to the votelog table.


On Thursday, May 16, 2013 4:00:57 AM UTC-7, sasogeek wrote:
>
> can you give me an example code?
> here's what i have but doesn't work.
> #model
> db.define_table('content',
> Field('username'),
> Field('text', 'text'),
> Field('file', 'upload'),
> Field('userpic'),
> Field('time', 'datetime', update=request.now),
> Field('userid', readable=False),
> Field('votesup', 'integer', default=0),
> Field('votesdown', 'integer', default=0),
> Field('votes', 'text', default='0,'),
> )
>
> #controller
> def voteup():
> item = db.content[request.args(0)]
> if auth.user.id not in item.votes:
> item.votes.join(str(auth.user.id)+',')
> new_votes = item.votesup + 1
> item.update_record(votesup=new_votes)
> return str(new_votes)
> elif auth.user.id in item.votes:
> return str(0)
>
> #view
> 
> 
> 
> 
> 
> {{=content.votesup}}
> 
> 
>
>
>
> On Wednesday, 15 May 2013 15:22:28 UTC+1, Anthony wrote:
>>
>> Actually, as long as you are requiring users to register and log in, you 
>> might as well just associate each vote with a user ID -- then when a user 
>> votes, you can just check whether that same user has already voted.
>>
>> Anthony
>>
>> On Wednesday, May 15, 2013 10:10:44 AM UTC-4, sasogeek wrote:
>>>
>>> the book states this "although it is easy to change this behavior if 
>>> visitors are authenticated, by keeping track of the individual votes in the 
>>> database and associating them with therequest.env.remote_addr of the 
>>> voter." at this link 
>>> http://web2py.com/books/default/chapter/29/11#Voting-and-rating
>>>
>>> How do I do that? I don't understand... but I need that feature. The app 
>>> I'm building with it is already live though. feel free to check it out if 
>>> you want :)
>>> http://sasogeek.pythonanywhere.com/uRate/default/index.html . However, 
>>> I really need the help! thanks
>>>
>>

-- 

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




[web2py] Re: WEB2PY iOS install APP

2013-05-17 Thread Christian Foster Howes
i don't understand the question.  what are you trying to do?

web2py can run the server code of a client-server application.  web2py has 
nothing specific for iOS and has no control over the installation of iOS 
apps.

On Tuesday, May 14, 2013 3:51:06 PM UTC-7, Allan K wrote:
>
> Hi, 
>
> I need to work with an app for web2py, but I do not know if I can use 
> web2py with iOS and install apps as I can with windows and macOS.
>
> Thanks.
>

-- 

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




[web2py] Random, wrong strings in Content-Type Response header for .css

2013-05-17 Thread Andriy
I had this problem for a while, but since I was in development stage, I`ve 
not payed much attention.

I use Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 

For some reason in some requests Content-Type Response header for .css 
returns not  with "text/css", but with random strings. So browser does not 
run this css file, and page layout is ruined.

This happens almost every time I reload page with CTRL+F5 in Opera or 
Chrome. My index page has 12 css files and 1-4 files return with corrupt 
headers such as:
- /mad/static/css/mad.css - which is just link to one of css files in 
directory
- mad/static/css/web2py.css - another
- test/plain - simply wrong for .css
- d:/web2py/applications - path to web2py dir?

Strangely, if I start to send requests from Opera-Dragonfly to one .css 
file (for ex. www.autosim.ru/static/css/mad.css) clicking "Send request" 
many times, than in 1 in 50 requests I have this strings like these in 
Content-Type header:
- forum_attachments_sequence - something from source code?
- too small or too large! - thats just from some validator
- forum_topics.author_id - name of a Field from one of my db tables!
- /user/not_authorized 
- ø   À±´ 
etc.

An apache httpd file mime_module is enabled with "TypesConfig 
conf/mime.types", so I guess Content-Type header should be forced, but it 
is clearly is not...

Could someone suggest something. I do not know even where to look. Is it 
web2py or is it apache problem?




I`m adding some screenshots:

-- 

--- 
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: Free opensource Janrain alternative - Python Social auth

2013-05-17 Thread Massimo Di Pierro
Thanks for checking.

On Friday, 17 May 2013 08:36:16 UTC-5, Marin Pranjić wrote:
>
> Failing for python 3.3 only
>
>
> On Fri, May 17, 2013 at 3:35 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> We need to support this. It appears to be failing its on travis tests.
>>
>>
>> On Thursday, 16 May 2013 18:56:33 UTC-5, Pystar wrote:
>>>
>>> https://github.com/omab/**python-social-auth
>>>
>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

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




Re: [web2py] Re: Free opensource Janrain alternative - Python Social auth

2013-05-17 Thread Marin Pranjić
Failing for python 3.3 only


On Fri, May 17, 2013 at 3:35 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> We need to support this. It appears to be failing its on travis tests.
>
>
> On Thursday, 16 May 2013 18:56:33 UTC-5, Pystar wrote:
>>
>> https://github.com/omab/**python-social-auth
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




[web2py] Re: Free opensource Janrain alternative - Python Social auth

2013-05-17 Thread Massimo Di Pierro
We need to support this. It appears to be failing its on travis tests.

On Thursday, 16 May 2013 18:56:33 UTC-5, Pystar wrote:
>
> https://github.com/omab/python-social-auth
>

-- 

--- 
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] form.custom in modal window

2013-05-17 Thread Annet
Thanks for your reply.

Have you tested it without modal?
>

I did test the view outside the modal, and it works fine.
 

> If if works you may have to debug the javascript using firebug for example.
>

I did try that as well, but the submit button seems to be detached from the 
form.

I figured out a different solution, I am not very happy with it, but at 
least the
form submits:



 

{{if form:}}
  {{=form}}
{{pass}}
 

  Close
 


and add a style rule to style .form-actions the way modal-footer is styled.


Kind regards,

Annet

-- 

--- 
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 time setup of few configurations

2013-05-17 Thread Saifuddin Rangwala
Hi, 

   I want to setup some groups like Administrators, Operators etc.. and 
give them several different permissions.

I have added below to db.py to achieve this:

admins = auth.add_group(role = 'Administrators')
# Give all permissions to administrators
auth.add_permission(admins.id, 'create', db.events)
auth.add_permission(admins.id, 'read', db.events)
auth.add_permission(admins.id, 'select', db.events)
auth.add_permission(admins.id, 'update', db.events)
auth.add_permission(admins.id, 'delete', db.events)


I have 2 questions in this regard:

1. auth.add_permission gets executed everytime (which is expected), is 
there some place in the framework where I can move this code so that it 
gets executed only once? I can always create a table called 'setup' and set 
a flag first time any user hits the code and skip the configuration for the 
rest of life.

2. Is there way to give all permissions to all tables ? i.e. something like 
auth.add_permission(admins.id, '*', db.*) or
auth.add_permission(admins.id, '*', db.tablename) 
   Because as I start adding more and more tables to my application it 
becomes more and more difficult to keep adding permissions.


Many thanks for your answers.

-S.

-- 

--- 
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] problem creating new controller

2013-05-17 Thread Robin Manoli
Hey,
I have created a new file, controller.py under controllers, which has an 
index function that returns a dict.
I have created a folder under views, named controller/index.html which 
extends layout.html

Now I thought I should be able to access it under 
/myapp/controller/index.html, or /myapp/controller/index, but I get the 
error:

invalid function (default/controller)


The only thing I have in routes.py:

routers = dict(
BASE  = dict(
domains =
{
'127.0.0.1' : 'myapp',
},
),
)


What did I miss? 

-- 

--- 
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: Testing your app using py.test

2013-05-17 Thread Vinicius Assef
Arnon, how many use cases does your application have?

Is time to run tests really a bottleneck in your case?

On Fri, May 17, 2013 at 9:07 AM, Arnon Marcus  wrote:
> That's good news!
>
> Now the only question that would remain, is weather this means that 
> test-performance using this, would be fast enough for that to be considered 
> fitting for interactive-TDD...
>
> Otherwise the dal-using-code would still be better-off 'mocked' away...
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

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




Re: [web2py] How to run web2py on Linux Shared Hosting With No Shell, or SSH access

2013-05-17 Thread Carlos Costa
Have you asked your host for SSH access?
I have used hostgator, I have to ask then to grant me SSH access, and even
with this is a pain to make web2py run there.
If they dont give it anyway, consider change the host, give a try at
pythonanywhere.com, you should install web2py with one click.


2013/5/16 Neeraj Kumar 

> Hi,
>
> I am trying to deploy Web2Py on my linux shared hosting with
> siliconhouse.net.
>
> Python runs on their system, able to run HelloWorld.py
>
> But when i unzipped the files on my public_html folder(with 755 permission
> on *.py files), instead of running it, it shows me listing of all files
> including *.py files.
>
> I am not sure what the problem is? If i click on any *.py files, it shows
> me 500-Internal Server Error 500.
>
> I have no shell or SSH access, is there a simple and easy way for me to be
> able to run web2py on this.
>
> They are using mod_python, and i can not deploy mod_wsgi. Is there any
> alternate, or is there something i can do my editable area i.e. inside
> public_html/..., so that when open my site i should be able to see running
> web2py application of my choice?
>
> I shall be highly thankful for any assistance on this.
>
> Regards,
> Neeraj Kumar
>
>
>
> --
>
> ---
> 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.
>
>
>



-- 
Att.

Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן

-- 

--- 
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] form.custom in modal window

2013-05-17 Thread Carlos Costa
Have you tested it without modal?
Just hit the url for mailVcard.load and make shure it works.
If if works you may have to debug the javascript using firebug for example.


2013/5/16 Annet 

> I have the following link to open a view in a modal window:
>
>
>  src="{{=URL('static','img/icons/vCard.png')}}" alt="" width="48px"
> height="48px" />
>
> 
>   {{=LOAD('vcard','mailVcard.load', args=node.id, ajax=True,
> ajax_trap=True)}}
>  
>
>
> This is the mailVcard.load view:
>
>
> 
>aria-hidden="true">×
>   {{=response.bannerHeader}}
>  
> 
>class="form-horizontal">
> 
>   
> {{=form.custom.widget.replyTo}}
>
>  
> 
>   
> {{=form.custom.widget.to}}
>
>  
>  
> 
>   
> 
>   {{=form.custom.submit}}
>style="margin-right: 125px;">Sluit
>   {{=form.custom.end}}
>  
>
>  
>
> When I click the submit button, nothing happens. What in Bootstrap modal
> is the cause of this problem,
> what is the easiest way to solve it?
>
>
> Regards,
>
> Annet
>
>  --
>
> ---
> 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.
>
>
>



-- 
Att.

Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן

-- 

--- 
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: Testing your app using py.test

2013-05-17 Thread Arnon Marcus
That's good news!

Now the only question that would remain, is weather this means that 
test-performance using this, would be fast enough for that to be considered 
fitting for interactive-TDD...

Otherwise the dal-using-code would still be better-off 'mocked' away...

-- 

--- 
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: behaviour of user_signature in URL

2013-05-17 Thread António Ramos
this is my code

*controller*
def empresa():
query= 0 if not request.args(0) else request.args(0)
mytable = SQLFORM.grid( db.e_docs.f_emp_ref==query ,
csv=False,
   etc
etc
etc
*
*
*view*
   
  Editar empreiteiro



In ubuntu i have to use user_signature_True in the URL , in windows i do
not.

The web page where this button is , is called from another page with URL,
user_signature=True


Is this sufficient info?
i can put more code...



2013/5/17 Anthony 

> Hard to say without seeing any code.
>
>
> On Friday, May 17, 2013 7:24:29 AM UTC-4, Ramos wrote:
>>
>> hello
>> i have my app running in a windows machine.
>>
>> I copied it to a ubuntu server and i have a problem with a URL helper in
>> my code
>>
>> The user goes to a pages via a URL(..., user_signature=True)
>> in that page he can edit a record via a button
>> This button calls a controller function via a URL helper (no
>> user_signature this time)
>>
>> In windows the button edits the record , in ubuntu i get the error " not
>> authorized"
>>
>> To have it working in ubuntu i had to add user_signature=True in the edit
>> button URL
>>
>>
>> Is this the way it is?
>>
>>
>> Best regards
>>
>> António
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

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




[web2py] Re: Create URL with embedded json object

2013-05-17 Thread Anthony
OK, looks like there is at least one solution that uses Flash: 
https://github.com/dcneiner/Downloadify. Not sure if there are any other 
client-side possibilities.

Anthony

On Friday, May 17, 2013 7:49:07 AM UTC-4, Anthony wrote:
>
> Are you saying you want the user to download a file containing the data? 
> As far as I know, that requires an HTTP request that returns a file (and if 
> the file is of a type the browser knows how to display, then the response 
> also needs a Content-Disposition header indicating the file is an 
> attachment).
>
> Anthony
>
> On Friday, May 17, 2013 6:41:46 AM UTC-4, Daniel Gonzalez wrote:
>>
>> Hi,
>>
>> In one of my views I am creating a table. During table creation time I 
>> have some dictionaries that I want to return as json objects. So in column 
>> "data" I want to provide a link to download this json objects. These 
>> objects are not stored anywhere (they are dinamically created), and are 
>> thus only known during the table instantiation time.
>>
>> Is it possible to do something like this:
>>
>> my_link = A(URL(data))
>>
>> So that clicking the link will not perform an access to the web2py (no 
>> controller needs to be accessed, the data is already in the URL), but just 
>> show the json data?
>>
>> Thanks,
>> Daniel
>>
>

-- 

--- 
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: Create URL with embedded json object

2013-05-17 Thread Anthony
Are you saying you want the user to download a file containing the data? As 
far as I know, that requires an HTTP request that returns a file (and if 
the file is of a type the browser knows how to display, then the response 
also needs a Content-Disposition header indicating the file is an 
attachment).

Anthony

On Friday, May 17, 2013 6:41:46 AM UTC-4, Daniel Gonzalez wrote:
>
> Hi,
>
> In one of my views I am creating a table. During table creation time I 
> have some dictionaries that I want to return as json objects. So in column 
> "data" I want to provide a link to download this json objects. These 
> objects are not stored anywhere (they are dinamically created), and are 
> thus only known during the table instantiation time.
>
> Is it possible to do something like this:
>
> my_link = A(URL(data))
>
> So that clicking the link will not perform an access to the web2py (no 
> controller needs to be accessed, the data is already in the URL), but just 
> show the json data?
>
> Thanks,
> Daniel
>

-- 

--- 
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: behaviour of user_signature in URL

2013-05-17 Thread Anthony
Hard to say without seeing any code.

On Friday, May 17, 2013 7:24:29 AM UTC-4, Ramos wrote:
>
> hello
> i have my app running in a windows machine.
>
> I copied it to a ubuntu server and i have a problem with a URL helper in 
> my code
>
> The user goes to a pages via a URL(..., user_signature=True)
> in that page he can edit a record via a button 
> This button calls a controller function via a URL helper (no 
> user_signature this time)
>
> In windows the button edits the record , in ubuntu i get the error " not 
> authorized"
>
> To have it working in ubuntu i had to add user_signature=True in the edit 
> button URL
>
>
> Is this the way it is?
>
>
> Best regards
>
> António
>

-- 

--- 
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: Testing your app using py.test

2013-05-17 Thread Anthony
On Friday, May 17, 2013 6:19:16 AM UTC-4, Arnon Marcus wrote:

> Using this, would it mean that no file is generated in the file-system?
> Does this mean that all that temporary-folder/file jazz would not 
> be required?
> In that case, you could even not have to clear-out the tables from 
> the previous test-run, as there wouldn't be any, right?
> But it should still require clearing-out data between-tests, right?
> And what about the schema-log file? Would that still have to be created? 
> It would seem redundant, as there would not be any use for it - unless 
> consecutive-tests are modifying the schema, and committing.
>

The DAL doesn't generate any *.table files for "sqlite:memory" databases.

Anthony

>

-- 

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




Re: [web2py] Re: Testing your app using py.test

2013-05-17 Thread Anthony
On Friday, May 17, 2013 4:23:39 AM UTC-4, Arnon Marcus wrote:

> I have some more questions about using an alternative database for testing.
>
> What would happen to the schema-log file?
> Wouldn't having the same model-code using 2 different databases, mess up 
> the log and brake automatic-migration capability?
> I mean, you could turn migration off for when testing, but wouln't that 
> prevent the model from being able to actually create your tables?
> Or does web2py manage different logs for each connection-url?
>
Same as how web2py would handle multiple databases in the same app in 
general -- see http://web2py.com/books/default/chapter/29/06#Migrations. By 
default, the *.table filenames are pre-pended with a hash of the db 
connection string (or you can manually name each .table file in the call to 
.define_table).
 

> And then there is the issue of having differences between schema 
> definitions using different databases, for example the way booleans are 
> implemented, or having missing features in the dal, like supporting 
> multy-column unique-constrains... I'm not even sure if sqlight supports 
> that at all... How would this approach handle such issues?
>
Obviously if you need to test database specific features, you'll need a 
copy of the specific database you want to test.

Anthony
 

-- 

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




[web2py] Re: saving UPS shipping labels

2013-05-17 Thread Jim Gregory
Just to follow up on this, I had not specified the file type in the 
function call and hence it did not encode it properly.  It works fine now.

On Friday, April 19, 2013 3:51:29 PM UTC-5, Jim Gregory wrote:
>
> I'm working on a script to generate UPS shipping labels and save them on 
> our server.  The shipping labels are passed as binary data in an XML file 
> from UPS. I am using the ClassicUPS library to parse the XML file and save 
> the data. 
>
> I wrote a simple script to test the library, and it works OK when I run it 
> on the command line.  However, when I include the function to save the file 
> in a controller, the saved files are corrupted.   If I use Imagemagick to 
> read the file, it returns the error 'improper image header'.  The function 
> in the library that saves the data is:
>
> def save_label(self, fd):
> raw_epl = 
> self.accept_result.dict_response['ShipmentAcceptResponse']['ShipmentResults']['PackageResults']['LabelImage']['GraphicImage']
> binary = a2b_base64(raw_epl)
> fd.write(binary)
>
> I call the function using:
> shipment.save_label(open('label.gif','wb'))
>
> where shipment is a shipping label object produced by the library.
>
> Does web2py do something that would corrupt the header?
>

-- 

--- 
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] behaviour of user_signature in URL

2013-05-17 Thread António Ramos
hello
i have my app running in a windows machine.

I copied it to a ubuntu server and i have a problem with a URL helper in my
code

The user goes to a pages via a URL(..., user_signature=True)
in that page he can edit a record via a button
This button calls a controller function via a URL helper (no user_signature
this time)

In windows the button edits the record , in ubuntu i get the error " not
authorized"

To have it working in ubuntu i had to add user_signature=True in the edit
button URL


Is this the way it is?


Best regards

António

-- 

--- 
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] edit static content from web interface nginx

2013-05-17 Thread BlueShadow
Hi,
since I'm using nginx as a server I can't edit my static files (css, js...) 
from the webinterface. I can view them but when I want to edit them I get a 
404 error. anyone with the same problem?

-- 

--- 
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] Create URL with embedded json object

2013-05-17 Thread Daniel Gonzalez
Hi,

In one of my views I am creating a table. During table creation time I have 
some dictionaries that I want to return as json objects. So in column 
"data" I want to provide a link to download this json objects. These 
objects are not stored anywhere (they are dinamically created), and are 
thus only known during the table instantiation time.

Is it possible to do something like this:

my_link = A(URL(data))

So that clicking the link will not perform an access to the web2py (no 
controller needs to be accessed, the data is already in the URL), but just 
show the json data?

Thanks,
Daniel

-- 

--- 
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: Testing your app using py.test

2013-05-17 Thread Arnon Marcus
Using this, would it mean that no file is generated in the file-system?
Does this mean that all that temporary-folder/file jazz would not 
be required?
In that case, you could even not have to clear-out the tables from 
the previous test-run, as there wouldn't be any, right?
But it should still require clearing-out data between-tests, right?
And what about the schema-log file? Would that still have to be created? It 
would seem redundant, as there would not be any use for it - unless 
consecutive-tests are modifying the schema, and committing.

How would the life-cycle of such a db-object be managed?

If every test re-launches the model that defines the db-object, than it 
would be created from scratch every time - in this case no schema-log is 
needed at all, but this could be slower computationally - though the lack 
of access to the file-system may override that shortcoming and actually 
make it faster(?)
And also conditional-schema-creation may improve performance as well, as 
because the db-schema is regenerated on each test, than each one could only 
construct the tables it actually needs.

If the db-object is reused across-tests, and conditional-schema-creation is 
applied, than how would the migrations happen? In this case it *would* need 
a schema-log, right? That may override the benefit of the 
conditional-creation, by having it need to access the file-system... So if 
the db-object is still reused, but no conditional-creation is applied, than 
it might take a bit more for the set-up faze, as it would generate all 
tables, but than a schema-log could really be un-necessary - this could 
give the best of both worlds - no re-creation of tables, AND no file-system 
access - right? Can that be accomplished? I mean, generally, the way to 
avoid using a schema-log, migrations are needed to be turned-off. But 
Wouldn't athat prevent the dal from being able to even create the tables in 
the first-place?


On Thursday, May 16, 2013 10:37:09 AM UTC-7, Anthony wrote:
>
> I'm not sure how you are goint to implement an in-memory 
>> relational-database that can be used woth the same db-object-using code - 
>> that sounds ineresting...
>
>
> db = DAL('sqlite:memory') 
>
>

-- 

--- 
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] CSV special characters

2013-05-17 Thread Domagoj Kovač
Hi,

I am working on CSV export.

I have a function that returns a string.
output_string = StringIO.StringIO()

csv_writer = csv.writer(output_string, delimiter=';', quotechar=' 
',quoting
=csv.QUOTE_MINIMAL)
csv_writer.writerows(output)

contents = output_string.getvalue()

output_string.close()

return contents

In my controller i have:
response.headers["Content-Type"] = gluon.contenttype.contenttype(".csv") 
+ ";charset=utf-8"
response.headers["Content-disposition"] = "attachment; filename=" 
+entry_class
.name + ".csv"

output = CSV.get_entries_content(entries, 
entry_class_attributes,entries_values
)

return str(output)

But when content is outputed i get KljuÄŤ Ĺ˝itnjak when it should be ključ 
žitnjak, how can i fix this?


-- 

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




Re: [web2py] Re: Testing your app using py.test

2013-05-17 Thread Arnon Marcus
Another issue:
Testing controller-actions is not considered unit-testing, as it relies on an 
external dependancy that is supposed to be generated by the framework.
In web2py it's even worse - you have to prepare an entier execution 
environment, as is done in this experiment... Generally, treating these kinds 
of tests as unit-tests is considered a mistake. They should be researven for 
the much-less-frequent integration-tests, and then use actual template-parsing. 
This is why it is suggested that such code should be extremely short, and have 
it mostly call other modules.
If you really want to treate your controllers as viable for unit-testing, than 
the environment should be mocked/faked, and not constructed using the actual 
framework. Also, the templates should not be used - the tests should recieve 
whatever the templates would recieve in production.
Then, for unit-testing the templates, a mocked-out representation of the 
environment and controller-output should be used, but using the actual 
templating-engine.
What are your thoughts on that?

-- 

--- 
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: Testing your app using py.test

2013-05-17 Thread Arnon Marcus
I have some more questions about using an alternative database for testing.

What would happen to the schema-log file?
Wouldn't having the same model-code using 2 different databases, mess up the 
log and brake automatic-migration capability?
I mean, you could turn migration off for when testing, but wouln't that prevent 
the model from being able to actually create your tables?
Or does web2py manage different logs for each connection-url?
And then there is the issue of having differences between schema definitions 
using different databases, for example the way booleans are implemented, or 
having missing features in the dal, like supporting multy-column 
unique-constrains... I'm not even sure if sqlight supports that at all... How 
would this approach handle such 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.