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.billsec>0) & 
(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.billsec>0) 
& (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.

Reply via email to