max_id= db(db.table.autonumber>1).select(db.table.autonumber, #
select all records, and only pull the autonumber column
orderby=~db.table.autonumber, #
descending sort on the autonumber, (highest first)
limitby=(0,1) # limit the query and
only select the first record
).first().autonumber # pull the first record
from the web2py rows object, and get its autonumber member
db.table.autonumber.default = max_id + 1 # Set the table default as
the last autonumber and incremented by one.
db.table.autonumber.writable = False
form = crud.create(db.table)
-Thadeus
On Tue, Jan 19, 2010 at 4:32 AM, ceriox <[email protected]> wrote:
> thanks for the reply but i'm not a good web2py programmer ... i
> writing my first real app
> you can write the code for my request? (i can't understand the post of
> your link)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.