[web2py] Though I changed datetime format to %d-%m-%Y %H:%M in web2py_ajax.html it gives the old results?

2016-06-17 Thread Steve Joe
Do I have to change it anywhere else too?

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


[web2py] Re: How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread Anthony
On Friday, June 17, 2016 at 6:45:15 PM UTC-4, Greenpoise wrote:
>
> The typo is just here. Where can I see the components of the grid?
>

Not sure what you mean. You can always inspect the HTML in the browser.

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: How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread Greenpoise
The typo is just here. Where can I see the components of the grid?

Thanks 



On Friday, June 17, 2016 at 3:42:55 PM UTC-7, Anthony wrote:
>
> Not sure if this is the issue, but you are missing a closing quote.
>
> On Friday, June 17, 2016 at 6:39:18 PM UTC-4, Greenpoise wrote:
>>
>> like this for example?
>>
>> 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: How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread Anthony
Not sure if this is the issue, but you are missing a closing quote.

On Friday, June 17, 2016 at 6:39:18 PM UTC-4, Greenpoise wrote:
>
> like this for example?
>
> 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: How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread Greenpoise
like this for example?

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: How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread Anthony
Or override its styles in a custom CSS file that gets loaded later.

On Friday, June 17, 2016 at 6:17:06 PM UTC-4, greenpoise wrote:
>
> Should I edit web2py-bootstrap3.css directly?
>
>
> 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] How can I customize the look and feel of SQLFORM.grid???

2016-06-17 Thread greenpoise
Should I edit web2py-bootstrap3.css directly?


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: Rocket server and Windows POST

2016-06-17 Thread Dave S
On Friday, June 17, 2016 at 7:34:18 AM UTC-7, Niphlod wrote:
>
> how can it be a rocket issue when the variable is the client and not the 
> server ?
>

By not handling a common error condition?  By setting the timeout too 
long?Not requiring a keep-alive (aka heartbeat) on an open-but-quiet 
connection?

I haven't tried running a trace from either end, so I don't know what is 
happening with the handshakes other than that the connection gets 
established, and  a long time after the client is done, we get the above.

/dps

 

>
> On Friday, June 17, 2016 at 1:36:29 AM UTC+2, Dave S wrote:
>>
>> I'm a bad boy and still using the Rocket server that comes with web2py.  
>> Today I ran into an interesting case.  My client code sends a dump file to 
>> the server using a POST command.  On linux systems, this completes in a 
>> reasonable amount of time, gets the result (json string), and both sides 
>> are happy.  On several Windows systems, the client reports all done, and is 
>> happy, but the server logs don't have anything and the file doesn't show 
>> up.  [tick tick tick ... time passes] Oh, yes there is something!  
>> Everything now looks good, except that web2py.log has this from Rocket:
>>
>> 2016-06-16 22:10:34,846 - Rocket.Errors.Thread-5 - ERROR - Unhandled 
>> Error when serving connection:
>> Traceback (most recent call last):
>>
>>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1337, 
>> in run
>> self.run_app(conn)
>>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1851, 
>> in run_app
>> self.write(data, sections)
>>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1766, 
>> in write
>> self.send_headers(data, sections)
>>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1750, 
>> in send_headers
>> self.conn.sendall(b(header_data))
>>   File "/usr/lib64/python2.7/socket.py", line 228, in meth
>> return getattr(self._sock,name)(*args)
>> error: [Errno 32] Broken pipe
>>
>>
>> Timeout seems to be on the order of an hour.  Linux client code uses 
>> libcurl, and Windows client code uses Winsock.
>> The above clip is from web2py-2.14.6 running on an AWS server, from the 
>> zip file which has Rocket 1.2.6.
>>
>> Is this an issue with Rocket, or with Winsock, or each playing to the 
>> other's weakness?  When I finally move to nginx, will these errors go away?
>>
>> /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: search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Al Ex
Thank you. Formname was already assigned.
Yes I need to show the code, I will simplify it a little, at the moment it
does not look so nice to read, maybe during this process the bug will also
show up ;-)

-- 
Al Ex

From: Anthony  
Reply: web2py@googlegroups.com 

Date: June 17, 2016 at 10:28:39 PM
To: web2py-users  
Subject:  [web2py] Re: search results returned by SQLFORM.grid in loaded
component {{=LOAD( 

The first place I would look is your code, which you have not shown. ;-)

On Friday, June 17, 2016 at 4:02:59 PM UTC-4, alex wrote:
>
> In a index.html view I load a component "test.load" containing an
> SQLFORM.grid with searchable=True.
> When I perform a search, the results do not appear inside the index.html
> any more.
> A new page "test.load” opens with the results.
>
> For sure I am doing something wrong, or I am missing something, because if
> I reproduce the above in an fresh app generated with the admin app wizard,
> the results are correctly found in the component "test.load" in index.html.
>
> I cannot find the bug though. Is there any place you would look for it at
> first?
>
> Thank you
>
> --
> Alex
>
--
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: search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Anthony
The first place I would look is your code, which you have not shown. ;-)

On Friday, June 17, 2016 at 4:02:59 PM UTC-4, alex wrote:
>
> In a index.html view I load a component "test.load" containing an 
> SQLFORM.grid with searchable=True. 
> When I perform a search, the results do not appear inside the index.html 
> any more. 
> A new page "test.load” opens with the results. 
>
> For sure I am doing something wrong, or I am missing something, because if 
> I reproduce the above in an fresh app generated with the admin app wizard, 
> the results are correctly found in the component "test.load" in index.html. 
>
> I cannot find the bug though. Is there any place you would look for it at 
> first?
>
> Thank you
>
> -- 
> Alex
>

-- 
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: search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Ron Chatterjee
Try to stick a formname in the grid.

formname='something'

See if it works.

On Friday, June 17, 2016 at 4:02:59 PM UTC-4, alex wrote:
>
> In a index.html view I load a component "test.load" containing an 
> SQLFORM.grid with searchable=True. 
> When I perform a search, the results do not appear inside the index.html 
> any more. 
> A new page "test.load” opens with the results. 
>
> For sure I am doing something wrong, or I am missing something, because if 
> I reproduce the above in an fresh app generated with the admin app wizard, 
> the results are correctly found in the component "test.load" in index.html. 
>
> I cannot find the bug though. Is there any place you would look for it at 
> first?
>
> Thank you
>
> -- 
> Alex
>

-- 
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] search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Al Ex
In a index.html view I load a component "test.load" containing an
SQLFORM.grid with searchable=True.
When I perform a search, the results do not appear inside the index.html
any more.
A new page "test.load” opens with the results.

For sure I am doing something wrong, or I am missing something, because if
I reproduce the above in an fresh app generated with the admin app wizard,
the results are correctly found in the component "test.load" in index.html.

I cannot find the bug though. Is there any place you would look for it at
first?

Thank you

-- 
Alex

-- 
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] Why is this simple join not rendering?

2016-06-17 Thread greenpoise
Thanks Massimiliano!



On Friday, June 17, 2016 at 3:46:05 AM UTC-7, Massimiliano wrote:
>
> I think you need to refer to fields in this way:
>
> {{=customer.customer.first_name}}
> {{=customer.customer_type.type_name}}
>
> On Fri, Jun 17, 2016 at 8:56 AM, Greenpoise  > wrote:
>
>> so I have this simple join:
>>
>> query = (db.customer.id > 0) & (db.customer_type.id
>> ==db.customer.customer_type)
>>
>> all_customers = db(query).select()
>>
>> return dict(all_customers = all_customers)
>>
>> and my view:
>>
>> {{for customer in all_customers:}}
>> 
>>   {{=customer.first_name}}
>>   {{=customer.last_name}}
>>   {{=customer_type.type_name}}
>>   {{=customer.email}}
>>   {{=customer.home_number}}
>>  {{pass}}
>>
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> Massimiliano
>

-- 
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] Problem with custom upload

2016-06-17 Thread Richard Vézina
No problem, I am glad you found your mistake.

Richard

On Fri, Jun 17, 2016 at 11:54 AM, 'Annet' via web2py-users <
web2py@googlegroups.com> wrote:

> Hi Richard,
>
> Thanks for your reply, renaming the application did not solve the problem.
> However,
> having a closer look at my code, I found that in:
>
> upload=URL('dbmodel', 'static', 'uploads', folder,
> args=request.vars.image))
>
> 'static', 'uploads' should be 'static/uploads'
>
> I am sorry for bothering you with something this stupid :-(
>
> Annet
>
> --
> 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.


Re: [web2py] Problem with custom upload

2016-06-17 Thread 'Annet' via web2py-users
Hi Richard,

Thanks for your reply, renaming the application did not solve the problem. 
However,
having a closer look at my code, I found that in:

upload=URL('dbmodel', 'static', 'uploads', folder, args=request.vars.image))

'static', 'uploads' should be 'static/uploads'

I am sorry for bothering you with something this stupid :-(

Annet

-- 
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] maxtextlengths is not working for me

2016-06-17 Thread Anthony
Yes, there is a problem with smartgrid - most of the arguments must now be 
dictionaries with table names as keys (so you need to specify this for each 
table). An issue has been filed to restore the original behavior.

-- 
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] maxtextlengths is not working for me

2016-06-17 Thread Valdeck Rowe
This one does not work, it gives the default behavior. 

maxtextlengths = {
'scenario_step.activity' : 80, 
'use_case.title' : 40, 
'scenario_step_target.target_use_case':30

},

This works however, but is not individualized to the different fields as 
above

maxtextlength = 30,

Could it be because I'm using it in a smartgrid? 

Thanks in advance.

V

-- 
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: Rocket server and Windows POST

2016-06-17 Thread Niphlod
how can it be a rocket issue when the variable is the client and not the 
server ?

On Friday, June 17, 2016 at 1:36:29 AM UTC+2, Dave S wrote:
>
> I'm a bad boy and still using the Rocket server that comes with web2py.  
> Today I ran into an interesting case.  My client code sends a dump file to 
> the server using a POST command.  On linux systems, this completes in a 
> reasonable amount of time, gets the result (json string), and both sides 
> are happy.  On several Windows systems, the client reports all done, and is 
> happy, but the server logs don't have anything and the file doesn't show 
> up.  [tick tick tick ... time passes] Oh, yes there is something!  
> Everything now looks good, except that web2py.log has this from Rocket:
>
> 2016-06-16 22:10:34,846 - Rocket.Errors.Thread-5 - ERROR - Unhandled Error 
> when serving connection:
> Traceback (most recent call last):
>
>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1337, 
> in run
> self.run_app(conn)
>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1851, 
> in run_app
> self.write(data, sections)
>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1766, 
> in write
> self.send_headers(data, sections)
>   File "/home/ec2-user/web2py/web2py-2.14.6/gluon/rocket.py", line 1750, 
> in send_headers
> self.conn.sendall(b(header_data))
>   File "/usr/lib64/python2.7/socket.py", line 228, in meth
> return getattr(self._sock,name)(*args)
> error: [Errno 32] Broken pipe
>
>
> Timeout seems to be on the order of an hour.  Linux client code uses 
> libcurl, and Windows client code uses Winsock.
> The above clip is from web2py-2.14.6 running on an AWS server, from the 
> zip file which has Rocket 1.2.6.
>
> Is this an issue with Rocket, or with Winsock, or each playing to the 
> other's weakness?  When I finally move to nginx, will these errors go away?
>
> /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] Problem with custom upload

2016-06-17 Thread Richard Vézina
What happen if you put back org instead of com it is does fix things it
kind of confirm that the issue come in part from there...

On Fri, Jun 17, 2016 at 10:25 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello Annet,
>
> Are you changing routes?
>
> On Fri, Jun 17, 2016 at 9:12 AM, 'Annet' via web2py-users <
> web2py@googlegroups.com> wrote:
>
>> I have the following function:
>>
>> def logo():
>> vertexID = get_vertexID(auth, session)
>> folder = 'vertexID' + str(vertexID)
>> table.image.uploadfolder =
>> os.path.join(request.env.applications_parent, 'applications',
>> 'dbmodel', 'static',
>> 'uploads', folder)
>>
>> record = table(vertexID=vertexID)
>>
>> form = SQLFORM(table, record, deletable=False, showid=False,
>>upload=URL('dbmodel', 'static', 'uploads', folder,
>> args=request.vars.image))
>> if hasattr(request.vars.image, 'filename'):
>> form.vars.imageFilename = request.vars.image.filename
>>
>> if form.process().accepted:
>> get_flash(session, None, 'success', 'success')
>> redirect(rdrctUrl)
>> elif form.errors:
>> get_flash(response, None, 'danger', 'error')
>> elif not response.flash:
>> get_flash(response, None 'info', 'info')
>>
>> return dict(form=form)
>>
>> This did work, however, after changing the applications name from org to
>> com
>> it no longer does, I get the following error:
>>
>>
>> Traceback (most recent call last):
>>   File "/Users/iannet/web2py/gluon/restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "/Users/iannet/web2py/applications/com/controllers/image.py" 
>> , line 
>> 190, in 
>>   File "/Users/iannet/web2py/gluon/globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
>> return action(*a, **b)
>>   File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
>> return action(*a, **b)
>>   File "/Users/iannet/web2py/applications/com/controllers/image.py" 
>> , line 
>> 66, in logo
>> upload=URL('dbmodel', 'static', 'uploads', folder, 
>> args=request.vars.image))
>>   File "/Users/iannet/web2py/gluon/html.py", line 285, in URL
>> application = r.application
>> AttributeError: 'str' object has no attribute 'application'
>>
>>
>>
>> Function argument list
>>
>> (a='dbmodel', c='static', f='uploads', r='vertexID1147', args=[],
>> vars={}, anchor='', extension=None, env=None, hmac_key=None,
>> hash_vars=True, salt=None, user_signature=None, scheme=None, host=None,
>> port=None, encode_embedded_slash=False, url_encode=True, language=None)
>>
>>
>> 284.
>> 285.
>>
>> 286.
>> 287.
>> 288.
>> 289.
>>
>> from globals import current
>> if hasattr(current, 'request'):
>> r = current.request
>>
>> if r:
>> application = r.application
>>
>> controller = r.controller
>> function = r.function
>> env = r.env
>> if extension is None and r.extension != 'html':
>>
>>
>>
>> Variables
>> application None
>> r 'vertexID1147'
>> r.application undefined
>>
>> According to variables r has the value vertexID1147, which is the name of
>> the folder
>> where the logo should be stored.
>>
>> Has this anything to with changing the applications name? In installed
>> applications org came after dbmodel,
>> now com comes before dbmodel. Or is there something else wrong?
>>
>>
>> Kind regards,
>>
>> Annet
>>
>> --
>> 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.


Re: [web2py] Problem with custom upload

2016-06-17 Thread Richard Vézina
Hello Annet,

Are you changing routes?

On Fri, Jun 17, 2016 at 9:12 AM, 'Annet' via web2py-users <
web2py@googlegroups.com> wrote:

> I have the following function:
>
> def logo():
> vertexID = get_vertexID(auth, session)
> folder = 'vertexID' + str(vertexID)
> table.image.uploadfolder =
> os.path.join(request.env.applications_parent, 'applications',
> 'dbmodel', 'static',
> 'uploads', folder)
>
> record = table(vertexID=vertexID)
>
> form = SQLFORM(table, record, deletable=False, showid=False,
>upload=URL('dbmodel', 'static', 'uploads', folder,
> args=request.vars.image))
> if hasattr(request.vars.image, 'filename'):
> form.vars.imageFilename = request.vars.image.filename
>
> if form.process().accepted:
> get_flash(session, None, 'success', 'success')
> redirect(rdrctUrl)
> elif form.errors:
> get_flash(response, None, 'danger', 'error')
> elif not response.flash:
> get_flash(response, None 'info', 'info')
>
> return dict(form=form)
>
> This did work, however, after changing the applications name from org to
> com
> it no longer does, I get the following error:
>
>
> Traceback (most recent call last):
>   File "/Users/iannet/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/Users/iannet/web2py/applications/com/controllers/image.py" 
> , line 
> 190, in 
>   File "/Users/iannet/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
>   File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
> return action(*a, **b)
>   File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
> return action(*a, **b)
>   File "/Users/iannet/web2py/applications/com/controllers/image.py" 
> , line 66, 
> in logo
> upload=URL('dbmodel', 'static', 'uploads', folder, 
> args=request.vars.image))
>   File "/Users/iannet/web2py/gluon/html.py", line 285, in URL
> application = r.application
> AttributeError: 'str' object has no attribute 'application'
>
>
>
> Function argument list
>
> (a='dbmodel', c='static', f='uploads', r='vertexID1147', args=[], vars={},
> anchor='', extension=None, env=None, hmac_key=None, hash_vars=True,
> salt=None, user_signature=None, scheme=None, host=None, port=None,
> encode_embedded_slash=False, url_encode=True, language=None)
>
>
> 284.
> 285.
>
> 286.
> 287.
> 288.
> 289.
>
> from globals import current
> if hasattr(current, 'request'):
> r = current.request
>
> if r:
> application = r.application
>
> controller = r.controller
> function = r.function
> env = r.env
> if extension is None and r.extension != 'html':
>
>
>
> Variables
> application None
> r 'vertexID1147'
> r.application undefined
>
> According to variables r has the value vertexID1147, which is the name of
> the folder
> where the logo should be stored.
>
> Has this anything to with changing the applications name? In installed
> applications org came after dbmodel,
> now com comes before dbmodel. Or is there something else wrong?
>
>
> Kind regards,
>
> Annet
>
> --
> 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.


Re: [web2py] Re: show map on grid view

2016-06-17 Thread 黄祥
thanks manuele, i've tried that but the result is same (no error occured 
but the result is not expected, google maps show almost take the sqlform 
grid view entirely).
e.g.
def check_point_admin(row):
scr0 = SCRIPT("""
function initMap() {
var mapDiv = document.getElementById(%s);
document.getElementById(%s).setAttribute("style","width:10px");
document.getElementById(%s).setAttribute("style","height:10px");
document.getElementById(%s).style.width='10px';
document.getElementById(%s).style.height='10px';

var latlon = new google.maps.LatLng( %s, %s );

var mapOptions = {
center: latlon,
zoom: 15
};

var map = new google.maps.Map(mapDiv, mapOptions);

var marker = new google.maps.Marker({
   position: latlon, 
   map: map
  });
}
""" % (row.id, row.id, row.id, row.id, row.id, row.lat, row.lon)
)

scr1 = SCRIPT(
_src="https://maps.googleapis.com/maps/api/js?callback=initMap";
)

#return DIV(_id = row.id, _style="width: 1%; height: 1%"), scr0, scr1
#return DIV(DIV(_id = row.id, _style="width: 1%; height: 1%"), scr0, scr1)
return SPAN(DIV(_id = row.id, _style="width: 1%; height: 1%"), scr0, scr1)

def report_check_point():
table = db.check_point
links = [dict(header = T('Image'), 
  body = lambda row: check_point_admin(row)
 )
]
grid = SQLFORM.smartgrid(table, links = links)
return locals()

tried both suggestions (you and massimo) got the same result, i even set 
the style width & height on the SCRIPT(), but got the same result

thanks and best regards,
stifan

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


[web2py] Problem with custom upload

2016-06-17 Thread 'Annet' via web2py-users
I have the following function:

def logo():
vertexID = get_vertexID(auth, session)
folder = 'vertexID' + str(vertexID)
table.image.uploadfolder = 
os.path.join(request.env.applications_parent, 'applications',
'dbmodel', 'static', 'uploads', 
folder)

record = table(vertexID=vertexID)

form = SQLFORM(table, record, deletable=False, showid=False,
   upload=URL('dbmodel', 'static', 'uploads', folder, 
args=request.vars.image))
if hasattr(request.vars.image, 'filename'):
form.vars.imageFilename = request.vars.image.filename

if form.process().accepted:
get_flash(session, None, 'success', 'success')
redirect(rdrctUrl)
elif form.errors:
get_flash(response, None, 'danger', 'error')
elif not response.flash:
get_flash(response, None 'info', 'info')

return dict(form=form)

This did work, however, after changing the applications name from org to com
it no longer does, I get the following error:


Traceback (most recent call last):
  File "/Users/iannet/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/Users/iannet/web2py/applications/com/controllers/image.py" 
, line 190, 
in 
  File "/Users/iannet/web2py/gluon/globals.py", line 417, in 
self._caller = lambda f: f()
  File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
return action(*a, **b)
  File "/Users/iannet/web2py/gluon/tools.py", line 4258, in f
return action(*a, **b)
  File "/Users/iannet/web2py/applications/com/controllers/image.py" 
, line 66, 
in logo
upload=URL('dbmodel', 'static', 'uploads', folder, args=request.vars.image))
  File "/Users/iannet/web2py/gluon/html.py", line 285, in URL
application = r.application
AttributeError: 'str' object has no attribute 'application'



Function argument list 

(a='dbmodel', c='static', f='uploads', r='vertexID1147', args=[], vars={}, 
anchor='', extension=None, env=None, hmac_key=None, hash_vars=True, 
salt=None, user_signature=None, scheme=None, host=None, port=None, 
encode_embedded_slash=False, url_encode=True, language=None)


284.
285.

286.
287.
288.
289.

from globals import current
if hasattr(current, 'request'):
r = current.request

if r:
application = r.application

controller = r.controller
function = r.function
env = r.env
if extension is None and r.extension != 'html':



Variables 
application None 
r 'vertexID1147' 
r.application undefined

According to variables r has the value vertexID1147, which is the name of 
the folder
where the logo should be stored.

Has this anything to with changing the applications name? In installed 
applications org came after dbmodel,
now com comes before dbmodel. Or is there something else wrong?


Kind regards,

Annet

-- 
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] simple file uploader to database as a plugin

2016-06-17 Thread Manuele Pesenti
Il 14/06/16 20:50, Vic Ding ha scritto:
> It works when I directly access the index page, however when I LOAD it
> to other pages it stops working. No ticket, no error. 
> |
> {{=LOAD('plugin_upload_file','index',args=('item',item_id),user_signature=True)}}
> |
>
>
> Any idea?

maybe it could help:
http://www.web2py.com/books/default/chapter/29/12/components-and-plugins#Ajax-post-does-not-support-multipart-forms

>From a vary fast reading I think it's just about a case like yours...

M.

-- 
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] How do I redirect to a different application from one application?

2016-06-17 Thread Manuele Pesenti
Il 17/06/16 14:31, Steve Joe ha scritto:
> I know how redirect works. But I am not sure how to redirect to
> another app on the same web2py site. 
> i dont want to put long url , something like this:
> redirect("http://127.0.0.1:8000/port/";)
> as it looks so naive
> [...]
>
>
>
> http://www.web2py.com/books/default/chapter/29/04/the-core#URL
> 
>
So this is what you are looking for ^
:)

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


Re: [web2py] How do I redirect to a different application from one application?

2016-06-17 Thread Anthony
Use the URL function with the app name as the first argument. It's all in the 
docs.

-- 
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] How do I redirect to a different application from one application?

2016-06-17 Thread Steve Joe
I know how redirect works. But I am not sure how to redirect to another app 
on the same web2py site. 
i dont want to put long url , something like this:
redirect("http://127.0.0.1:8000/port/";)
as it looks so naive

On Friday, June 17, 2016 at 12:28:06 PM UTC+5:30, Manuele wrote:
>
> Il 17/06/16 08:20, Steve Joe ha scritto: 
> > exact syntax? 
>
> Have you looked for it in the doc? 
>
>
> http://www.web2py.com/books/default/chapter/29/04/the-core?#HTTP-and-redirect 
>
> http://www.web2py.com/books/default/chapter/29/04/the-core#URL 
>
> Cheers 
>
> M. 
>
>

-- 
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] How do I sort a list containing the rows of a db query according to a db table field?

2016-06-17 Thread Manuele Pesenti
Il 17/06/16 11:06, Steve Joe ha scritto:
> def index():
> skills=db(db.skills.id>0).select()
> pro_lang=[]
> fake=[]
> for skill in skills:
> if skill.skilltype=="Programming Languages":
> pro_lang.append(skill)
> else:
> fake.append(skill)
> # how do i sort both the arrays as per the field skill.comfort ?
> return locals()

why do not simply do db(db.skills.id>0).select(orderby=db.skills.comfort) ?

:)

M.

-- 
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] How do I sort a list containing the rows of a db query according to a db table field?

2016-06-17 Thread Anthony
Why don't you use orderby to have the database do the sorting? Since you will 
then loop through the records in order, both lists will be generated in order.

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: db.commit() in module

2016-06-17 Thread Pierre
ok, now it is as clear as crystal   :)

thanks a lot guys. I appreciate your support

soon moving on to the most attractive part : "his Majesty the Scheduler"

-- 
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] Why is this simple join not rendering?

2016-06-17 Thread Massimiliano
I think you need to refer to fields in this way:

{{=customer.customer.first_name}}
{{=customer.customer_type.type_name}}

On Fri, Jun 17, 2016 at 8:56 AM, Greenpoise  wrote:

> so I have this simple join:
>
> query = (db.customer.id > 0) & (db.customer_type.id
> ==db.customer.customer_type)
>
> all_customers = db(query).select()
>
> return dict(all_customers = all_customers)
>
> and my view:
>
> {{for customer in all_customers:}}
> 
>   {{=customer.first_name}}
>   {{=customer.last_name}}
>   {{=customer_type.type_name}}
>   {{=customer.email}}
>   {{=customer.home_number}}
>  {{pass}}
>
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Dynamic path built for a .svg file using uuid and passing the constructed path to view not working

2016-06-17 Thread Rahul
Hi All,
   I am using uuid to create new temporary files for PYGAL chart. 
Although I can see the file being created and available in the file system. 
Even I can view the file in the browser, however when I serialize the path 
variable to be passed to the view, I get an error - A 404 not found error 
is shown inside a frame in my view. How do I serialize the path at runtime 
to src= in the view such that it should take the path that I have 
constructed using dynamicLinechartpath.. ? Below is the code
  
unique_filename = (str(uuid.uuid4()) +'.svg')
##...other code
## This creates the file in the file system
linechart.render_to_file(os.path.join(request.folder,'static/charts/' + 
unique_filename))

## Constructing the path to pass to the view 
dynamicLinechartpath = (""" "{{=URL(r=request, c='static', f='charts/""" + 
unique_filename + """')}}" """)



Calling the path in view - 

   
 

I have tried 
src="{{=dynamicLinechartpath}}
but  it does not work.  Is this proper approach ? What am I doing wrong?
Here is what 'response.flash' shows me in my view when I try to check what 
is being passed. which I think is looking good.
"{{=URL(r=request, c='static', 
f='charts/bf094fa3-a711-4118-a3aa-89f647cca4f1.svg')}}" 

Please suggest,
Rahul D.

-- 
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: Why is this simple join not rendering?

2016-06-17 Thread Marlysson Silva
Pops up some traceback?

Em sexta-feira, 17 de junho de 2016 03:56:57 UTC-3, Greenpoise escreveu:
>
> so I have this simple join:
>
> query = (db.customer.id > 0) & (db.customer_type.id
> ==db.customer.customer_type)
>
> all_customers = db(query).select()
>
> return dict(all_customers = all_customers)
>
> and my view:
>
> {{for customer in all_customers:}}
> 
>   {{=customer.first_name}}
>   {{=customer.last_name}}
>   {{=customer_type.type_name}}
>   {{=customer.email}}
>   {{=customer.home_number}}
>  {{pass}}
>
>
>

-- 
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: Update Pure HTML form

2016-06-17 Thread Jeff Riley
Anthony.  It was me being a complete idiot.  I had not removed the HTML 
form tags.  I have attached the code that is working perfectly now.  Thank 
you so much for have the patience of a Saint.

On Wednesday, June 15, 2016 at 8:52:22 AM UTC-5, Jeff Riley wrote:
>
> All.  I was going to link this to my "Pure HTML Form" question just not 
> sure how to do that.  As you see in that question I was able to get past my 
> copy paste issue and get the create form to work perfectly.  Thank you all 
> for the extra eyes.
>
> Now I am building the update form and I am getting "user is tampering with 
> form's record_id: None != 1".  I have tried removing the _formkey and 
> setting session=None, but that does not seem to work either.  Have been 
> searching the docs but nothing is slapping me upside the head.
>
> Any ideas?
>

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


WorkingCreateForm.docx
Description: MS-Word 2007 document


WorkingUpdateForm.docx
Description: MS-Word 2007 document


[web2py] How do I sort a list containing the rows of a db query according to a db table field?

2016-06-17 Thread Steve Joe
def index():
skills=db(db.skills.id>0).select()
pro_lang=[]
fake=[]
for skill in skills:
if skill.skilltype=="Programming Languages":
pro_lang.append(skill)
else:
fake.append(skill)
# how do i sort both the arrays as per the field skill.comfort ?
return locals()

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