Hi Johann,
I've just investigated the problem.

Do you use virtual fields for computing the article_eq and ltitle?

If so, SOLIDFORM as well as SQLFORM need to know the filed properties
of the virtual fields, such as labels and representation. Then, one
solution would be to define a "virtual table" in which the "Fields" of
the virtual fields are defined, and pass it to the SOLIDFORM as
follows:

form = SOLIDFORM(
        DAL(None).define_table('no_table',
            db.akb_articles,
            *[Field('article_eq', label='xxx'),
              Field('ltitle', represent=yyy)]),
        record=rekord,
        fields=fields_read,
        showid=False,
        readonly=True)

If it didn't work, please let me know more details.

Regards,
Kenji

On 12月16日, 午後9:46, luismurciano <luismurci...@gmail.com> wrote:
> may be you should as Hosoda Kenji himself, he's a kind guy, and solve
> a bug i found in just few days. you can ask him in the comments
> section in the plugin page.
>
> On 15 dic, 11:17, Johann Spies <johann.sp...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I get
>
> >   table = self.createform(xfields)
> >   File "applications/init/modules/plugin_solidform.py", line 96, in 
> > createform
> >     n = len(self.flat_fields)
> > KeyError: 'article_eq'
>
> > when I use the following code:
>
> > fields = ['id',
> >               'title',
> >               'primaryauthor',
> >               'authors',
> >               'rp_author',
> >               'journal',
> >               'bib_id',
> >               'bib_pages',
> >               'doctype',
> >               'language',
> >               'abstract',
> >               'bib_vol',
> >               'bib_date',
> >               'url',
> >               'pubyear',
> >               'ut',
> >               'scopus_id',
> >               'sabinet_id',
> >               'isap_id',
> >               'ltitle',
> >               'article_eq',
> >               'uuid',
> >               'created_on',
> >               'created_by',
> >               'updated_on',
> >               'updated_by']
>
> >     fields_read = [['id', None],
> >                    'title',
> >                    ['primaryauthor', None],
> >                    'authors',
> >                    ['rp_author', 'journal'],
> >                    ['bib_id', 'bib_pages' ],
> >                    ['doctype', 'language' ],
> >                    'abstract',
> >                    ['bib_vol', 'bib_date'],
> >                    'url',
> >                    ['pubyear', 'ut' ],
> >                    ['scopus_id', 'sabinet_id', 'isap_id' ],
> >                    'ltitle',
> >                    ['article_eq', 'uuid' ] ,
> >                    ['created_on', 'created_by'],
> >                    ['updated_on', 'updated_by']
> >                    ]
>
> >       form = SOLIDFORM(db.akb_articles, rekord, fields = fields, showid =
> > False, readonly = True)
>
> > The error occurs when I use fields = fields as well as the original one I
> > have tried: fields = fields_read.
>
> > The list as in 'fields'  is the result of db[table].fields().  So the
> > fieldnames are correct.
>
> > The following fields are computed fields: article_eq and ltitle.
>
> > Any idea what is causing the key-error?
>
> > The version of solidtable is one I downloaded today 
> > fromhttp://dev.s-cubism.com/web2py_plugins/pack_plugin/solidform
>
> > Regards
> > Johann
> > --
> > Because experiencing your loyal love is better than life itself,
> > my lips will praise you.  (Psalm 63:3)

Reply via email to