[Catalyst] No database defaults with FormHandler and DBIC

LNATION . thisusedtobeanemail at gmail.com
Sat Dec 10 15:51:52 GMT 2016


My email coding has some syntax errors, apologies.

On Sat, Dec 10, 2016 at 4:50 PM, LNATION . <thisusedtobeanemail at gmail.com>
wrote:

> and then make a role role
>
> has default_column_spec => ( ...)
>
> before render => sub {
>       while (my ($field, $default) = each %{ $_[0]->default_column_spec}{
>           unless ($_[0]->field($filed)->value) { # mayb editing
>                 $_[0]->field('$field)->value($default);
>            }
>       }
> }
>
>
> On Sat, Dec 10, 2016 at 4:41 PM, LNATION . <thisusedtobeanemail at gmail.com>
> wrote:
>
>> maybe something like ......
>>
>>     my $columns = $result->result_source->columns_info;
>>     my %default_form_spec;
>>     for my $name (keys %{$columns}){
>>          if (my $default = $columns->{$name}->{default_value}) {
>>              $default_form_spec{  $name } = $default;
>>          }
>>     }
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20161210/9b6478ea/attachment.htm>


More information about the Catalyst mailing list