[web2py] Re: not authorised flash message when I used SQLFORM.grid, but worked fine with SQLFORM.smartgrid
hi Rudy, I am facing the same issue. Did you get why this is happeneing? On Saturday, April 22, 2017 at 1:49:15 PM UTC+5:30, Rudy wrote: > > Hi there, > > It feels really strange to me that when i used SQLFORM.grid(), I got a > flash message "not authorised", but when i used smartgrid(), it worked just > fine (in both cases i had logged in already). I tried to removed > @auth.requires_login(), but same behaviour happened. I seem to miss some > very fundamental knowledge using SQLFORM.grid(). Below is the simplified > code. Any help is much appreciated. > > @auth.requires_login() > def list_items2(): > response.view='accounting/list_items.html' > grid = SQLFORM.grid(db.auth_user) > return locals() > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] adding minutes in field which has datatype as 'datetime'
Hello all, I have a table in database as: db.define_table('job', Field('schedule_time','datetime',default = request.now)) I want to compare the (value in schedule_time field + 3 minutes) with current time(getting that by using request.now). So my question is does web2py handles this adding minutes someway or i have to manage this by myself( as i will access minute field and add 3 in that, then i have to handle that if minutes become more than 56 then i have to make respective changes in hour field and if value of hour field will exceed 24 then make changes in day field too). Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: how to compare date time in web2py?
You can compare time here by using the relational operators. Access the current time by using 'request.now' (its value will be in same format as 'update_on' field of your table) then you can just compare it as : if (dbquery).updated_time > request.now: //do something On Thursday, July 19, 2012 at 2:35:41 PM UTC+5:30, Amit wrote: > > Hi, > I have some records in a table and each record is having one field of type > datetime [fromat : 2012-07-19 23:12:0 (-MM-DD HH:MM:SS)], table > structure is: > > Emp_ID > Emp_Name > Emp_Address > Emp_Salary > updated_on(Type: datetime) > > periodically getting data against each Emp_ID and updating to the > particular record, every 20 mins data has to be updated for each Emp_ID, > for e.g : suppose for one Emp_ID data has updated on 2012-07-19 10:10:00 > then again it has to update on 2012-07-19 10:30:00 etc... > > and if data is not updated in 20 mins then one scheduler will verify > against the updated_on column value and inform user that data has not > updated for particular employee. > > Problem facing: > How to compare current datetime with updated_on coulmn value in web2py? > can anybody please share me the code to achieve the same? > -- 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.