[web2py] SOAP & WSDL

2018-01-17 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi all.
Excuse for some off topic.
I need to up a SOAP service so i think to use web2py.
I have wsdl file.
I use wsdl2interface for convert wsdl into Python clasesThis is my wsdl file:
 http://oap/ser - 
Pastebin.com

  
|  
|   
|   
|   ||

   |

  |
|  
|   |  
 http://oap/services/checkHolderBillingSynDonorRequestService.    """
    def checkHolderBillingSynDonorRequest(RequestMessageHeader, 
checkHolderBillingSynDonorRequestBody):        """Parameters:                
``RequestMessageHeader`` -- IRequestMessageHeader        
``checkHolderBillingSynDonorRequestBody`` -- 
ICheckHolderBillingSynDonorRequestBody                Returns: 
checkHolderBillingSynDonorResponse        """
I do not understand the difition of method checkHolderBillingSynDonorRequest
Whats parameter i must receive?The data received will be in xml?What i must 
return?

I have never used soap before.
i will appreciate any tips or help for resolv my problem
Regards

-- 
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] Call a javascript function from SQLFORM.smartgrid

2017-03-24 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear Nico.
Thank you for you answer.
I use a sqlform.smart grid for show records from database, i want to do a call 
Restful for show especific record clicked using ajax
My problem is i not know how i implement onclick function on sqlform.smart grid
Regards 

On Friday, March 24, 2017 6:20 AM, Nico de Groot  
wrote:
 

 A client-side javascript function can't be triggered by a link. You can define 
a onclick attribute containing a call to a javascript function. If you want to 
use a row id as a parameter you have to make it available as a data attribute.

It's not clear what you want and why.  Maybe you have to grasp the serverside - 
clientside concept better first. Lookup 'javascript' and play around with tools 
like jsfiddle.

Nico de Groot

-- 
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] Call a javascript function from SQLFORM.smartgrid

2017-03-18 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.
How a i can call a javascript function from a link of sqlform.grid
My controller:
  d=datetime.datetime.strptime(request.vars.desde, "%d/%m/%Y %H:%M:%S") \    if 
request.vars.desde else 
datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d
 00:00:00'), \        '%Y-%m-%d %H:%M:%S')    
h=datetime.datetime.strptime(request.vars.hasta, "%d/%m/%Y %H:%M:%S") \    if 
request.vars.hasta else 
datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d
 23:59:59'), \        '%Y-%m-%d %H:%M:%S')
    form = SQLFORM.factory(Field('desde','datetime', 
requires=IS_DATETIME(format='%Y-%m-%d %H:%M:%S'),default=d),                    
        Field('hasta','datetime',requires=IS_DATETIME(format='%Y-%m-%d 
%H:%M:%S'), default=h),formstyle='table2cols',method='POST')

 orderby=~db.mensajes.id    links=[dict(header='Detalle',body=lambda row: 
A(IMG(_src=URL(c='static',f='images/view.png'), _width=24, _height=24), 
_href=URL('showsms', args=[row.mensajes.id])))]    #links = [lambda row: A('Ver 
SMS',_href=URL("default","showsms",args=[row.id]))]    
query=(db.mensajes.id_cia==auth.user.cia) & (db.mensajes.fenvio>=d) & 
(db.mensajes.fenvio<=d)    
left=[db.estadosms.on(db.mensajes.estado==db.estadosms.id)]    
fields=[db.mensajes.id,db.mensajes.numero,db.mensajes.msg,db.mensajes.fecha,db.mensajes.fenvio,db.mensajes.fentrega,db.mensajes.respuesta,db.mensajes.frespuesta,db.estadosms.n$

    if form.process().accepted:
        d,h=form.vars.desde,form.vars.hasta
    query=(db.mensajes.id_cia==auth.user.cia) & (db.mensajes.fenvio>=d) & 
(db.mensajes.fenvio<=h)
    table=SQLFORM.smartgrid(db.mensajes, 
constraints=dict(mensajes=query),fields=fields,orderby=orderby,left=left,searchable=True,args=request.args[:1],links=links,
       exportclasses=dict(xml=False, html=False, json=False, tsv=False, 
tsv_with_hidden_cols=False),details=False,create=False,editable=False,deletable=False,csv=True,paginate=50,formstyle='bootstrap')
 return dict(form=form,table=table)




My View:{{extend 'layout.html'}}
Formulario Reporte Mensajes
     {{=form}}     {{=table}}


function getData(id) {    alert('blablabla');
}


How i call function getData(id) from link of sqlform.smartgrid and this 
function receive id row as parameter?




-- 
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] Web2py and WebRTC?

2016-08-10 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear Massimo.I did tested opentok great tip!!!
Regards
 

On Saturday, August 6, 2016 4:43 AM, Massimo Di Pierro 
 wrote:
 

 I would use opentok

On Tuesday, 2 August 2016 19:46:07 UTC-5, Ron Chatterjee wrote:
This may help. Its a django app. Someone needs to take a stab at this to 
convert into web2py. 
https://github.com/ craigmadden/videochat


On Sunday, July 28, 2013 at 8:42:19 PM UTC-4, Vinicius Assef wrote:
WebRTC has nothing to do with web2py.

It's a client specification, concerning basically audio and video
capturing and transmission.
It's accessed through javascript.

On Sun, Jul 28, 2013 at 9:37 PM, Ovidio Marinho  wrote:
> you did this work in web2py?? you can publish the app? this is very good?
>
>
>
>
>          Ovidio Marinho Falcao Neto
>                   ITJP.NET.BR
>              ovid...@gmail.com
>                83   8826 9088 - Oi
>                83   9336 3782 - Claro
>                         Brasil
>
>
>
> 2013/7/28 Mika Sjöman 
>>
>> Hi
>>
>> I would like the users of my website to communicate with video without
>> using Skype etc. I am currently using pythonanywhere as my host, and they do
>> not permit using node.js, so I can not use
>> https://github.com/ henrikjoreteg/SimpleWebRTC
>>
>> Is there any other way you guys know of that I could use to easily add
>> WebRTC to the webpage? Anyone wrote a plugin for that? Anything I should
>> know before jumping into it?
>>
>> 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+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+un...@googlegroups.com.
> For more options, visit https://groups.google.com/ groups/opt_out.
>
>


-- 
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] Web2py and WebRTC?

2016-08-04 Thread 'Fernando Villarroel' via web2py-users
Thank you Antonio

Enviado desde mi iPhone

> El 04-08-2016, a las 4:51, António Ramos <ramstei...@gmail.com> escribió:
> 
> https://www.youtube.com/watch?v=MUWy-NSrvNQ
> 
> 2016-08-03 19:26 GMT+01:00 'Fernando Villarroel' via web2py-users 
> <web2py@googlegroups.com>:
>> Dear.
>> 
>> I think the deploy coments use a server like Asterisk or FreeSWITCH.
>> 
>> So the deploy from Django surely use some library JavaScript for comunícate 
>> browsers like sip.js or another with websocket server (Asterisk or 
>> FreeSWITCH ).
>> 
>> Regarding about webrtc i deploy a server webrtc using FreeSWITCH 1.6
>> 
>> https://freeswitch.org/confluence/plugins/servlet/mobile#content/view/7144556
>> 
>> But i need know how i can do a websocket call to a single peer (browser 
>> user) from the server ws (FreeSWITCH); peer to peer
>> 
>> From web2py i know that i can use tornado; but i do know how i can do
>> 
>> Anyone could me some example?
>> 
>> Regards
>> 
>> Enviado desde mi iPhone
>> 
>>> El 03-08-2016, a las 10:14, Ron Chatterjee <achatterjee...@gmail.com> 
>>> escribió:
>>> 
>>> Have you implemented something similar webrtc + web2py?
>>> 
>>> -- 
>>> 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.
> 
> -- 
> 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] Web2py and WebRTC?

2016-08-03 Thread 'Fernando Villarroel' via web2py-users
Dear.

I think the deploy coments use a server like Asterisk or FreeSWITCH.

So the deploy from Django surely use some library JavaScript for comunícate 
browsers like sip.js or another with websocket server (Asterisk or FreeSWITCH ).

Regarding about webrtc i deploy a server webrtc using FreeSWITCH 1.6

https://freeswitch.org/confluence/plugins/servlet/mobile#content/view/7144556

But i need know how i can do a websocket call to a single peer (browser user) 
from the server ws (FreeSWITCH); peer to peer

>From web2py i know that i can use tornado; but i do know how i can do

Anyone could me some example?

Regards

Enviado desde mi iPhone

> El 03-08-2016, a las 10:14, Ron Chatterjee  
> escribió:
> 
> Have you implemented something similar webrtc + web2py?
> 
> -- 
> 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] Open a form popup only some user registered

2016-06-21 Thread 'Fernando Villarroel' via web2py-users
Ok Richard 
Thank you for you answer.

Enviado desde mi iPhone

> El 21-06-2016, a las 11:25, Richard Vézina <ml.richard.vez...@gmail.com> 
> escribió:
> 
> You will need websocket_messaging/tornado for doing such a thing...
> 
> Richard
> 
>> On Tue, Jun 21, 2016 at 12:21 AM, 'FERNANDO VILLARROEL' via web2py-users 
>> <web2py@googlegroups.com> wrote:
>> Dear All.
>> 
>> I hope you could me explain how i can do the follow idea:
>> 
>> If a have a user registered like username  in my  web2py site.
>> 
>> I have another application like asterisk (IP PBX) so when asterisk received 
>> a inbound a call for user  i need that the browser of user  (only 
>> browser of this user) open a form pop with parameters received from external 
>> application like phone numember..etc.
>> i do not know how i can do a remote call process to web2py and i need this 
>> remote call only open a window popup only for this user registered (or only 
>> for session of this user ).
>> 
>> I hope you could understand me and tell me some idea or example about how i 
>> can do.
>> 
>> Regards
>> 
>> 
>> -- 
>> 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.

-- 
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] Open a form popup only some user registered

2016-06-20 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.
I hope you could me explain how i can do the follow idea:
If a have a user registered like username  in my  web2py site.
I have another application like asterisk (IP PBX) so when asterisk received a 
inbound a call for user  i need that the browser of user  (only browser 
of this user) open a form pop with parameters received from external 
application like phone numember..etc.i do not know how i can do a remote 
call process to web2py and i need this remote call only open a window popup 
only for this user registered (or only for session of this user ).
I hope you could understand me and tell me some idea or example about how i can 
do.
Regards

-- 
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] sqlform.smartgrid from custom datefield from sqlform.factory

2015-05-26 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi.
I need you help, any idea how i can solve my problem.
Regards 


 On Monday, May 25, 2015 11:03 PM, 'FERNANDO VILLARROEL' via web2py-users 
web2py@googlegroups.com wrote:
   

 Dear All
I have problem when i click on pagination of sqlform.smartgrid because my 
custom date field change to today and i lost data
def index():
   d=datetime.datetime.strptime(request.vars.desde, %d/%m/%Y %H:%M:%S) \      
      if request.vars.desde else 
datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d
 00:00:00'), \                                        '%Y-%m-%d %H:%M:%S')

query =((auth.user.id==db.cdr.accountcode)  (db.cdr.billsec0)  
(db.cdr.start_stamp=d))

 form = SQLFORM.factory(Field('desde','datetime', 
requires=IS_DATETIME(format='%Y-%m-%d %H:%M:%S'),default=d))

 if form.accepts(request.vars,session):

                query =((auth.user.id==db.cdr.accountcode)  (db.cdr.billsec0) 
 (db.cdr.start_stamp=form.vars.desde))

table=SQLFORM.smartgrid(db.cdr, 
constraints=dict(cdr=query),fields=fields,orderby=orderby,                      
          
details=False,create=False,editable=False,deletable=False,csv=True,paginate=50) 


return dict(form=form,table=table)



How i can do?
REgards
PD: Excuse my english-- 
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] sqlform.smartgrid from custom datefield from sqlform.factory

2015-05-25 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All
I have problem when i click on pagination of sqlform.smartgrid because my 
custom date field change to today and i lost data
def index():
   d=datetime.datetime.strptime(request.vars.desde, %d/%m/%Y %H:%M:%S) \      
      if request.vars.desde else 
datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d
 00:00:00'), \                                        '%Y-%m-%d %H:%M:%S')

query =((auth.user.id==db.cdr.accountcode)  (db.cdr.billsec0)  
(db.cdr.start_stamp=d))

 form = SQLFORM.factory(Field('desde','datetime', 
requires=IS_DATETIME(format='%Y-%m-%d %H:%M:%S'),default=d))

 if form.accepts(request.vars,session):

                query =((auth.user.id==db.cdr.accountcode)  (db.cdr.billsec0) 
 (db.cdr.start_stamp=form.vars.desde))

table=SQLFORM.smartgrid(db.cdr, 
constraints=dict(cdr=query),fields=fields,orderby=orderby,                      
          
details=False,create=False,editable=False,deletable=False,csv=True,paginate=50) 


return dict(form=form,table=table)



How i can do?
REgards
PD: Excuse my english

-- 
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] Heroku deploy

2015-03-03 Thread 'Fernando Villarroel' via web2py-users
 web2py@googlegroups.com
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (1.0)

Dear All.

I have my app in my home folder ~/web2py/application/foo

I do not understand how i can deploy on Heroku

Anyone can explain how i can do

I am trying to follow the book guide but i do not understand.
I am using git bitbucket on my foo app folder.
And i have a Heroku account.

Regards

Enviado desde mi iPhone

-- 
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] web2py and sublime test

2015-01-04 Thread 'Fernando Villarroel' via web2py-users
+1

Enviado desde mi iPhone

 El 03-01-2015, a las 23:32, Massimo Di Pierro massimo.dipie...@gmail.com 
 escribió:
 
 I came across this: 
 
 https://github.com/cassiobotaro/my_environment
 
 Useful!
 -- 
 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: happy holidays everybody

2014-12-24 Thread 'FERNANDO VILLARROEL' via web2py-users
pyDAL +10

I wish you merry christmas and happy new year Massimo and everybody of this 
community.
Fernando 

 On Wednesday, December 24, 2014 12:48 PM, DJ sebastianjaya...@gmail.com 
wrote:
   

 Congrats Massimo and happy holidays!

On Wednesday, December 24, 2014 8:48:18 AM UTC-5, Massimo Di Pierro wrote:
I wish a happy holidays to everybody in this community.
As a Christmas present and mostly the work of Giovanni Barillari we have 
re-released the web2py DAL as a separate Python package under the BSD license:
https://pypi.python.org/pypi/ pyDAL
https://github.com/web2py/ pydal

Now you can more easily use the web2py DAL from any python app. Simply do
pip install pyDAL from pydal import DAL, Field
 db = DAL('sqlite://storage.db')
 db.define_table('thing',Field( 'name'))
 db.thing.insert(name=Chair')you know the rest... ;-)
Massimo



-- 
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] Backend and FrontEnd dev

2014-12-17 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.
Some customer need a application like a Desktop application (visual basic, 
wxPython, etc.) and reports.
I think to use web2py, but i need to do rich windows (widgets or RIA). I am 
searching how i can do so i found qooxdoo.For reports i think to use Reportlab.
My web development experience is some low, but i think this is my opportunity 
to learn.  

So i think to use web2py like bakend and  qooxdoo like front end.
I need to know your recomendation, it's fine that  i use web2py and qooxdoo.? 
And someone could me explain how i can use both technologies.Do you recommend 
to me use another libs like bootstrap for to do rich windows?
I hope look your feedback and recomendations of how i can do and not die to 
trying

Regards
Pd. Excuse my english.

-- 
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: Audio wav file

2014-11-06 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi.

The follow script it works;

audio src={{=URL(a=request.application, c='static', 
f='2014-11-04-19-20-19_994491803_448908901.wav')}} controls=controls 
type=audio/wav
Your browser does not support the audio element.
/audio
And this works in Firefox but not in Chrome, why?. I am use latest version of 
firefox and Chrome.
But my problem is that the wav file is a variable,so i try to use:

f='{{=filename}}'


But i received a exception:

response.write(URL(a=request.application, c='static', f='{{=filename)
^
SyntaxError: EOL while scanning string literal

Regards



On Thursday, November 6, 2014 1:23 AM, LoveWeb2py atayloru...@gmail.com wrote:
 


Where is your /tmp folder located? Is it the actual /tmp folder located in the 
root of linux? I would recommend moving it to 
/web2py_src/web2py/applications/static/audio

You could then reference the file like this:

audio controls
source src={{=URL('static','audio/sound.wav')}}
/audio
with nothing in the controller.

Also, this application Massimo created may come in handy for you: 
https://www.reddit.com/r/Python/comments/1r7v23/audio_streaming_app_in_web2py_from_scratch/

Hope this helps...

On Wednesday, November 5, 2014 2:52:46 PM UTC-5, visuallinux wrote:
Dear all.


I need to play a sound file (.wav)


I am trying like this:


controler:


def play():


filename='2014-11-04-19-20- 19_994491803_448908901.wav'
ff=XML('''source src={{URL('static',args='%s')} } 
 type=audio/wav''' % filename)
return dict(ff=ff)


view:


play.html


!DOCTYPE html
{{extend 'layout.html'}}
 div


audio controls 
{{=ff}}
/audio
 /div


But not works


For my test, the wav file is static folder, but in production the wav files 
are in /tmp folder.


What i am doing wrong and how i can play files from /tmp folder 


Regards








-- 
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] Audio wav file

2014-11-05 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear all.

I need to play a sound file (.wav)

I am trying like this:

controler:

def play():

filename='2014-11-04-19-20-19_994491803_448908901.wav'
ff=XML('''source src={{URL('static',args='%s')}} type=audio/wav''' 
% filename)
return dict(ff=ff)

view:

play.html

!DOCTYPE html
{{extend 'layout.html'}}
 div

audio controls 
{{=ff}}
/audio
 /div

But not works

For my test, the wav file is static folder, but in production the wav files are 
in /tmp folder.

What i am doing wrong and how i can play files from /tmp folder 

Regards

-- 
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] Features as Modules

2014-11-03 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.

I need to add new features to my application like a modules; something like 
purchases module, sales module, etc. 
The idea is that each new module installed enable the respective option menu. 

My idea is to create folders within the folder modules such as sales folder; 
inside are the * .py script of module sales, I hope understand me:

~application/foo/modules/sales/

Also I take it that if I install a module that enables a choice of menu, this 
script should be within their respective controllers; then you should be:


~application/foo/controlllers/sales.py

sales.py
from sales import *

So in sales.py module is the bussines logic.

and

~application/foo/views/sales/sales.html

Any suggestions or how i can do it or if someone show me an example.
Excuse my english
 
Regards.

-- 
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] Login password changed

2014-09-14 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.

For some reason i do not know, the login password on my web2py site changed. 

Is possible that someone is attack my website?, how i can prevent or solve this 
issue?

For reseted the password i must  updated auth_user like:

update auth_user set password=md('foo');

What do you think?
I must use captcha?
How i can have a log of events for know  who is change the password?

Regards.

-- 
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: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi.

The database definition ;


db.define_table('cdr',
Field('caller_id_name',length=30),
Field('caller_id_number',length=30),
Field('destination_number',length=30),
Field('context',length=20),
Field('start_stamp', datetime),
Field('answer_stamp', datetime),
Field('end_stamp',datetime),
Field('duration','integer'),
Field('billsec','integer'),
Field('hangup_cause',length=50),
Field('accountcode',db.auth_user),
Field('read_codec',length=20),
Field('write_codec',length=20),
Field('cost', 'decimal(20,6)'),
Field('carrier',length=255),
Field('rate','decimal(11,5)'), 
format='%(caller_id_number)s',migrate=False)




On Thursday, September 4, 2014 4:34 AM, Niphlod niph...@gmail.com wrote:
 


what's the table definition of db.cdr ?

On Thursday, September 4, 2014 4:29:17 AM UTC+2, visuallinux wrote:
Hi All.


I am trying to use SQLFORM.smartgrid:


query=(db.cdr.accountcode== form.vars.nombre[0])
grid=SQLFORM.smartgrid(db.cdr, constraints=dict(cdr=query), 
details=False,create=False, editable=False,deletable= False,csv=False)


But i received the follow exception:


type 'exceptions.AttributeError' 'module' object has no attribute 'split'
Versión
web2py™Version 2.9.5-stable+timestamp.2014. 03.16.02.35.39 
PythonPython 2.6.6: /usr/bin/python (prefix: /usr) 
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18. Traceback (most recent call last):
File /home/fvillarroel/www/web2py/ gluon/restricted.py, line 220, in 
restricted
exec ccode in environment
File /home/fvillarroel/www/web2py/ applications/freeswitch/ 
controllers/repocallcltes.py, line 28, in module
File /home/fvillarroel/www/web2py/ gluon/globals.py, line 385, in lambda
self._caller = lambda f: f()
File /home/fvillarroel/www/web2py/ gluon/tools.py, line 3287, in f
return action(*a, **b)
File /home/fvillarroel/www/web2py/ applications/freeswitch/ 
controllers/repocallcltes.py, line 12, in repocallcltes
grid=SQLFORM.smartgrid(db.cdr, constraints=dict(cdr=query),de 
tails=False,create=False,edita ble=False,deletable=False,csv=False)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 2800, in smartgrid
user_signature=user_signature, **kwargs)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 2255, in grid
search_menu = SQLFORM.search_menu(sfields, prefix=prefix)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 1709, in 
search_menu
ftype = field.type.split(' ')[0]
AttributeError: 'module' object has no attribute 'split' 


I do not know what i am doing wrong and if i changed smartgrid for 
sqlform.grid i reveived the same error.


Regards

-- 
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: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear,

i changed datetime with 'datetime' and now it's works

Thank You


On Thursday, September 4, 2014 8:15 AM, Niphlod niph...@gmail.com wrote:
 


tat's probabl why replace datetime with 'datetime' (notice the '')

On Thursday, September 4, 2014 1:37:51 PM UTC+2, visuallinux wrote:
Hi.


The database definition ;




db.define_table('cdr',
Field('caller_id_name',length= 30),
Field('caller_id_number', length=30),
Field('destination_number', length=30),
Field('context',length=20),
Field('start_stamp', datetime),
Field('answer_stamp', datetime),
Field('end_stamp',datetime),
Field('duration','integer'),
Field('billsec','integer'),
Field('hangup_cause',length= 50),
Field('accountcode',db.auth_ user),
Field('read_codec',length=20),
Field('write_codec',length=20) ,
Field('cost', 'decimal(20,6)'),
Field('carrier',length=255),
Field('rate','decimal(11,5)'), format='%(caller_id_number)s', 
 migrate=False)







On Thursday, September 4, 2014 4:34 AM, Niphlod nip...@gmail.com wrote:





what's the table definition of db.cdr ?

On Thursday, September 4, 2014 4:29:17 AM UTC+2, visuallinux wrote:
Hi All.


I am trying to use SQLFORM.smartgrid:


query=(db.cdr.accountcode== form.vars.nombre[0])
grid=SQLFORM.smartgrid(db.cdr, constraints=dict(cdr=query), 
details=False,create=False, editable=False,deletable= False,csv=False)


But i received the follow exception:


type 'exceptions.AttributeError' 'module' object has no attribute 'split'
Versión
web2py™Version 2.9.5-stable+timestamp.2014. 03.16.02.35.39 
PythonPython 2.6.6: /usr/bin/python (prefix: /usr) 
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18. Traceback (most recent call last):
File /home/fvillarroel/www/web2py/ gluon/restricted.py, line 220, in 
restricted
exec ccode in environment
File /home/fvillarroel/www/web2py/ applications/freeswitch/ 
controllers/repocallcltes.py, line 28, in module
File /home/fvillarroel/www/web2py/ gluon/globals.py, line 385, in lambda
self._caller = lambda f: f()
File /home/fvillarroel/www/web2py/ gluon/tools.py, line 3287, in f
return action(*a, **b)
File /home/fvillarroel/www/web2py/ applications/freeswitch/ 
controllers/repocallcltes.py, line 12, in repocallcltes
grid=SQLFORM.smartgrid(db.cdr, constraints=dict(cdr=query),de 
tails=False,create=False,edita ble=False,deletable=False,csv=False)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 2800, in smartgrid
user_signature=user_signature, **kwargs)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 2255, in grid
search_menu = SQLFORM.search_menu(sfields, prefix=prefix)
File /home/fvillarroel/www/web2py/ gluon/sqlhtml.py, line 1709, in 
search_menu
ftype = field.type.split(' ')[0]
AttributeError: 'module' object has no attribute 'split' 


I do not know what i am doing wrong and if i changed smartgrid for 
sqlform.grid i reveived the same error.


Regards


-- 
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] Geraldo Report

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.

Does anyone use Geraldo Report?

I am trying to use i follow the how to about web2py and Geraldo 
http://www.geraldoreports.org/docs/tutorial-2.html

But i received a empty pdf.

My code:

controllers/callscltes_pdf.py

def callcltes_pdf():

from reports import ReportPurchase
from geraldo.generators import PDFGenerator
import gluon.contenttype
import StringIO

r=int(request.args[0])
resp = StringIO.StringIO()

cal = db(db.cdr.accountcode==r).select(orderby=db.cdr.id)
report = ReportPurchase(queryset=cal)
report.generate_by(PDFGenerator, filename=resp)

resp.seek(0)
response.headers['Content-Type'] = gluon.contenttype.contenttype('.pdf')
filename = %s_Purchases.pdf % (request.env.server_name)
response.headers['Content-disposition'] = attachment; filename=\%s\ 
% filename
return resp.read()

 modules/reports.py

from geraldo import Report

class ReportPurchase(Report):
title = 'Purchases list'
author = 'John Smith Corporation'

The query (db(db.cdr.accountcode==r).select(orderby=db.cdr.id)) returns 50 
tuples.

I appreciate some idea or help.

Regards

-- 
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] SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-03 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi All.

I am trying to use SQLFORM.smartgrid:

query=(db.cdr.accountcode==form.vars.nombre[0])
grid=SQLFORM.smartgrid(db.cdr,constraints=dict(cdr=query),details=False,create=False,editable=False,deletable=False,csv=False)

But i received the follow exception:

type 'exceptions.AttributeError' 'module' object has no attribute 'split'
Versión
web2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 
PythonPython 2.6.6: /usr/bin/python (prefix: /usr) 
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18. Traceback (most recent call last):
File /home/fvillarroel/www/web2py/gluon/restricted.py, line 220, in restricted
exec ccode in environment
File 
/home/fvillarroel/www/web2py/applications/freeswitch/controllers/repocallcltes.py,
 line 28, in module
File /home/fvillarroel/www/web2py/gluon/globals.py, line 385, in lambda
self._caller = lambda f: f()
File /home/fvillarroel/www/web2py/gluon/tools.py, line 3287, in f
return action(*a, **b)
File 
/home/fvillarroel/www/web2py/applications/freeswitch/controllers/repocallcltes.py,
 line 12, in repocallcltes
grid=SQLFORM.smartgrid(db.cdr, 
constraints=dict(cdr=query),details=False,create=False,editable=False,deletable=False,csv=False)
File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 2800, in smartgrid
user_signature=user_signature, **kwargs)
File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 2255, in grid
search_menu = SQLFORM.search_menu(sfields, prefix=prefix)
File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 1709, in search_menu
ftype = field.type.split(' ')[0]
AttributeError: 'module' object has no attribute 'split' 

I do not know what i am doing wrong and if i changed smartgrid for sqlform.grid 
i reveived the same error.

Regards

-- 
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] Web2py Geraldo Reports

2014-09-01 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All.

I am try to use Geraldo Reports with web2py and i am following this howto:

http://www.geraldoreports.org/docs/tutorial-web2py.html


But i received a error with this import

 from reports import ReportPurchase
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named reports

what i am doing wrog?

regards

-- 
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] Personalize calendar for reservation

2014-04-13 Thread FERNANDO VILLARROEL
Dear all.

I see the post; https://groups.google.com/forum/#!topic/web2py/IIYWWB0D7e4  


I am think to do a reservation site, basically i need to input a date range :

fromfate
todate

My probem is how i can show a calendar with days in green colors for available 
days and red colors for reservated days, like this:

http://easyreservations.org/


Excuse my english
Regards

-- 
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: No module named PIL

2013-05-24 Thread Fernando Villarroel
pip install PIL



Enviado desde mi iPhone

El 25-05-2013, a las 0:35, Alex Glaros alexgla...@gmail.com escribió:

 I'll try to install it but can you please tell where and how?   I can't find 
 where Python is in the web2py folders.
 
 thanks,
 
 Alex
 
 On Friday, May 24, 2013 9:31:02 PM UTC-7, Anthony wrote:
 
 Sounds like you don't have PIL installed.
 
 -- 
  
 --- 
 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] Graphs

2013-05-03 Thread FERNANDO VILLARROEL
Dear.

I am trying to make a graph temperature vs time with NVD3.js

But it's my first experience with D3 and JsON and i think i am wrong because i 
can't show graphic.

I am getting data from a database:

My controller:

def grafico_temp():
   
rows=db(db.temperaturas).select(db.temperaturas.fecha,db.temperaturas.temp).as_list()
return dict(rows=rows)

My view:

{{extend 'layout.html'}}

link href=https://raw.github.com/novus/nvd3/master/src/nv.d3.css; 
rel=stylesheet/
script type=text/javascript 
src=https://raw.github.com/novus/nvd3/master/lib/d3.v2.min.js;/script
script type=text/javascript 
src=https://raw.github.com/novus/nvd3/master/nv.d3.min.js;/script

style
#chart svg {
  height: 400px;
}
/style

div id=chart
  svg/svg
/div



script type=text/javascript

nv.addGraph(function() {
  var chart = nv.models.lineChart();

  chart.xAxis
  .axisLabel('Fecha')
  .tickFormat(d3.format(',r'));

  chart.yAxis
  .axisLabel('Temperatura')
  .tickFormat(d3.format('.02f'));

  d3.select('#chart svg')
  .datum(data())
.transition().duration(500)
  .call(chart);

  nv.utils.windowResize(function() { d3.select('#chart 
svg').call(chart) });

 return chart;
});



function data() {

  var camara1 =  {{=response.json(rows)}} //[];
  //var t = {{=len(rows)}};
  //{{for r in rows:}}
  //  var f = {{r.fecha}}, t = {{r.temp}};  
  //for (var i = 0; i = t; i++) {
  //  camara1.push({x: f, y: t});
//cos.push({x: i, y: .5 * Math.cos(i/10)});
  //{{pass}}
  }

  return [
{
  values: camara1,
  key: 'Camara 1'
  color: '#ff7f0e'
},
  ];
}
/script


I appreciated you help.

--- On Thu, 8/16/12, Andrew awillima...@gmail.com wrote:

 From: Andrew awillima...@gmail.com
 Subject: Re: [web2py] Graphs
 To: web2py@googlegroups.com
 Date: Thursday, August 16, 2012, 7:41 AM
 I plan to do one, but you simply
 provide a json or csv service / URL with web2py, and then
 use it in a view with the d3 JavaScript code.  D3 takes
 some learning, and I still have a long way to go.
 
 -- 
 
 
 
 

-- 

--- 
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] Help Query speed

2013-01-22 Thread FERNANDO VILLARROEL
Dear.

I have the follow problem.

If i run the follows query in PgAdminIII is very fast:

select  rutas.id,rutas.nombre,ratecltes.rate from ratecltes
joinrutas on rutas.id = ratecltes.id_rutas
where   ratecltes.id_clte=26
order by rutas.nombre

But when i run the query on Web2py is very slow


query=(db.ratecltes.id_clte==session.cliente_id)
reg=db(query).select(db.rutas.id,db.rutas.nombre,db.ratecltes.rate,
left=db.rutas.on(db.rutas.id==db.ratecltes.id_rutas),
orderby=db.rutas.nombre)

The query show 2287 tuples.

I have PostgreSQL 8.4

The explain analyse
  QUERY PLAN
   
---
 Unique  (cost=1264.00..1286.87 rows=2287 width=30) (actual 
time=135.604..145.228 rows=2251 loops=1)
   -  Sort  (cost=1264.00..1269.71 rows=2287 width=30) (actual 
time=135.592..138.590 rows=2251 loops=1)
 Sort Key: rutas.nombre, rutas.id, ratecltes.rate
 Sort Method:  quicksort  Memory: 221kB
 -  Hash Join  (cost=69.65..1136.39 rows=2287 width=30) (actual 
time=17.528..34.604 rows=2251 loops=1)
   Hash Cond: (ratecltes.id_rutas = rutas.id)
   -  Seq Scan on ratecltes  (cost=0.00..1032.44 rows=2287 
width=8) (actual time=9.888..19.838 rows=2251 loops=1)
 Filter: (id_clte = 26)
   -  Hash  (cost=41.51..41.51 rows=2251 width=26) (actual 
time=7.580..7.580 rows=2251 loops=1)
 -  Seq Scan on rutas  (cost=0.00..41.51 rows=2251 
width=26) (actual time=0.013..3.853 rows=2251 loops=1)
 Total runtime: 148.293 ms

I hope you could help me.

Fernando


-- 





Re: [web2py] Help Query speed

2013-01-22 Thread FERNANDO VILLARROEL
I think found the problem.

My problem is with powerTable plugin.

If i return rows only the show results is fast, but i try to use powertable the 
result is slow:

powerTable = plugins.powerTable
powerTable.datasource = reg

powerTable.dtfeatures['bPaginate'] =  True
powerTable.dtfeatures['bAutoWidth'] = True
powerTable.dtfeatures['bSort'] = False #Se muestra ordenado por Query
powerTable.dtfeatures['iDisplayLength'] = 50
powerTable.virtualfields = Virtual()
powerTable.headers='labels'
powerTable.showkeycolumn = False
powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
powerTable.keycolumn = 'rutas.nombre'
powerTable.columns = ['rutas.nombre','ratecltes.rate','virtual.edit']
powerTable.hiddecolumns=['rutas.nombre']
table=powerTable.create()

return dict(table=table)


Any idea?

Regards

--- On Tue, 1/22/13, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:

 From: FERNANDO VILLARROEL fvillarr...@yahoo.com
 Subject: [web2py] Help Query speed
 To: web2py@googlegroups.com
 Date: Tuesday, January 22, 2013, 6:54 PM
 Dear.
 
 I have the follow problem.
 
 If i run the follows query in PgAdminIII is very fast:
 
 select  rutas.id,rutas.nombre,ratecltes.rate from
 ratecltes
 join    rutas on rutas.id = ratecltes.id_rutas
 where   ratecltes.id_clte=26
 order by rutas.nombre
 
 But when i run the query on Web2py is very slow
 
 
 query=(db.ratecltes.id_clte==session.cliente_id)
 reg=db(query).select(db.rutas.id,db.rutas.nombre,db.ratecltes.rate,
                
 left=db.rutas.on(db.rutas.id==db.ratecltes.id_rutas),
                
 orderby=db.rutas.nombre)
 
 The query show 2287 tuples.
 
 I have PostgreSQL 8.4
 
 The explain analyse
                
                
                
           QUERY PLAN   
                
                
                
        
 ---
  Unique  (cost=1264.00..1286.87 rows=2287 width=30)
 (actual time=135.604..145.228 rows=2251 loops=1)
    -  Sort 
 (cost=1264.00..1269.71 rows=2287 width=30) (actual
 time=135.592..138.590 rows=2251 loops=1)
          Sort Key:
 rutas.nombre, rutas.id, ratecltes.rate
          Sort Method: 
 quicksort  Memory: 221kB
          -  Hash
 Join  (cost=69.65..1136.39 rows=2287 width=30) (actual
 time=17.528..34.604 rows=2251 loops=1)
            
    Hash Cond: (ratecltes.id_rutas =
 rutas.id)
            
    -  Seq Scan on ratecltes 
 (cost=0.00..1032.44 rows=2287 width=8) (actual
 time=9.888..19.838 rows=2251 loops=1)
                
      Filter: (id_clte = 26)
            
    -  Hash  (cost=41.51..41.51
 rows=2251 width=26) (actual time=7.580..7.580 rows=2251
 loops=1)
                
      -  Seq Scan on rutas 
 (cost=0.00..41.51 rows=2251 width=26) (actual
 time=0.013..3.853 rows=2251 loops=1)
  Total runtime: 148.293 ms
 
 I hope you could help me.
 
 Fernando
 
 
 -- 
 
 
 
 

-- 





Re: [web2py] Help Query speed

2013-01-22 Thread FERNANDO VILLARROEL
Ok but how i can solve?

--- On Tue, 1/22/13, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] Help Query speed
To: web2py@googlegroups.com
Date: Tuesday, January 22, 2013, 10:10 PM

maybe the virtual fields?




-- 

 

 

 

-- 





Re: [web2py] How to make a call?

2013-01-11 Thread Fernando Villarroel
I think you could use clicktocall

Enviado desde mi iPhone

El 11-01-2013, a las 19:44, webpypy ad...@aqar-riyadh.com escribió:

 Hi ,
 
 Using web2py app in mobile, How to make a call?
 
 Regards,
 
 Ashraf
 -- 
  
  
  

-- 





[web2py] Connection error standard_conforming_strings

2013-01-01 Thread FERNANDO VILLARROEL
Dear All.

I am trying to migrate my web2py applications to the new version 2.3.2 and 
deploy with nginx + uwsgi but i am received the following error:


DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
  File /home/www-data/web2py/gluon/dal.py, line 6771, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
  File /home/www-data/web2py/gluon/dal.py, line 2475, in __init__
self.after_connection()
  File /home/www-data/web2py/gluon/dal.py, line 2479, in after_connection
self.execute(SET standard_conforming_strings=on;)
  File /home/www-data/web2py/gluon/dal.py, line 1671, in execute
return self.log_execute(*a, **b)
  File /home/www-data/web2py/gluon/dal.py, line 1665, in log_execute
ret = self.cursor.execute(*a, **b)
OperationalError: no se puede cambiar el parámetro «standard_conforming_strings»

I am using postgresql version 8.1.9

My db.py:

db = DAL('postgres://bla:foo@192.168.1.26:5432/cltes')

What i am doing wrong?

From the old web2py and apache apps running very well.

Regards.




-- 





Re: [web2py] Re: Connection error standard_conforming_strings

2013-01-01 Thread Fernando Villarroel
Yes psycopg2 is installed.

But i test the same aplication with another postgresql version (8.4)now my 
application running fine.

http://comments.gmane.org/gmane.comp.python.web2py/42824

I think the problem is the postgresql version 8.1. So i migrated my database to 
PostgreSQL 8.4 for solved my problem.

Regards.

Enviado desde mi iPhone

El 02-01-2013, a las 1:17, Massimo Di Pierro massimo.dipie...@gmail.com 
escribió:

  you have psycopg2 installed?
 
 On Tuesday, 1 January 2013 17:58:54 UTC-6, visuallinux wrote:
 
 Dear All.
 I am trying to migrate my web2py applications to the new version 2.3.2 and 
 deploy with nginx + uwsgi but i am received the following error:
 
 
 DEBUG: connect attempt 4, connection error:
 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/dal.py, line 6771, in __init__
 self._adapter = ADAPTERS[self._dbname](*args)
   File /home/www-data/web2py/gluon/dal.py, line 2475, in __init__
 self.after_connection()
   File /home/www-data/web2py/gluon/dal.py, line 2479, in after_connection
 self.execute(SET standard_conforming_strings=on;)
   File /home/www-data/web2py/gluon/dal.py, line 1671, in execute
 return self.log_execute(*a, **b)
   File /home/www-data/web2py/gluon/dal.py, line 1665, in log_execute
 ret = self.cursor.execute(*a, **b)
 OperationalError: no se puede cambiar el parámetro 
 «standard_conforming_strings»
 
 I am using postgresql version 8.1.9
 
 My db.py:
 
 db = DAL('postgres://bla:foo@192.168.1.26:5432/cltes')
 
 What i am doing wrong?
 
 From the old web2py and apache apps running very well.
 
 Regards.
 
 -- 
  
  
  

-- 





[web2py] Deploy nginx + uwsgi

2012-12-27 Thread FERNANDO VILLARROEL
Dear All.

I am trying to migrated my web2py applications from apache to nginx + uwsgi.

So i did configured a Ubuntu Server, i follow the script :

http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

My problem is i can't deploy mi domain: administrator.midomain.com, i received 
Bad Gateway.

My /etc/nginx/administrator:


server {
listen  80;
server_name administrator.mydomain.com;
location ~* /(\w+)/static/ {
   root /home/www-data/web2py/applications/;
}
 location / {
uwsgi_pass  127.0.0.1:9001;
#uwsgi_pass  unix:///run/uwsgi/app/web2py/web2py.socket;
include uwsgi_params;
#uwsgi_param UWSGI_SCHEME $scheme;
#uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}
}

server {
listen  443;
server_name administrator.mydomain.com;
ssl on;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///run/uwsgi/app/web2py/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}

}



I do not know How should the file /etc/uwsgi/administrator.xml?

My deploy is running ok, when i write my wan IP of my ubuntu server on my 
Browser like Chrome, the welcome application show perfectly, but i told you i 
need help for configuration of  uwsgi for i  can deploy my virtualhost like 
apache:

adminstrator.mydomain.com

The route of the this application administrator is 
/home/www-data/web2py/applications/administrator

I am not using Virtualenv on my ubuntu server.

I hope you help for i can deploy my applications with nginx and uwsgi.

Regards.

Fernando.

-- 





Re: [web2py] Deploy nginx + uwsgi

2012-12-27 Thread FERNANDO VILLARROEL
Dear Bruno.
Not i am using only http.
maybe I should delete the https config of my nginx file (443).
But i need help for i can config the /etc/uwsgi/administrator.xml for deploy 
the application /home/www-data/web2py/applications/administrator with my domain 
administartor.mydomain.com
Regards.

--- On Thu, 12/27/12, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] Deploy nginx + uwsgi
To: web2py@googlegroups.com
Date: Thursday, December 27, 2012, 11:47 PM

I see something strange, your 80 port is using IP adress and 443 is using unix 
socket.
Can you access using https:// ??

On Fri, Dec 28, 2012 at 1:43 AM, FERNANDO VILLARROEL fvillarr...@yahoo.com 
wrote:


Dear All.



I am trying to migrated my web2py applications from apache to nginx + uwsgi.



So i did configured a Ubuntu Server, i follow the script :



http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh



My problem is i can't deploy mi domain: administrator.midomain.com, i received 
Bad Gateway.



My /etc/nginx/administrator:





server {

        listen          80;

        server_name     administrator.mydomain.com;

        location ~* /(\w+)/static/ {

           root /home/www-data/web2py/applications/;

        }

         location / {

                uwsgi_pass      127.0.0.1:9001;

                #uwsgi_pass      unix:///run/uwsgi/app/web2py/web2py.socket;

                include         uwsgi_params;

                #uwsgi_param     UWSGI_SCHEME $scheme;

                #uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;

        }

}



server {

        listen          443;

        server_name     administrator.mydomain.com;

        ssl                     on;

        ssl_certificate         /etc/nginx/ssl/web2py.crt;

        ssl_certificate_key     /etc/nginx/ssl/web2py.key;

        location / {

                #uwsgi_pass      127.0.0.1:9001;

                uwsgi_pass      unix:///run/uwsgi/app/web2py/web2py.socket;

                include         uwsgi_params;

                uwsgi_param     UWSGI_SCHEME $scheme;

                uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;

        }



}







I do not know How should the file /etc/uwsgi/administrator.xml?



My deploy is running ok, when i write my wan IP of my ubuntu server on my 
Browser like Chrome, the welcome application show perfectly, but i told you i 
need help for configuration of  uwsgi for i  can deploy my virtualhost like 
apache:





adminstrator.mydomain.com



The route of the this application administrator is 
/home/www-data/web2py/applications/administrator



I am not using Virtualenv on my ubuntu server.



I hope you help for i can deploy my applications with nginx and uwsgi.



Regards.



Fernando.



--












-- 

 

 

 

-- 





[web2py] Call controller automatically

2012-12-22 Thread FERNANDO VILLARROEL
Dear.

I have a controller that basically runs a SQL shown in their respective views.

Need is that while the user STAY in this view, the controller automatically 
running every 5 seconds, and so the result of the SQL refresh the view.

I could use a Refresh button, but I want it to be automatic.

How i can do?

Fernando

-- 





[web2py] Cron every 5 seconds.

2012-12-21 Thread FERNANDO VILLARROEL
Dear.

I need refresh my index every 5 seconds.
I think to use cron, so how i can call a controller (controller/myfunction) 
every 5 seconds?

Regards.

Fernando.



-- 





Re: [web2py] 'Row' object has no attribute powerTable

2012-12-17 Thread FERNANDO VILLARROEL
Dear Bruno.
Yes works fine without powerTable
The problem occur when i use powerTable.
Regards

--- On Mon, 12/17/12, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 1:04 AM

what happens if you just return the Rows without using powerTable, it works?
def test():    
return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)



-- 

 

 

 

-- 





Re: [web2py] 'Row' object has no attribute powerTable

2012-12-17 Thread FERNANDO VILLARROEL
Dear.
Why when i run:
def test():    
return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)
Works fine.
But when i use powerTable occur the error:
reg=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha) 
        powerTable = plugins.powerTable         powerTable.datasource = reg     
    powerTable.dtfeatures['sScrollY'] = '100%'         
powerTable.dtfeatures['sScrollX'] = '100%'         
powerTable.dtfeatures['bPaginate'] =  True         
powerTable.dtfeatures['bAutoWidth'] = True          powerTable._width='1020'    
     powerTable.dtfeatures['bSort'] = False #Se muestra ordenado por Query      
   
#powerTable.extra=dict(editable={'editablecallback':URL('llamadas','editablefunction')})  
        powerTable.dtfeatures['iDisplayLength'] = 50          
powerTable.virtualfields = None          powerTable.headers='labels'         
powerTable.showkeycolumn = False         powerTable.dtfeatures['bJQueryUI'] = 
request.vars.get('jqueryui',True)       
  powerTable.uitheme = 
'redmond'#request.vars.get('theme','cupertino')#'smoothness' / 'redmond'        
 powerTable.dtfeatures['sPaginationType'] = 
'full_numbers'#request.vars.get('pager','full_numbers') # two_button scrolling  
       powerTable.columns =  
['pagos.id','pagos.fecha','pagos.monto','pagos.comments']         
#powerTable.extra = dict(autoresize={})         powerTable.keycolumn = 
'pagos.id'         powerTable.hiddecolumns=['pagos.id']         
table=powerTable.create()         return dict(table=table) 

type 'exceptions.AttributeError' 'Row' object has no attribute 'pagos'
Any idea what is wrong?

--- On Mon, 12/17/12, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:

From: FERNANDO VILLARROEL fvillarr...@yahoo.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 11:02 AM

Dear Bruno.
Yes works fine without powerTable
The problem occur when i use powerTable.
Regards

--- On Mon, 12/17/12, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 1:04 AM

what happens if you just return the Rows without using powerTable, it works?
def test():    
return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)



-- 

 

 

 





-- 

 

 

 

-- 





Re: [web2py] 'Row' object has no attribute powerTable SOLVED

2012-12-17 Thread FERNANDO VILLARROEL
Dear.
After looking some solution in google, i found this solution:
https://groups.google.com/forum/?fromgroups=#!topic/web2py-usuarios/gvxQAC3Xfts
I  added this lines to my controller:
@auth.requires_login()def pagos():
         class Virtual(object):                
@virtualsettings(label=T('Information:'))                def 
virtualtooltip(self):                        return T('This is a virtual 
tooltip for record %s' % self.pagos.id)
Now powerTable works, anyone could me explain why?
Regards.
--- On Mon, 12/17/12, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:

From: FERNANDO VILLARROEL fvillarr...@yahoo.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 3:46 PM

Dear.
Why when i run:
def test():    
return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)
Works fine.
But when i use powerTable occur the error:
reg=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha) 
        powerTable = plugins.powerTable         powerTable.datasource = reg     
    powerTable.dtfeatures['sScrollY'] = '100%'         
powerTable.dtfeatures['sScrollX'] = '100%'         
powerTable.dtfeatures['bPaginate'] =
  True         powerTable.dtfeatures['bAutoWidth'] = True          
powerTable._width='1020'         powerTable.dtfeatures['bSort'] = False #Se 
muestra ordenado por Query         
#powerTable.extra=dict(editable={'editablecallback':URL('llamadas','editablefunction')})  
        powerTable.dtfeatures['iDisplayLength'] = 50          
powerTable.virtualfields = None          powerTable.headers='labels'         
powerTable.showkeycolumn = False         powerTable.dtfeatures['bJQueryUI'] = 
request.vars.get('jqueryui',True)         powerTable.uitheme =
 'redmond'#request.vars.get('theme','cupertino')#'smoothness' / 'redmond'       
  powerTable.dtfeatures['sPaginationType'] = 
'full_numbers'#request.vars.get('pager','full_numbers') # two_button scrolling  
       powerTable.columns =  
['pagos.id','pagos.fecha','pagos.monto','pagos.comments']         
#powerTable.extra = dict(autoresize={})         powerTable.keycolumn = 
'pagos.id'         powerTable.hiddecolumns=['pagos.id']         
table=powerTable.create()         return dict(table=table) 

type 'exceptions.AttributeError' 'Row' object has no attribute 'pagos'
Any idea what is wrong?

--- On Mon, 12/17/12, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:

From: FERNANDO VILLARROEL fvillarr...@yahoo.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 11:02 AM

Dear Bruno.
Yes works fine without powerTable
The problem occur when i use powerTable.
Regards

--- On Mon, 12/17/12, Bruno Rocha
 rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] 'Row' object has no attribute powerTable
To: web2py@googlegroups.com
Date: Monday, December 17, 2012, 1:04 AM

what happens if you just return the Rows without using powerTable, it works?
def test():    
return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)



-- 

 

 

 





-- 

 

 

 





-- 

 

 

 

-- 





[web2py] 'Row' object has no attribute powerTable

2012-12-16 Thread FERNANDO VILLARROEL
Dear All.

I am trying to use powerTable plugin, but i am receiving the following error:

return ogetattr(self, key)
AttributeError: 'Row' object has no attribute 'pagos'

My code:


@auth.requires_login()
def pagos():

 
reg=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha)
 powerTable = plugins.powerTable
 powerTable.datasource = reg
..

What is the problem with this query? or what i am doing wrong?

Regards

-- 





Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-03 Thread FERNANDO VILLARROEL
Dear Bruno
Any update about powerTable + Web2py 2.0.9

--- On Mon, 10/1/12, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no 
attribute 'virtual'
To: web2py@googlegroups.com
Date: Monday, October 1, 2012, 1:04 AM

Are you running new version of web2py? I guess the old style virtual fields is 
not working and also I have to check if the injection of virtualsettings will 
still work with web2py 2.0+
I will take a closer look on powertable code tomorrow to see if I can adapt it 
to work with the new web2py.



-- 

 

 

 

-- 





Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-01 Thread FERNANDO VILLARROEL
Dear Bruno.
Yes effectively i am using the new version of web2py 2.0.8

--- On Mon, 10/1/12, Bruno Rocha rochacbr...@gmail.com wrote:

From: Bruno Rocha rochacbr...@gmail.com
Subject: Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no 
attribute 'virtual'
To: web2py@googlegroups.com
Date: Monday, October 1, 2012, 1:04 AM

Are you running new version of web2py? I guess the old style virtual fields is 
not working and also I have to check if the injection of virtualsettings will 
still work with web2py 2.0+
I will take a closer look on powertable code tomorrow to see if I can adapt it 
to work with the new web2py.



-- 

 

 

 

-- 





[web2py] powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-09-30 Thread FERNANDO VILLARROEL
Dear All.

I am trying to use PowerTable, but i am receiving the follow error:

Traceback (most recent call last):
  File /home/fvillarroel/www/web2py/gluon/restricted.py, line 209, in 
restricted
exec ccode in environment
  File 
/home/fvillarroel/www/web2py/applications/administrador/controllers/clientes.py,
 line 107, in module
  File /home/fvillarroel/www/web2py/gluon/globals.py, line 185, in lambda
self._caller = lambda f: f()
  File /home/fvillarroel/www/web2py/gluon/tools.py, line 2783, in f
return action(*a, **b)
  File 
/home/fvillarroel/www/web2py/applications/administrador/controllers/clientes.py,
 line 63, in clientes
table=powerTable.create()
  File 
/home/fvillarroel/www/web2py/applications/administrador/models/plugin_powertable.py,
 line 704, in plugin_powertable
PowerTable(),
  File 
/home/fvillarroel/www/web2py/applications/administrador/models/plugin_powertable.py,
 line 178, in __init__
headers[c] = sqlrows.db[t][f].label
  File /home/fvillarroel/www/web2py/gluon/dal.py, line 7136, in __getitem__
return self.__getattr__(str(key))
  File /home/fvillarroel/www/web2py/gluon/dal.py, line 7143, in __getattr__
return ogetattr(self, key)
AttributeError: 'DAL' object has no attribute 'virtual'


Any idea.


-- 





Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-09-30 Thread FERNANDO VILLARROEL
Dear Massimo.
My code is the following:
@auth.requires_membership('Administrador')def clientes():

    class Virtual(object):
        @virtualsettings(label=T('Editar'))        def edit(self):              
          link_editar= URL(r =request,f='editablefunction',                     
       args=[self.clientes.id])            link_icono_editar= 
IMG(_src=URL(r=request,c='static',                        
f='images/Edit_Icon.png'),                        _alt='Editar'                 
       )            return (A(link_icono_editar,_href= link_editar))# + 
str(self.clientes.id))) 
   
reg=db(db.clientes).select(db.clientes.id,db.clientes.rut,db.clientes.dv,db.clientes.rsocial, 
                               
db.clientes.direccion,db.clientes.ciudad,db.clientes.mail,                      
          
db.clientes.tipo,db.clientes.fecha,db.clientes.giro,db.tarifa.nombre,           
                     db.estados.nombre,db.clientes.tarifica,            
join=(db.tarifa.on(db.clientes.id_tarifa==db.tarifa.id),                    
db.estados.on(db.clientes.estado==db.estados.id),                    
db.tipos.on(db.clientes.tipo==db.tipos.id),                    
db.tarificacion.on(db.clientes.tarifica==db.tarificacion.id)),
            orderby=db.clientes.rsocial)
    powerTable = plugins.powerTable    powerTable.datasource = reg    
.    .    table=powerTable.create()    return 
dict(table=table)

I do not understand what is wrong.
--- On Sun, 9/30/12, Massimo Di Pierro massimo.dipie...@gmail.com wrote:

From: Massimo Di Pierro massimo.dipie...@gmail.com
Subject: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 
'virtual'
To: web2py@googlegroups.com
Date: Sunday, September 30, 2012, 11:00 PM

I think it should be Virtual, not virtual.

On Sunday, 30 September 2012 20:11:34 UTC-5, visuallinux  wrote:Dear All.



I am trying to use PowerTable, but i am receiving the follow error:



Traceback (most recent call last):

  File /home/fvillarroel/www/web2py/ gluon/restricted.py, line 209, in 
restricted

    exec ccode in environment

  File /home/fvillarroel/www/web2py/ applications/administrador/ 
controllers/clientes.py, line 107, in module

  File /home/fvillarroel/www/web2py/ gluon/globals.py, line 185, in lambda

    self._caller = lambda f: f()

  File /home/fvillarroel/www/web2py/ gluon/tools.py, line 2783, in f

    return action(*a, **b)

  File /home/fvillarroel/www/web2py/ applications/administrador/ 
controllers/clientes.py, line 63, in clientes

    table=powerTable.create()

  File /home/fvillarroel/www/web2py/ applications/administrador/ 
models/plugin_powertable.py, line 704, in plugin_powertable

    PowerTable(),

  File /home/fvillarroel/www/web2py/ applications/administrador/ 
models/plugin_powertable.py, line 178, in __init__

    headers[c] = sqlrows.db[t][f].label

  File /home/fvillarroel/www/web2py/ gluon/dal.py, line 7136, in __getitem__

    return self.__getattr__(str(key))

  File /home/fvillarroel/www/web2py/ gluon/dal.py, line 7143, in __getattr__

    return ogetattr(self, key)

AttributeError: 'DAL' object has no attribute 'virtual'





Any idea.









-- 

 

 

 

-- 





[web2py] Read file attached from gmail

2012-09-17 Thread FERNANDO VILLARROEL
Dear All.

Every day i did received a email (gmail) with a file attached (text) as rar.

My question is how i can read this file attached from web2py?

Or how i can download this file to /tmp folder?

Any idea.

Regards





-- 





[web2py] web2py nginx and uwsgi

2012-08-23 Thread FERNANDO VILLARROEL
Dear.

I am new in web developing and  always i used sample apache config. But i see 
many post about my subject, so I would like use it.

Also I would like to integrate git to development environment, now i do using 
trac + svn for my standalone projects.

I am following the follow howto:

http://alvarolizama.net/2012/06/30/mi-configuracion-para-servidores-con-python/

But i am some confused.

I would like to learn how to set up a development and production environment 
for web2py with nginx + uwsgi. 

Does anyone know some howto for beginners?

Does anyone let me know some links or how i can do slowly so i will can 
understanding?


Regards.

-- 





Re: [web2py] Graphs

2012-08-15 Thread FERNANDO VILLARROEL
Thank you everyone for you help.
Where i can see some how to for i can use d3 visualizations fed from web2py or 
Charts?
Regards.


--- On Wed, 8/15/12, Andrew awillima...@gmail.com wrote:

From: Andrew awillima...@gmail.com
Subject: Re: [web2py] Grahs
To: web2py@googlegroups.com
Date: Wednesday, August 15, 2012, 6:47 AM

You may also want to look at :http://nvd3.com/ghpages/cumulativeLine.html
based on the d3js.org library.  Very Cool !
I've started using d3 visualizations fed from web2py json (or csv) uris.


On Wednesday, August 15, 2012 11:34:19 AM UTC+12, rochacbruno wrote:If it is a 
webapp you can start looking here: https://google- 
developers.appspot.com/chart/ interactive/docs/index







-- 

 

 

 

-- 





[web2py] Grahs

2012-08-14 Thread FERNANDO VILLARROEL
Dear All.

I am looking how i can doing some humedity graph from my database like:

http://www.google.cl/imgres?imgurl=http://bfinet.es/objects/300_19_1511558087/grafico-humedad.jpgimgrefurl=http://bfinet.es/Sonda%2BTemperatura%2By%2BHumedad-300.htm?sid%3D86888e016e7af58b05e6bd8071640e45h=395w=650sz=39tbnid=cyGO1-CPIR49ZM:tbnh=74tbnw=121prev=/search%3Fq%3Dgrafico%2Bhumedad%26tbm%3Disch%26tbo%3Duzoom=1q=grafico+humedadusg=__5kwEzOircYj92GYI4L0ROPQb_gs=docid=DFD_8y7rDNLQmMhl=es-419sa=Xei=Fc0qULSCFKfy0gHIx4DADAved=0CE0Q9QEwAAdur=221

X=Time (0 - 24 Hrs)
Y= % humedity

I hope you could give me some idea or how i can do.

Regards

-- 





[web2py] Unsupported query SQLFORM.grid

2012-03-23 Thread FERNANDO VILLARROEL
Dear All.

I am trying the following query:


fields=[db.llamados.id,db.accountcode.ani,db.llamados.destino,db.rutas.nombre,db.llamados.answeredtime,db.llamados.inicio,db.llamados.valor,db.l
lamados.billing]

left = 
([db.accountcode.on(db.llamados.id_accountcode==db.accountcode.id),db.rutaproveedor.on(db.llamados.id_rutaproveedor==db.rutaproveedor.id)
,db.rutas.on(db.rutaproveedor.id_rutas==db.rutas.id)])


 query = ((db.accountcode.id_clientes==session.cliente_id)  
(db.llamados.dialstatus=='ANSWER')  (db.llamados.inicio = dt1)  (db.llamad   
 os.inicio = dt2))

 
grid=SQLFORM.grid(query=query,fields=fields,left=left,orderby=default_sort_order,create=False,deletable=False,editable=False,det
ails=False,maxtextlength=100,paginate=50)

Does when i press submit i received : Unsupported query 
and not show  db.rutas.nombre column

How i can do?


Re: [web2py] Unable to create DAL connection to PostgreSQL on WebFaction

2011-04-16 Thread FERNANDO VILLARROEL
Hi

Change 

dbpg = DAL('postgres://dlawrence_test1:@localhost/dlawrence_test1')

to:

dbpg = SQLDB('postgres://dlawrence_test1:@localhost:5432/dlawrence_test1')

Regards.


--- On Sat, 4/16/11, Dave dlawre...@focusedconcepts.com wrote:

 From: Dave dlawre...@focusedconcepts.com
 Subject: [web2py] Unable to create DAL connection to PostgreSQL on WebFaction
 To: web2py-users web2py@googlegroups.com
 Date: Saturday, April 16, 2011, 4:15 PM
 I am building my website using web2py
 on WebFaction. I have a
 PostgreSQL database on WebFaction called dlawrence_test1.
 
 When I attempt to create a connection to that database
 using the
 web2py shell as described in the manual, the command
 executes without
 any errors. But when I try to access the connection
 variable, an error
 message reports that the connection variable is not
 defined.
 
 Can anyone explain this and tell me what I am doing
 incorrectly? Thank
 you.
 
 [note: my database password is represented by ]
 
 --- web2py shell -
 In[0]: dbpg =
 DAL('postgres://dlawrence_test1:@localhost/
 dlawrence_test1')
 
 Out[0]:
 
 In[1]: print dbpg._name
 
 Out[1]:
 Traceback (most recent call last):
   File input, line 1, in module
 NameError: name 'dbpg' is not defined
 



[web2py] Parameters GET or POST.

2010-08-13 Thread FERNANDO VILLARROEL
Dear All.

How i can pass parameters between forms with POST or GET?

Regards.


  


[web2py:34608] Re: web2py pagination with Datatables

2009-11-04 Thread FERNANDO VILLARROEL

Hello All.

Regarding of pagination.

Anyone could me explain how i can use Datatables; i am trying but not works.

Or if anyone could send to me a example how i can use it.

Regards.

Fernando
--- On Wed, 11/4/09, mdipierro mdipie...@cs.depaul.edu wrote:

 From: mdipierro mdipie...@cs.depaul.edu
 Subject: [web2py:34574] Re: web2py pagination
 To: web2py-users web2py@googlegroups.com
 Date: Wednesday, November 4, 2009, 11:30 AM
 
 limitby=(a,b)
 
 returns rows[i] for a = i  b
 
 On Nov 4, 3:30 am, Mengu whalb...@gmail.com
 wrote:
  hi everyone.
 
  i have a problem with paginating my results. i guess i
 didn't
  understand the logic in limitby.
 
  normally an sql query SELECT * FROM post LIMIT 2
 OFFSET 0 displays the
  first 2 results. And I can get the first 2 records
 with db
  (db.post.id0).select(limitby(0,2)). so limit is 2
 and offset is 0.
 
  however the problem is, this query fails:
  db(db.post.id0).select(limitby(2,2)). in this
 query the limit is 2
  and the ofset is 2 either. however it doesn't return
 select * from
  post limit 2 offset 2 but it returns select * from
 post limit 0 offset
  2 because in sql.py 2846 limit is lmax - lmin and
 offset is lmin. i
  have edited that line as sql_o += ' LIMIT %i OFFSET
 %i' % (lmax, lmin)
  and it is working as expected. now my pagination is
 working.
 
  here is my codes for pagination:
  perpage = 2
  totalposts = db(db.post.id  0).count()
  totalpages = totalposts / perpage
  page = int(request.vars.page) if request.vars.page
 else 1
  limit = int(page - 1) * perpage
  posts = db(db.post.id 
 0).select(orderby=~db.post.id, limitby=(limit,
  perpage))
 
  please let me know if there's another page for doing
 this.
 
  sincerely
  Mengu
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29437] Form and Jquery

2009-08-26 Thread FERNANDO VILLARROEL

Dear All.


I am trying of doing a query for get some records from a database and show 
results on a Data Tables (Jquery), i am new in Web development (Ajax and 
Jquery, Json, etc.) and i want know how doing.

The idea is get all records that fecha = to var desde and show in a Data 
Tables

Controller:

def llamados():

import time

hoy=time.time()
desde=time.strftime('%Y-%m-%d 00:00:00',time.localtime(hoy))

form=FORM(TABLE(TR(Desde ( Año-mes-día 
):,INPUT(_type=datetime,_name=desde,_value=desde,_class='datetime',_id=datetlimite,
 requires=IS_DATETIME())),
TR(,INPUT(_type=submit,_value=Consultar


if form.accepts(request.vars,session):

 
rows=db.db(db.llamados.id_clientes==session.cliente_id).select(db.llamados.fecha=form.vars.desde)



return dict(form=form,rows=rows,vars=form.vars)


Views:

View: llamados.html

{{extend 'layout.html'}}

h2Registro de Llamados/h2

{{=form}}

...here Data Tables!

How i can show the Datatables below to the form or if need show the Data Tables 
on another views?.

Anyone could me explain how i can doing.

Fernando.








  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28851] records from a form

2009-08-17 Thread FERNANDO VILLARROEL

Dear All.

I am trying get records from a form like this:

controller:


def llamados():

import time

hoy=time.time()
desde=time.strftime('%Y-%m-%d 00:00:00',time.localtime(hoy))
hasta=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(hoy))




lineas=db(db.accountcode.id_clientes==session.cliente_id).select(db.accountcode.ALL,orderby=db.accountcode.ani)
#print lineas
if len(lineas)  1:

acc=['Todas']

else:

acc=[]

for l in lineas:

acc.append(l.ani)



form=FORM(TABLE(TR(Desde ( Año-mes-día 
):,INPUT(_type=datetime,_name=desde,_value=desde,_class='datetime',_id=datetlimite,
 requires=IS_DATETIME())),
TR(Hasta ( Año-mes-día 
):,INPUT(_type=datetime,_name=hasta,_value=hasta,_class='datetime',_id=datetlimite1,
 requires=IS_DATETIME())),

TR(Lineas,SELECT(acc,_name=linea,requires=IS_IN_SET(acc))),
TR(,INPUT(_type=submit,_value=Consultar


if form.accepts(request.vars,session):

a=db.llamados
b=db.accountcode.with_alias('b')
c=db.clientes.with_alias('c')


if form.vars.linea==Todas:

query = 
(b.id_clientes==session.cliente_id)(a.dialstatus=='ANSWER') 
(a.inicio=form.vars.desde)(a.inicio=form.vars.hasta)
left = 
(b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
rows = 
db(query).select(b.ani,a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inicio)
totalrecs=len(rows)

else:

lin=db(db.accountcode.ani==form.vars.linea).select(db.accountcode.ALL)[0]
query = 
(b.id_clientes==session.cliente_id)(a.dialstatus=='ANSWER') 
(a.inicio=form.vars.desde)(a.inicio=form.vars.hasta)  
(a.id_accountcode==lin.id)
left = 
(b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
rows = 
db(query).select(b.ani,a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inicio)


return dict(form=form,rows=rows,vars=form.vars)

View: llamados.html

{{extend 'layout.html'}}

h2Registro de Llamados/h2

{{=form}}
{{if rows:}}
{{=TABLE(TR(rows))}}




1) My first problem is when i change date and press button, the values of the 
desde, hasta and lineas is reinicializated in the view. 

2) How i can show records and paginate too. I am trying using the code of 
http://mdp.cti.depaul.edu/AlterEgo/default/show/95


3) I want know using Ajax. Anyone could me explain how i can doing this code 
using Ajax?.


Fernando.


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28529] Re: logo

2009-08-13 Thread FERNANDO VILLARROEL

I like option A

Fernando

--- On Thu, 8/13/09, Massimo Di Pierro mdipie...@cs.depaul.edu wrote:

 From: Massimo Di Pierro mdipie...@cs.depaul.edu
 Subject: [web2py:28520] logo
 To: web2py@googlegroups.com
 Date: Thursday, August 13, 2009, 1:29 PM
 Two logos have been proposed for
 web2py. I love them both and I would  
 like your opinions. Here they are attached.
 
 Which one should go on the main web2py page and the book?
 
 Vote A for the logo with the W and B for the logo with the
 globe.
 
 Poll is open for 48 hours starting now.
 
 Massimo
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28373] Help query

2009-08-11 Thread FERNANDO VILLARROEL

Dear all.

How i can doing the following query for web2py:

 select
a.destino,a.answeredtime,a.inicio,a.fin,a.valor from llamados as a 
 join 
accountcode as b on a.id_accountcode=b.id 
 join 
clientes as c on b.id_clientes=c.id 

 where id_clientes = clte and a.dialstatus='ANSWER' and (a.inicio = 

desdeand a.inicio = hasta) order by a.inicio DESC

I want not use executesql.


Fernando


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28388] Re: Help query

2009-08-11 Thread FERNANDO VILLARROEL

Thank you Massimo

--- On Tue, 8/11/09, mdipierro mdipie...@cs.depaul.edu wrote:

 From: mdipierro mdipie...@cs.depaul.edu
 Subject: [web2py:28376] Re: Help query
 To: web2py-users web2py@googlegroups.com
 Date: Tuesday, August 11, 2009, 8:04 PM
 
 Here is is broken down into pieces:
 
 a=db.llamados
 b=db.accountcode.with_alias('b')
 c=db.clientes.with_alias('c')
 query =
 (b.id_clientes==clte)(a.dialstatus=='ANSWER')
 (a.inicio=desde)(a.inicio=hasta)
 left =
 (b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
 rows = db(query).select
 (a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inicio)
 
 
 
 
 On Aug 11, 4:54 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
 wrote:
  Dear all.
 
  How i can doing the following query for web2py:
 
   select
         
 a.destino,a.answeredtime,a.inicio,a.fin,a.valor from
 llamados as a
   join
          accountcode as b on a.id_accountcode=b.id
   join
          clientes as c on b.id_clientes=c.id
 
   where id_clientes = clte and a.dialstatus='ANSWER'
 and (a.inicio =
 
  desde    and a.inicio = hasta) order by a.inicio
 DESC
 
  I want not use executesql.
 
  Fernando
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28321] Calendar

2009-08-10 Thread FERNANDO VILLARROEL

Dear all,

I am trying use calendar on a simple form as below:

def llamados():


hoy=time.time()
desde=time.strftime('%d-%m-%Y 00:00:00',time.localtime(desde))
hasta=time.strftime('%d-%m-%Y %H:%M:%S',time.localtime(hoy))


lineas=db(db.accountcode.id_clientes==session.cliente_id).select(db.accountcode.ani,orderby=db.accountcode.ani)

if len(lineas)  1:

acc=['All']

else:

acc=[]

for l in lineas:

acc.append(l.ani)
  

form=FORM(TABLE(TR(Desde:,INPUT(_type=datetime,_name=desde,_value=desde,_class='datetime',_id=datetlimite,
 requires=IS_DATETIME())),

TR(Hasta:,INPUT(_type=datetime,_name=hasta,_value=hasta,_class='datetime',_id=datetlimite,
 requires=IS_DATETIME())),

TR(Lineas,SELECT(acc,_name=linea,requires=IS_IN_SET(acc))),
TR(,INPUT(_type=submit,_value=Consultar

return dict(form=form)


I can see calendar only in the first INPUT (_name=desde).

Why when i trying of update date the second INPUT (_name=hasta) the calendar 
not show?

Fernando.


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28325] Re: Calendar SOLVED

2009-08-10 Thread FERNANDO VILLARROEL

Thank you Jonathan, now works fine.

--- On Mon, 8/10/09, Jonathan Lundell jlund...@pobox.com wrote:

 From: Jonathan Lundell jlund...@pobox.com
 Subject: [web2py:28322] Re: Calendar
 To: web2py@googlegroups.com
 Date: Monday, August 10, 2009, 8:56 PM
 
 On Aug 10, 2009, at 4:48 PM, FERNANDO VILLARROEL wrote:
 
 
  Dear all,
 
  I am trying use calendar on a simple form as below:
 
  def llamados():
 
 
  hoy=time.time()
  desde=time.strftime('%d-%m-%Y
 00:00:00',time.localtime(desde))
  hasta=time.strftime('%d-%m-%Y
 %H:%M:%S',time.localtime(hoy))
 
          
  lineas 
  = 
  db 
  (db 
  .accountcode 
  .id_clientes 
  = 
  = 
  session 
 
 .cliente_id).select(db.accountcode.ani,orderby=db.accountcode.ani)
 
  if len(lineas)  1:
 
                
 acc=['All']
 
  else:
 
                
 acc=[]
 
  for l in lineas:
 
                
 acc.append(l.ani)
 
 
  form 
  = 
  FORM 
  (TABLE 
  (TR 
  (Desde 
  :,INPUT 
  (_type 
  = 
  datetime 
 
 ,_name=desde,_value=desde,_class='datetime',_id=datetlimite, 
 
  requires=IS_DATETIME())),
                
      
  TR 
  (Hasta 
  :,INPUT 
  (_type 
  = 
  datetime 
 
 ,_name=hasta,_value=hasta,_class='datetime',_id=datetlimite, 
 
  requires=IS_DATETIME())),
                
      
 
 TR(Lineas,SELECT(acc,_name=linea,requires=IS_IN_SET(acc))),
                
    
 TR(,INPUT(_type=submit,_value=Consultar
 
  return dict(form=form)
 
 
  I can see calendar only in the first INPUT
 (_name=desde).
 
  Why when i trying of update date the second INPUT
 (_name=hasta)  
  the calendar not show?
 
 Try giving your INPUTs distinct ID's.
 
 
  Fernando.
 
 
 
 
  
 
 
 
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28327] Calendar Setup

2009-08-10 Thread FERNANDO VILLARROEL

Regarding of the calendar.

How i can use calendar with today in format day-month-year?

hoy=time.time()
desde=time.strftime('%d-%m-%Y 00:00:00',time.localtime(hoy))


INPUT(_type=datetime,_name=desde,_value=hoy,_class='datetime',_id=datetlimite,
 requires=IS_DATETIME()))

if i use this format the calendar show 30 of January 2016.

If i use format year-month-day the calendar show today fine:10 August 2009.

Is possible i can use format day-month-year with Calendar?

Fernando




  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28116] Total Records

2009-08-06 Thread FERNANDO VILLARROEL


Hello All.

If i have a query as the follow:

rows=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=db.pagos.id)

How i can know the total of records of the object rows?

Fernando.


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28128] View Pagination Help

2009-08-06 Thread FERNANDO VILLARROEL

Hello.

I am trying to implementing the example pagination:

http://www.web2py.com/AlterEgo/default/show/95

How i use backward and forward in the view:

{{extend 'layout.html'}}
h2Pagos Cliente/h2

table
 
 {{for row in rows:}}
 ..
 .
/table

br

{{=nav}} 

a href={{=backward}}previous/a

a href={{=forward}}next/a

How i use backward and forward ?

Fernando




  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26707] Re: Authentication

2009-07-16 Thread FERNANDO VILLARROEL


Hello,

I am using a database Postgres.


 Can you show the entire traceback?

Traceback (most recent call last):
  File /home/fvillarroel/web2py/gluon/restricted.py, line 107, in restricted
exec ccode in environment
  File /home/fvillarroel/web2py/applications/clientes/controllers/default.py, 
line 53, in module
  File /home/fvillarroel/web2py/gluon/globals.py, line 80, in lambda
self._caller = lambda f: f()
  File /home/fvillarroel/web2py/applications/clientes/controllers/default.py, 
line 32, in user
return dict(form=auth())
  File /home/fvillarroel/web2py/gluon/tools.py, line 436, in __call__
return self.register()
  File /home/fvillarroel/web2py/gluon/tools.py, line 745, in register
group_id = self.add_group(user_%s % form.vars.id, description)
  File /home/fvillarroel/web2py/gluon/tools.py, line 1211, in add_group
description=description)
  File /home/fvillarroel/web2py/gluon/sql.py, line 1377, in insert
self._db._execute(query)
  File /home/fvillarroel/web2py/gluon/sql.py, line 726, in lambda
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
ProgrammingError: no existe la relación «auth_group»


 Do you get error even if
 auth.settings.create_user_groups=True?

yes


 If you use appadmin, do you see the auth_group?

No
appadmin is the  front end for administrator?

 
 
 
 On Jul 16, 4:29 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
 wrote:
  Dear all.
 
  I am trying to use authentication:
 
  http://www.web2py.com/examples/default/tools
 
  I have the following code on my db.py:
 
  from gluon.tools import *
  auth=Auth(globals(),db)            #
 authentication/authorization
 
  # define custom tables (table_user_name is
 'auth_user')
  auth.settings.table_user =
 db.define_table(auth.settings.table_user_name,
      db.Field('first_name', length=128,default=''),
      db.Field('last_name', length=128,default=''),
      db.Field('email', length=128,default='',
 requires = [IS_EMAIL(),
 IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]),
      db.Field('password', 'password', readable=False,
 label='Password', requires=CRYPT()),
      db.Field('registration_key', length=128,
 writable=False, readable=False,default=''),migrate=False)
 
  auth.define_tables()                # creates
 all needed tables
  auth.settings.create_user_groups=False
 
  But the application return the next exception:
 
    self._db._execute(query)
    File /home/fvillarroel/web2py/gluon/sql.py, line
 726, in lambda
      self._execute = lambda *a, **b:
 self._cursor.execute(*a, **b)
  ProgrammingError: no existe la relación
 «auth_group»
 
  What is the struct of the table auth_group?
 
  what i am doing wrong?
 
  Any idea or how i can solved the problem.
 
  Fernando
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26723] Re: Authentication

2009-07-16 Thread FERNANDO VILLARROEL


Now it's works.

Thank you Massimo.

--- On Fri, 7/17/09, mdipierro mdipie...@cs.depaul.edu wrote:

 From: mdipierro mdipie...@cs.depaul.edu
 Subject: [web2py:26722] Re: Authentication
 To: web2py Web Framework web2py@googlegroups.com
 Date: Friday, July 17, 2009, 1:21 AM
 
 OK. I think there is no problem then. Somebow the database
 was
 corrupted. Now everything should work. Let me know if not.
 
 Massimo
 
 On Jul 16, 11:13 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
 wrote:
   I suspect we have a major problem here:
 
   role is a keyword in postgresql and I did not
 know about
   it. To
   check if this is the problem:
 
   1) remove the database
   2) remove everything in databases/*
   3) create the database again
   4) go to appadmin and tell me which tables you
 see
 
  Done
 
  i see the following tables:
 
  db.tarifa
  db.clientes
  db.accountcode
  db.pagos
  db.proveedor
  db.rutaproveedor
  db.webuser
  db.auth_user
  db.auth_group
  db.auth_membership
  db.auth_permission
  db.auth_event
 
   Once we have identified the problem, we'll find
 a
   solution.
 
   Massimo
 
   On Jul 16, 9:49 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
   wrote:
Hello,
 
I am using a database Postgres.
 
 Can you show the entire traceback?
 
Traceback (most recent call last):
  File
   /home/fvillarroel/web2py/gluon/restricted.py,
 line 107, in
   restricted
    exec ccode in environment
  File
  
 /home/fvillarroel/web2py/applications/clientes/controllers/default.py,
   line 53, in module
  File
 /home/fvillarroel/web2py/gluon/globals.py,
   line 80, in lambda
    self._caller = lambda f: f()
  File
  
 /home/fvillarroel/web2py/applications/clientes/controllers/default.py,
   line 32, in user
    return dict(form=auth())
  File
 /home/fvillarroel/web2py/gluon/tools.py,
   line 436, in __call__
    return self.register()
  File
 /home/fvillarroel/web2py/gluon/tools.py,
   line 745, in register
    group_id = self.add_group(user_%s %
   form.vars.id, description)
  File
 /home/fvillarroel/web2py/gluon/tools.py,
   line 1211, in add_group
    description=description)
  File
 /home/fvillarroel/web2py/gluon/sql.py, line
   1377, in insert
    self._db._execute(query)
  File
 /home/fvillarroel/web2py/gluon/sql.py, line
   726, in lambda
    self._execute = lambda *a, **b:
   self._cursor.execute(*a, **b)
ProgrammingError: no existe la relación
   «auth_group»
 
 Do you get error even if
 auth.settings.create_user_groups=True?
 
yes
 
 If you use appadmin, do you see the
 auth_group?
 
No
appadmin is the  front end for
 administrator?
 
 On Jul 16, 4:29 pm, FERNANDO
 VILLARROEL fvillarr...@yahoo.com
 wrote:
  Dear all.
 
  I am trying to use
 authentication:
 
 http://www.web2py.com/examples/default/tools
 
  I have the following code on my
 db.py:
 
  from gluon.tools import *
  auth=Auth(globals(),db)      
      #
 authentication/authorization
 
  # define custom tables
 (table_user_name is
 'auth_user')
  auth.settings.table_user =

 db.define_table(auth.settings.table_user_name,
      db.Field('first_name',
   length=128,default=''),
      db.Field('last_name',
   length=128,default=''),
      db.Field('email',
   length=128,default='',
 requires = [IS_EMAIL(),
 
  
 IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)]),
      db.Field('password',
 'password',
   readable=False,
 label='Password', requires=CRYPT()),
     
 db.Field('registration_key',
   length=128,
 writable=False,
   readable=False,default=''),migrate=False)
 
  auth.define_tables()        
      
    # creates
 all needed tables
 
 auth.settings.create_user_groups=False
 
  But the application return the
 next
   exception:
 
    self._db._execute(query)
    File
   /home/fvillarroel/web2py/gluon/sql.py, line
 726, in lambda
      self._execute = lambda *a,
 **b:
 self._cursor.execute(*a, **b)
  ProgrammingError: no existe la
 relación
 «auth_group»
 
  What is the struct of the table
 auth_group?
 
  what i am doing wrong?
 
  Any idea or how i can solved the
 problem.
 
  Fernando
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:21524] Re: Mapping databse

2009-05-08 Thread FERNANDO VILLARROEL


Hello Alvaro thank you for your answer and help

Fernando
--- On Fri, 5/8/09, Álvaro Justen [Turicas] alvarojus...@gmail.com wrote:

 From: Álvaro Justen [Turicas] alvarojus...@gmail.com
 Subject: [web2py:21499] Re: Mapping databse
 To: web2py@googlegroups.com
 Date: Friday, May 8, 2009, 2:43 PM
 
 On Fri, May 8, 2009 at 2:27 PM, Yarko Tymciurak yark...@gmail.com
 wrote:
  Ok, great.
  Besides having done the backend work for this already,
  one thing I
  particularly like about the way Sqlalchemy set this up
 is being able to say
  something which would look like (in web2py):
  db.define_table('some_existing_table', autoload=true)
 
  This concept I like - autoload == reflect the table,
 and implies
  migrate=False.
  As long as we go in this direction, if we add to this
 recognition of _any_
  primary key which is an index, we should be able to
 map this internally in
  web2py --- this combination would be really useful I
 think.
 
 The first implementation I unified that functions, but my
 goal is to
 have a load_table(self, tablename) and
 discover_tables(self,
 string=False). discover_tables will get all tables and
 call
 load_table for each one (if string=True, it returns a
 string with
 db.define_table() syntax for that table, instead of
 executing that
 define_table code -- string=False|True is just working
 right now).
 
  Thank you Alvaro!
 
 Thank you too!
 
 -- 
  Álvaro Justen
  Peta5 - Telecomunicações e Software Livre
  21 3021-6001 / 9898-0141
  http://www.peta5.com.br/
 
  
 


  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---