Hello Monks (been a while!),

I've been steadily falling for FormFu and DBIx::Class::Schema, but have finally found something that i'm either not describing to the search engine spirits correctly (probable) or no-one has tried to do before (unlikely). As such I request your aid on this hurdle.

Situation is as follows :

Essentially, I'm trying to get sum(form.entered is not null) from within the form fu repeatable element. YAML form specification as follows:

--- indicator: submitted elements: - type: Hidden name: count - type: Block tag: table elements: - type: Repeatable increment_field_names: 1 nested_name: SubBatches counter_name: count elements: - type: Hidden name: batch_uid - type: Block tag: tr elements: - type: Block tag: td elements: - type: Label name: batch_id - type: Block tag: td elements: - type: Label name: checkable - type: Block tag: td elements: - type: Select empty_first: 1 name: user_id model_config: resultset: User id_column: user_id label_column: user_name attributes: order_by: user_name - type: Block tag: td elements: - type: Label name: form_count - type: Block tag: td elements: - type: Label #right here i want sum(form.entered is not null) where batch_uid = cur +rent name: forms_entered - type: Block tag: td elements: - type: Label #and here, get sum of issues from forms in batch where batch_uid = cur +rent name: issues - type: Block tag: td elements: - type: Text name: forms_to_check - type: Block tag: td elements: - type: Text name: num_checked - type: Block tag: td elements: - type: Text name: errors - type: Block tag: td elements: - type: Text name: forms_wer

Firstly i'm at a loss as how to uniquely identify a section of forms from within the repeatable element, and secondly how to actually total the values from that element.

Any and all help would be greatly appreciated.


In reply to FormFu: Accessing sub query results from within a repeatable element by TRoderic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.