[Catalyst] No database defaults with FormHandler and DBIC
LNATION .
thisusedtobeanemail at gmail.com
Sat Dec 10 15:50:46 GMT 2016
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/5b20b80d/attachment.htm>
More information about the Catalyst
mailing list