Permalink
Browse files

don't retrieve item values if 'writeonly' flag is set

  • Loading branch information...
1 parent 86bf0df commit 7c015adeff335f40cbb3abbea5613604c04b63f5 @gshank committed Mar 4, 2013
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/HTML/FormHandler/InitResult.pm
  2. +3 −0 lib/HTML/FormHandler/Manual/Database.pod
@@ -90,7 +90,7 @@ sub _result_from_object {
$result = $field->_result_from_fields($result);
}
else {
- my $value = $self->_get_value( $field, $item );
+ my $value = $self->_get_value( $field, $item ) if ! $field->writeonly;
$result = $field->_result_from_object( $result, $value );
}
$self_result->add_result($result) if $result;
@@ -24,6 +24,9 @@ selection lists, and validate input. A 'single' relationship is processed
by L<HTML::FormHandler::Field::Compound>. A 'has_many' relationship is
processed by L<HTML::FormHandler::Field::Repeatable>.
+Do not use database row method names, such as 'delete', as field names in
+a database form.
+
You can pass in either the primary key or a row object to the form. If a
primary key (item_id) is passed in, you must also provide the schema.
The model will use the item_class (DBIC source name) to fetch the row from the

0 comments on commit 7c015ad

Please sign in to comment.