I found the Solution here:

http://groups.google.com/group/web2py/browse_thread/thread/f3f28fde6a84820a/b8497712be18bb40?lnk=gst&q=crud.create#b8497712be18bb40



On Sep 18, 6:41 pm, winti <stefan.winterb...@gmail.com> wrote:
> How to add a record with crud.create with a hidden form field
> (Orderid) and a value (taken from variable orderid within controller).
>
> model:
> db.define_table("workingtime",
>
> Field("StartTime","datetime",default=datetime.datetime.today()),
>         Field("EndTime","datetime",default=""),
>         Field("Comment","string",default=""),
>         Field("Orderid","string",default="",readable=False),)
>
> controller:
>
> def addcatsdata():
>     orderid = request.args(0)
>
> addcatstimeentry=crud.create(db.workingtime,next=URL(request.application,re 
> quest.controller,'editjob'),message=T("enty
> added"))
>
>     return dict(addcatstimeentry=addcatstimeentry)

Reply via email to