Good idea.

Massimo

On Jun 28, 12:38 am, Hans Donner <hans.don...@pobox.com> wrote:
> Yes, can see the value of having some statement executed right before
> the actual insert (or update).
> Massimo, would it be possible wit the new DAL to provide some hooks
> into the table that can do some pre insert, update etc stuff? (or
> provide a way to specify a new table instance where we can do speciifc
> stuff).
>
> This way we can add some common meta data to a table like
> inserted/modified stamps and/or logging to a differen table for
> specials cases without having to rely on the backend or having to
> build it into other logic.
>
> On Sat, Jun 27, 2009 at 10:58 PM, mdipierro<mdipie...@cs.depaul.edu> wrote:
>
> > You can do it with a trick but I cannot promise it will work with the
> > new DAL
>
> > from gluon.sql import SQLXorable
> > db.define_table(....
> >    SQLFIELD('add_date', 'datetime', default=SQLXorable("any SQL code
> > here"))
> > )
>
> > Anyway, I think it works but I am not 100% sure.
>
> > Massimo
>
> > On Jun 27, 3:24 pm, kuba <kubano...@gmail.com> wrote:
> >> On 27 Cze, 22:09, Hans Donner <hans.don...@pobox.com> wrote:
>
> >> > Have you tried the 'default'  keyword for SQLField?
>
> >> > SQLFIELD('add_date', 'datetime', default=<insert your default here>)?
>
> >> yes, I thought also about it.
>
> >> The problem is that it accepts datetime type (or what ever it is) not
> >> string
>
> >> i can only pass request.now to it - and if use crud.create.create()
> >> with such table it automaticly initialize the field - so if user waits
> >> some time with button clicking the value is not exacly the time of
> >> insertion.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to