Thanks Massimo!
2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:
it would be much easier to just provide a function row.field.asdate()
or row.field.astime()
How this could be done? Give me an hint and I'll procede by myself!
Thank you!
I think row.field.date() already works because row.field is a datetime
object
True. I just checked and this already works . :-)
On Jul 21, 4:36 am, Vasile Ermicioi elff...@gmail.com wrote:
I think row.field.date() already works because row.field is a datetime
object
Sorry for being retarted!
I have this:
db.define_table('test', Field('comment','string'), Field('data','datetime'))
but the function:
def getcommentsbydate():
rows = db(db.test).select(db.test.data.comment, db.test.data.date())
return dict(rows=rows)
throws an exception complaining that
No that does not work for the reasons discussed above but this does
def getcommentsbydate():
rows = db(db.test).select(db.test.data.comment, db.test.data)
for row in rows: row.data = row.data.date()
return dict(rows=rows)
On Jul 21, 8:06 am, Angelo Compagnucci
Thanks Massimo!
So I must traverse the list at least one time. I dont know how much
time is spent in this operation, but I have a very large number of
records, so I'll test this solution.
Thank you!
2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:
No that does not work for the reasons
I don't know exactly how virtual fields are implemented (if it would prevent
another run through the result set) but might be another approach.
http://web2py.com/book/default/chapter/06#Virtual-Fields
You can just call row.data.date() instead of row.data when you need
the value.
On Jul 21, 10:49 am, Angelo Compagnucci angelo.compagnu...@gmail.com
wrote:
Thanks Massimo!
So I must traverse the list at least one time. I dont know how much
time is spent in this operation, but I have a very
I'll try to explain better.
I have to exctract some statistics from a radius accounting table that
is generally a really big table.
After exctracting tha data, i pass it to jqplot.com via a json service
to be rendered.
For some graphics, I have to exctract a big amount of dates from
accounting
I agree it would be useful.
It will be tricky to implement.
Moreover
row = db().select(db.table.field.date()).first()
would not go into row.field but into row[db.table.field.date()]
it would be much easier to just provide a function row.field.asdate()
or row.field.astime()
On Jul 20, 5:03
10 matches
Mail list logo