Hello,

Well I've tried

 CodeOF=request.vars.OF or request.vars.META_OF but it does not change
anything

Using the appadmin works (I can update records of db.OF)
Here is my model:
db.define_table("OF",

    SQLField("META_OF", "integer"),

    SQLField("META_RespOF","string"),

    SQLField("META_Affectation", "string"),

    SQLField("META_Debut", "datetime"),

    SQLField("META_Fin", "datetime"),

    SQLField("META_QTranfert", "integer"))



db.define_table("GPOF",

    SQLField("OF_CODE", "integer",notnull=False, default=None),

    SQLField("OF_CART", "string",notnull=False, default=None),

    SQLField("OF_QUAN", "double",notnull=False, default=None))

 I've put a {{=BEAUTIFY(request.vars)}} at the end of my view and I
can check that each field (Meta_*) of my MetaForm seems to be passed
when I submit MetaForm, so I do not understand why it is not updated
in the database

Thanks for your help

On 12 mar, 22:10, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Need to see the model to make sure but try replace
>
>     CodeOF=request.vars.OF
>
> with
>
>     CodeOF=request.vars.OF or request.vars.META_OF
>
> The problem that when the second form is submitted vars.OF is None so
> there no record to edit.
>
> On Mar 12, 2:03 pm,JmiXIII<sylvn.p...@gmail.com> wrote:
>
> > I'm facing a pb with the following controller :
>
> > # Formulaire de saisie principal
>
> > from gluon.tools import Crud
>
> > crud = Crud(globals(), db)
>
> > def saisie():
>
> >     listeOF=db(db.GPOF.id>0).select()
>
> >     CodeOF=request.vars.OF
>
> >     Selection=FORM('Code OF:',
> > INPUT(_name='OF',_value=CodeOF,requires=IS_IN_DB(db, 'GPOF.OF_CODE')),
>
> >                                INPUT(_type='submit',_value='Cliquer
> > pour afficher'))
>
> >     if Selection.accepts(request.vars,keepvalues=True):
>
> >         pass
>
> >     MetaOF=db(db.OF.META_OF==CodeOF).select() #Sélection des données
> > méta de l'OF (démarrage, responsable...)
>
> >     if len(MetaOF):
>
> >         MetaForm=SQLFORM(db.OF,record=MetaOF[0],deletable=True)
>
> >     else:
>
> >         MetaForm=SQLFORM(db.OF)
>
> >     if MetaForm.accepts(request.vars,session):
>
> >         response.flash = 'Données saisies'
>
> >     return dict(Selection=Selection,MetaForm=MetaForm)
>
> > The selection form works well and helps filtering data (this
> > controller is extracted from a bigger one).
> > When len(MetaOF)=0 , it's ok , a new record is inserted
> > When len(MetaOF)=1, it render the right record but if I try to modify
> > it , it doesn't work (no error message) but no response.flash neither
>
> > Could you help me understant what's wrong....
>
> > Thanks
>
> >JmiXIII

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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