[web2py] Re: Form field manipulation questions

2017-01-09 Thread Dave S
Now I'm trying to use 
jQuery("fieldx").blur(function {jQuery("fieldy").focus()}); 
to control which field in the form the user goes to after completing 
fieldx.  This works great unless I try to set a blur function on fieldy; it 
thinks fieldy is blurring as soon as I set focus on it.  Annoying, to say 
the least.  (Testing in Chrome, so far)

Suggestions?

/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/d/optout.


[web2py] Re: Form field manipulation questions

2017-01-09 Thread Dave S


On Tuesday, January 3, 2017 at 1:35:51 AM UTC-8, Dave S wrote:
>
> I have an SQLFORM where I wanted the value of field 3 to depend on the 
> value of field 2, sort of like cascading autocompletes, but not quite. 
>  Field 3 was going to be populated with the length of the string in Field 
> 2, so I tried adding to my view
>
> 
> jQuery(document).ready(function(){
>jQuery(''#QM_Len__label'').click(function(){jQuery('#QM_Len__label').
> val(jQuery("#QM_Mint__label").length)});
> });
> 
>
> This didn't seem to do anything.  Obviously I wasn't completely 
> understanding the autocomplete example in Chapter 11, nor other posts in 
> this forum.  What was I missing?  Also, I should be able to use 
> jQuery.focus() in place of jQuery.click(), yes?
>

Ah, I found that I needed to strip the "__label" ; I had drilled in 
not-carefully-enough when using inspect-element in the browser.


> Note:  For this specific issue, I have found that making Field 3 a 
> computed field in my qm-db.py definitions works quite well, but I think I 
> may run into other situations where having the answer to this will make 
> those easier to handle.
>
> [There's a second question, but I think I can handle it by defining a 
> custom validator.  I may want to have equivalent validation on the browser 
> side, though, so I may be back with Q2 later.]
>
>
And this one was covered by "IS_MATCH", because the input was to be 
arbitrary combinations of 'x', 'd', and 'p' used as a string.
 

> Thanks.
>
> /dps
>

For the record.
 

-- 
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: Store value in input field in a table

2017-01-09 Thread Joe Lwe
Hi.. I have the same challange,  did u get a solution.. if yes kindly share.. 
but I guess the coordinates have to be stored in location field of the table. 

Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Selecting booleans from sqlite3 database

2017-01-09 Thread Marco Mansilla
El Mon, 9 Jan 2017 12:17:19 -0800 (PST)
LoveWeb2py  escribió:

> Hello,
> 
> 
> I'm trying to do a simple query against a sqlite3 database where the
> values are stored as 0's and 1's
> 
> All i want to do is select all values that are True or False
> 
> According to the book this should work:
> 
> db(db.table.field==True).select()
> 
> and that would return rows
> 
> however, it's returning Rows(0) (nothing)
> 
> I verified in the database that they are being stored as True/False
> through appadmin
> 
> Any thoughts on why this isn't working?
> 

Hi, this has been a headache to me in a new project, since I'm
re structuring the database and migrating data from an existing project
(some crazy thing some did in java), and booleans where 0's and 1's,
when I tried to run queries with these parameters didn't work, just
like in your case, then I realized that web2py queries are effective
with 'T' and 'F' for boolean values and now everything works.

So, is this the expected behaviour?, am I/are we missing something
about DAL?.

Just for the record, I'm not that smart, when imported backup from
table to db booleans were 0 and 1, but after editing the table in CSV
format and restoring data to table noticed the difference and booleand
were converted to T and F respectively.

Hope it helps.

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/d/optout.


[web2py] Re: auth on GAE 'unable to send email'

2017-01-09 Thread David Manns
I don't agree. Other emails from elsewhere using mail.send() in the 
application go out just fine. This despite the 'allow insecure apps' option 
being off on the email account used. Only the emails generated by the 
auth() registration and password reset processes are affected. There must 
be something different about auth()'s usage of email causing the problem.

I tried turning on 'allow insecure apps' and it made not difference.

Also, if I run with old version built with web2py 2.12.3, this problem goes 
away. (Though there was still a problem with password reset that I 
documented here: https://groups.google.com/forum/#!topic/web2py/QBs3esYnH6w

On Monday, January 9, 2017 at 1:18:27 PM UTC-5, Leonel Câmara wrote:
>
> This is not a problem with web2py, this is a problem with gmail SMTP which 
> doesn't allow normal SMTP protocol anymore unless you allow what they call 
> "insecure apps".
>
> See:
> https://support.google.com/accounts/answer/6010255?hl=en
>

-- 
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: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Dave S


On Monday, January 9, 2017 at 7:46:42 AM UTC-8, Anthony wrote:
>
> On Monday, January 9, 2017 at 2:54:52 AM UTC-5, Dave S wrote:
>>
>> I think you have to have something for the 4th value; if there is no 
>> submenu, try putting None in that spot.
>>
>
> No, the fourth item is optional. 
>

> Anthony
>

Ah, I read that as "optional in his simplification", without paying 
attention to the framework call.
Too quick a read, I guess, though it fit with unpacking errors.

/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/d/optout.


Re: [web2py] Re: Selecting booleans from sqlite3 database

2017-01-09 Thread Austin Taylor
I'll give that a try. I did try porting the database over from django so
I'm guessing that's probably the issue.

On Mon, Jan 9, 2017 at 3:49 PM, Niphlod  wrote:

> did you try dropping the databae and letting web2py recreate it ? sqlite
> doesn't go well with fields altering their type "afterwards" (i.e. maybe
> you created it as a string and then turned into a boolean)
>
>
> On Monday, January 9, 2017 at 9:17:19 PM UTC+1, LoveWeb2py wrote:
>>
>> Hello,
>>
>>
>> I'm trying to do a simple query against a sqlite3 database where the
>> values are stored as 0's and 1's
>>
>> All i want to do is select all values that are True or False
>>
>> According to the book this should work:
>>
>> db(db.table.field==True).select()
>>
>> and that would return rows
>>
>> however, it's returning Rows(0) (nothing)
>>
>> I verified in the database that they are being stored as True/False
>> through appadmin
>>
>> Any thoughts on why this isn't working?
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/IV2pgqH5lfc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Issues with record versioning

2017-01-09 Thread Anthony

>
> record = db(db.table_x.id == row_id).select().first()
> record['name'] = 'something else'
> record.update_record()
>
> That's the one way you cannot do it. The problem is when you call 
.update_record() with no arguments, it takes all the existing fields in the 
record and uses them in the database update. It will therefore use the 
existing values of modified_by and modified_on. Typically, modified_by and 
modified_on get updated because they are excluded from the update call, 
which prompts the DAL to fill their values in automatically. But this 
mechanism breaks down when calling .update_record() with no arguments. We 
should probably add a note about this in the book.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Anthony
On Monday, January 9, 2017 at 12:14:02 PM UTC-5, Terrence Brannon wrote:
>
>
> On Mon, Jan 9, 2017 at 10:55 AM, Anthony wrote:
>
>> Does response.menu have any pre-existing values, 
>>
> Yes it does. Here is a link to the full source code of models/menu.py
> https://github.com/metaperl/trustnet/blob/master/models/menu.py
>  
>
>> and does this happen with the public or logged in menu?
>>
> Public for now as I have not done the same thing with logged-in menu.
>  
>
>> Maybe try inspecting the menu using a web2py shell 
>>
> I did find some discussion of the web2py shell in the book:
>
> http://web2py.com/books/default/chapter/29/02/the-python-language#Starting-up
>
> but not enough to understand how to mimic a request and examine the value 
> of response.menu
>

If you start a shell via:

python web2py.py -S yourapp -M

you'll get a Python shell with a web2py environment, including any objects 
created in your model files. response.menu will therefore be defined as it 
is in your model file (there will be no auth.user in the shell, so nothing 
that requires login will work).
 

>  
>
>> or print the menu to see what it contains.
>>
>
> Where would this print output go? Where would I put such a print 
> statement? The program throws an exception and creates a ticket before a 
> full request is serviced...
>

If you run the built-in web2py server from the command line, any print 
statements will print in that window. You can also set up logging and log 
to a file.
 

>
> If you want to see the full ticket, just visit this URL:
> http://web2py.metaperl.org/refbank
>

Note, external users cannot access your error tickets -- they require 
access to admin via HTTPS and the admin password.

Anthony

-- 
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: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Anthony
On Sunday, January 8, 2017 at 3:04:07 PM UTC-5, Terrence Brannon wrote:
>
> I attempted to simplify creation of the response.menu list of tuples by 
> the following function:
>
>
> def menu_item(menu_item_text, url, sub_menu=None, ignore=False):
> # First element of tuple is the text of the meny item.
> retval = list(menu_item_text)
>

The above is not the way to create a list with menu_item_text as a single 
item. The list() function iterates over the argument passed in and makes 
each element a list item. Because strings are iterable, it creates a list 
with each element being a single character in menu_item_text. Therefore, 
the fourth item in retval is always the fourth character in menu_item_text 
rather than the sub_menu. When the MENU helper gets to what it expects to 
be a submenu, it instead gets a single character, which of course cannot be 
unpacked via item[:3].

It's always a good idea to test the outputs of your functions as you 
develop them -- much easier to find bugs when you can isolate the effect to 
a small function.

Anthony

-- 
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: Selecting booleans from sqlite3 database

2017-01-09 Thread Niphlod
did you try dropping the databae and letting web2py recreate it ? sqlite 
doesn't go well with fields altering their type "afterwards" (i.e. maybe 
you created it as a string and then turned into a boolean)

On Monday, January 9, 2017 at 9:17:19 PM UTC+1, LoveWeb2py wrote:
>
> Hello,
>
>
> I'm trying to do a simple query against a sqlite3 database where the 
> values are stored as 0's and 1's
>
> All i want to do is select all values that are True or False
>
> According to the book this should work:
>
> db(db.table.field==True).select()
>
> and that would return rows
>
> however, it's returning Rows(0) (nothing)
>
> I verified in the database that they are being stored as True/False 
> through appadmin
>
> Any thoughts on why this isn't working?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] response.flash or session.flash with dict instead of string???

2017-01-09 Thread LoveWeb2py
How did you implement this Ramos? I ended up writing a toastr function in a 
model file and using that when I needed the flash. Did you just modify the 
javascript?

On Monday, January 9, 2017 at 5:00:50 AM UTC-5, Ramos wrote:
>
> nice ;)
>
> 2017-01-08 23:18 GMT+00:00 Anthony :
>
>> Try it and see. ;-)
>>
>> --
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Selecting booleans from sqlite3 database

2017-01-09 Thread LoveWeb2py
Hello,


I'm trying to do a simple query against a sqlite3 database where the values 
are stored as 0's and 1's

All i want to do is select all values that are True or False

According to the book this should work:

db(db.table.field==True).select()

and that would return rows

however, it's returning Rows(0) (nothing)

I verified in the database that they are being stored as True/False through 
appadmin

Any thoughts on why this isn't working?

-- 
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: Column export to txt

2017-01-09 Thread yarecki wr
Silly newby mistake :) Now works perfect. I read it only to check that the 
content is actually there as the goal is to somehow get the file to another 
server that requires authentication (Windows). 

-- 
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: auth on GAE 'unable to send email'

2017-01-09 Thread Leonel Câmara
This is not a problem with web2py, this is a problem with gmail SMTP which 
doesn't allow normal SMTP protocol anymore unless you allow what they call 
"insecure apps".

See:
https://support.google.com/accounts/answer/6010255?hl=en

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Terrence Brannon
On Mon, Jan 9, 2017 at 10:55 AM, Anthony  wrote:

> Does response.menu have any pre-existing values,
>
Yes it does. Here is a link to the full source code of models/menu.py
https://github.com/metaperl/trustnet/blob/master/models/menu.py


> and does this happen with the public or logged in menu?
>
Public for now as I have not done the same thing with logged-in menu.


> Maybe try inspecting the menu using a web2py shell
>
I did find some discussion of the web2py shell in the book:
http://web2py.com/books/default/chapter/29/02/the-python-language#Starting-up

but not enough to understand how to mimic a request and examine the value
of response.menu


> or print the menu to see what it contains.
>

Where would this print output go? Where would I put such a print statement?
The program throws an exception and creates a ticket before a full request
is serviced...

If you want to see the full ticket, just visit this URL:
http://web2py.metaperl.org/refbank


>
> Note, your "ignore" argument defaults to False, so all of your menu items
> will be ignored by the MENU helper.
>
Oh I fixed that. Thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Connecting new table to mysql db on Pythonanywhere

2017-01-09 Thread Anthony
Is there a *.table file in your /databases folder corresponding to the 
table in question? If so, you probably created that table on another system 
or with a previous version of the database and copied/retained the *.table 
file. This leads web2py to think the table already exists, so web2py will 
not attempt to create it. You can simply delete the *.table file, and the 
DAL's migration system will then create the table.

Anthony

On Sunday, January 8, 2017 at 10:36:54 PM UTC-5, Joe wrote:
>
> I have a table already defined in my app and it's connected to mysql on 
> Pythonanywhere.
> I wanted to define an other table in the same app but I am unable to 
> connect this new table to db.
>
> In my db.py file I have this:
>
> *if not request.env.web2py_runtime_gae:*
> *## if NOT running on Google App Engine use SQLite or other DB*
> *db = 
> DAL('mysql:myaccount.mysql.pythonanywhere-services.com/myaccount$dbname 
> ')*
>
> This works as expected for the table already defined, but when I try to 
> define an other table it crashes.
> I get this error:
>
> ProgrammingError: ( "Table 'myaccount$dbname.tablename' doesn't exist")
>
>
> I am probably missing something obvious.
>
> Can anyone advise me on this please?
>
> Thanks.
>
> Cheers,
>
> Joe
>
>
>

-- 
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: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Anthony
Does response.menu have any pre-existing values, and does this happen with 
the public or logged in menu? Maybe try inspecting the menu using a web2py 
shell or print the menu to see what it contains.

Note, your "ignore" argument defaults to False, so all of your menu items 
will be ignored by the MENU helper.

Anthony

On Sunday, January 8, 2017 at 3:04:07 PM UTC-5, Terrence Brannon wrote:
>
> I attempted to simplify creation of the response.menu list of tuples by 
> the following function:
>
>
> def menu_item(menu_item_text, url, sub_menu=None, ignore=False):
> # First element of tuple is the text of the meny item.
> retval = list(menu_item_text)
>
> # Second element of the tuple indicates if this menu item is the
> # current active one.
> retval.append(url == URL())
>
> # Third element is the link to follow when this item is selected.
> retval.append(url)
>
> # The fourth item is an optional sub_menu.
> if sub_menu:
> retval.append(sub_menu)
> else:
> retval.append([])
>
> retval.append(ignore)
>
> return retval
>
>
> but when using it like so:
>
> def public_menu():
>
> response.menu += [
> menu_item('How it Works', URL('default', 'how_it_works')),
> menu_item('Testimonials', URL('default', 'testimonials')),
> menu_item('Sign up Now!', URL('default', 'register')),
> menu_item('Login'   , URL('default', 'login')),
> ]
>
> if auth.is_logged_in():
> logged_in_menu()
> else:
> public_menu()
>
>
> I get the error:
>
> 127.0.0.1.2017-01-08.19-46-22.ca7178e4-a2b2-48f7-8463-81d2c8f70f27
>  need more than 1 value to unpack Version 
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File 
> "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/restricted.py", 
> line 227, in restricted
> exec ccode in environment
>   File 
> "/home/schemelab/domains/org/metaperl/web2py/web2py/applications/refbank/views/default/index.html",
>  line 59, in 
>   File "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/globals.py", 
> line 430, in write
> self.body.write(xmlescape(data))
>   File "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/html.py", 
> line 131, in xmlescape
> return data.xml()
>   File "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/html.py", 
> line 2580, in xml
> return self.serialize(self.data, 0).xml()
>   File "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/html.py", 
> line 2545, in serialize
> li.append(self.serialize(item[3], level + 1))
>   File "/home/schemelab/domains/org/metaperl/web2py/web2py/gluon/html.py", 
> line 2525, in serialize
> (name, active, link) = item[:3]
> ValueError: need more than 1 value to unpack
>
>
>

-- 
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: Help needed simplifying creation of response.menu 4-tuple

2017-01-09 Thread Anthony
On Monday, January 9, 2017 at 2:54:52 AM UTC-5, Dave S wrote:
>
> I think you have to have something for the 4th value; if there is no 
> submenu, try putting None in that spot.
>

No, the fourth item is optional.

Anthony

-- 
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: Issues with record versioning

2017-01-09 Thread Ricardo Oliveira
I activated query logging but the only thing I can see is that when a 
change is made, the insert in the archive table has both the values 
(modified_on, 
modified_by) set to NULL.
Anyone else have any other ideas?
How can I further troubleshoot this issue?

TIA,
Ricardo.

-- 
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: Installed applications

2017-01-09 Thread Anthony
On Sunday, January 8, 2017 at 7:50:45 PM UTC-5, new2py wrote:
>
> Hi, 
>
> This may be a dumb question, but I have saved/installed apps on my web2py 
> account, but when I login from another computer, my apps are no longer 
> there ( only when I login from my home computer (which they were created 
> on).
>

What do you mean by your "web2py account"? If you have downloaded web2py to 
your personal computer and created apps there, then everything is simply on 
your personal computer (the web2py built-in server simply runs right on 
your computer, and your browser makes requests to that local server -- 
nothing is going over the internet). If you want to access an app via the 
internet, you must deploy it on a publicly accessible server somewhere. See 
http://web2py.com/books/default/chapter/29/13/deployment-recipes. The 
simplest, quickest option is probably 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Deploying-on-PythonAnywhere.

Anthony

-- 
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: Column export to txt

2017-01-09 Thread Anthony
On Monday, January 9, 2017 at 3:55:23 AM UTC-5, yarecki wr wrote:
>
>
> the function is just as below
>>
> def csv_file():
> mycsv=os.path.join(request.folder, 'static', '/tmp/items.csv')
> db(db.mytable).select(db.mytable.Items).export_to_csv_file(open(mycsv, 
> 'wb', write_colnames=False))
> data=open(mycsv).read()
> return data
>
>
>
First, write_colnames is an argument of .export_to_csv_file, but you have 
instead passed it to open(). Second, no need to write to a tempfile -- 
instead, create a cStringIO object and write to and read from that (it will 
be faster because it stays in memory instead of going to disk).
 

> Then it's being read by a standard view with
> {{=BEAUTIFY(response._vars)}}
>

If you are returning a string, there will be no response._vars, and no view 
will be executed at all. The string will simply be returned as is. If you 
want to stream a file to the browser, use response.stream (see the "The 
core" chapter of the book).

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] response.flash or session.flash with dict instead of string???

2017-01-09 Thread António Ramos
nice ;)

2017-01-08 23:18 GMT+00:00 Anthony :

> Try it and see. ;-)
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Column export to txt

2017-01-09 Thread yarecki wr


> the function is just as below
>
def csv_file():
mycsv=os.path.join(request.folder, 'static', '/tmp/items.csv')
db(db.mytable).select(db.mytable.Items).export_to_csv_file(open(mycsv, 
'wb', write_colnames=False))
data=open(mycsv).read()
return data


Then it's being read by a standard view with
{{=BEAUTIFY(response._vars)}}

 

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