[web2py] Re: Get Distinct dates
database. On Tuesday, August 9, 2016 at 3:08:20 PM UTC+2, Marlysson Silva wrote: > > Backend: database or language programming? > > Em terça-feira, 9 de agosto de 2016 09:59:37 UTC-3, Niphlod escreveu: >> >> let the backend do set operations: it's by far faster than pure python >> (saves bandwith, too) >> >> On Tuesday, August 9, 2016 at 12:49:35 PM UTC+2, Marlysson Silva wrote: >>> >>> Use of a SET in list returned of result. >>> >>> Em segunda-feira, 8 de agosto de 2016 15:21:58 UTC-3, madhu nomula >>> escreveu: Hello, In Web2py database we have date entries. Need to get distinct dates and bind to a dropdown control. But I am unable to get : Please find code below: Controller: myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id== auth.user.id) ).select((db.MC.activity_date )) View: {{for x in myrows:}}>>> value="{{=x.activity_date}}">{{=x.activity_date.strftime("%m/%d/%Y")}}{{pass}} Need to bind only distinct dates to this >>> Appreciate your help in advance. Regards, MC >>> -- 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: Get Distinct dates
Backend: database or language programming? Em terça-feira, 9 de agosto de 2016 09:59:37 UTC-3, Niphlod escreveu: > > let the backend do set operations: it's by far faster than pure python > (saves bandwith, too) > > On Tuesday, August 9, 2016 at 12:49:35 PM UTC+2, Marlysson Silva wrote: >> >> Use of a SET in list returned of result. >> >> Em segunda-feira, 8 de agosto de 2016 15:21:58 UTC-3, madhu nomula >> escreveu: >>> >>> Hello, >>> >>> In Web2py database we have date entries. Need to get distinct dates and >>> bind to a dropdown control. But I am unable to get : >>> >>> Please find code below: >>> Controller: >>> myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id== >>> auth.user.id) ).select((db.MC.activity_date )) >>> >>> View: >>> >>> >>> {{for x in myrows:}}>> >>> value="{{=x.activity_date}}">{{=x.activity_date.strftime("%m/%d/%Y")}}{{pass}} >>> >>> >>> >>> >>> >>> Need to bind only distinct dates to this >> Appreciate your help in advance. >>> >>> Regards, >>> MC >>> >> -- 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: Get Distinct dates
let the backend do set operations: it's by far faster than pure python (saves bandwith, too) On Tuesday, August 9, 2016 at 12:49:35 PM UTC+2, Marlysson Silva wrote: > > Use of a SET in list returned of result. > > Em segunda-feira, 8 de agosto de 2016 15:21:58 UTC-3, madhu nomula > escreveu: >> >> Hello, >> >> In Web2py database we have date entries. Need to get distinct dates and >> bind to a dropdown control. But I am unable to get : >> >> Please find code below: >> Controller: >> myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id== >> auth.user.id) ).select((db.MC.activity_date )) >> >> View: >> >> >> {{for x in myrows:}}> >> value="{{=x.activity_date}}">{{=x.activity_date.strftime("%m/%d/%Y")}}{{pass}} >> >> >> >> >> >> Need to bind only distinct dates to this > Appreciate your help in advance. >> >> Regards, >> MC >> > -- 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: Get Distinct dates
Use of a SET in list returned of result. Em segunda-feira, 8 de agosto de 2016 15:21:58 UTC-3, madhu nomula escreveu: > > Hello, > > In Web2py database we have date entries. Need to get distinct dates and > bind to a dropdown control. But I am unable to get : > > Please find code below: > Controller: > myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id== > auth.user.id) ).select((db.MC.activity_date )) > > View: > > > {{for x in myrows:}} > value="{{=x.activity_date}}">{{=x.activity_date.strftime("%m/%d/%Y")}}{{pass}} > > > > > > Need to bind only distinct dates to this Appreciate your help in advance. > > Regards, > MC > -- 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: Get Distinct dates
select(whatever, distinct=True) should seal the deal. On Monday, August 8, 2016 at 8:21:58 PM UTC+2, madhu nomula wrote: > > Hello, > > In Web2py database we have date entries. Need to get distinct dates and > bind to a dropdown control. But I am unable to get : > > Please find code below: > Controller: > myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id== > auth.user.id) ).select((db.MC.activity_date )) > > View: > > > {{for x in myrows:}} > value="{{=x.activity_date}}">{{=x.activity_date.strftime("%m/%d/%Y")}}{{pass}} > > > > > > Need to bind only distinct dates to this Appreciate your help in advance. > > Regards, > MC > -- 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.