I have two nearly identical models fpn0302 and fpn0303.  The only difference
is that the second one has a few extra fields.

The forms are fairly complex so I make use of custom layouts to handle the
forms.

fpn0302 works as expected while fpn0303' s data does not end up in the
database.
There are no error messages.

The controllers for both are identical except for the reference to the
involved table.  The views also.

Both the models and views are to long to post in this email.  The
controllers look like this:

def fpn0302_create():
    table=db.fpn0302
    crud.settings.keepvalues = True
    form=crud.create(db.fpn0302,onaccept=lambda form:
                     show_id (form.vars.id))
    return dict(form=form)


def fpn0303_create():
    table=db.fpn0303
    crud.settings.keepvalues = True
    form=crud.create(db.fpn0303,onaccept=lambda form:
                     show_id (form.vars.id))
    return dict(form=form)

If I use fpn0303 with the crud-form ({{=BEAUTIFY(form)}}) the process works
as expected but I can not use that in production.  There are to many layout
and label problems.

How do I determine the data does not get inserted into the table (fpn0303)?

The diff between the two views:

$ diff fpn0302_create.html fpn0303_create.html
3c3
<   <h2>FP Numeracy: Classroom visit form Grade 2 (FPN0302)</h2>
---
>   <h2>FP Numeracy: Classroom visit form Grade 3 (FPN0303)</h2>
22c22
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
66c66
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
103c103
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
140c140
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
176c176
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
211c211
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
250c250
<     {{label=db((db.label.fieldname==veld[i]) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld[i]) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
289c289
< {{for veld in [ 'q4_timea', 'q4_timeb', 'q4_timec',
'q4_timed','q4_timee','q4_timef','q4_timeg','q4_timeh','q4_timei']:}}
---
> {{for veld in [ 'q4_timea', 'q4_timeb', 'q4_timec',
'q4_timed','q4_timee','q4_timef','q4_timeg','q4_timeh']:}}
294c294
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
316c316
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
332c332
< {{for veld in [  'q4_capacitya', 'q4_capacityb', 'q4_capacityc']:}}
---
> {{for veld in [  'q4_capacitya', 'q4_capacityb', 'q4_capacityc',
'q4_capacityd']:}}
337c337
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
353c353
< {{for veld in ['q4_lengtha', 'q4_lengthb', 'q4_lengthc']:}}
---
> {{for veld in ['q4_lengtha', 'q4_lengthb', 'q4_lengthc', 'q4_lengthd',
'q4_lengthe', 'q4_lengthf']:}}
358c358
<     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>
---
>     {{label=db((db.label.fieldname==veld) &
(db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}</div>

Regards
Johann
-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
                                                    2 Pet. 1:2b,3a

Reply via email to