{"id":19056394,"url":"https://github.com/formfu/html-formfu-model-dbic","last_synced_at":"2025-04-24T04:35:10.069Z","repository":{"id":1201733,"uuid":"1110326","full_name":"FormFu/HTML-FormFu-Model-DBIC","owner":"FormFu","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-04T17:21:26.000Z","size":413,"stargazers_count":10,"open_issues_count":3,"forks_count":15,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T06:51:16.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://formfu.rocks","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FormFu.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-24T20:41:31.000Z","updated_at":"2020-09-04T17:23:42.000Z","dependencies_parsed_at":"2022-08-16T12:35:09.644Z","dependency_job_id":null,"html_url":"https://github.com/FormFu/HTML-FormFu-Model-DBIC","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormFu%2FHTML-FormFu-Model-DBIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormFu%2FHTML-FormFu-Model-DBIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormFu%2FHTML-FormFu-Model-DBIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormFu%2FHTML-FormFu-Model-DBIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FormFu","download_url":"https://codeload.github.com/FormFu/HTML-FormFu-Model-DBIC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566255,"owners_count":21451225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:49:16.804Z","updated_at":"2025-04-24T04:35:10.051Z","avatar_url":"https://github.com/FormFu.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=head1 NAME\n\nHTML::FormFu::Model::DBIC - Integrate HTML::FormFu with DBIx::Class\n\n=head1 VERSION\n\nversion 2.03\n\n=head1 SYNOPSIS\n\nExample of typical use in a Catalyst controller:\n\n    sub edit : Chained {\n        my ( $self, $c ) = @_;\n\n        my $form = $c-\u003estash-\u003e{form};\n        my $book = $c-\u003estash-\u003e{book};\n\n        if ( $form-\u003esubmitted_and_valid ) {\n\n            # update dbic row with submitted values from form\n\n            $form-\u003emodel-\u003eupdate( $book );\n\n            $c-\u003eresponse-\u003eredirect( $c-\u003euri_for('view', $book-\u003eid) );\n            return;\n        }\n        elsif ( !$form-\u003esubmitted ) {\n\n            # use dbic row to set form's default values\n\n            $form-\u003emodel-\u003edefault_values( $book );\n        }\n\n        return;\n    }\n\n=head1 SETUP\n\nFor the form object to be able to access your L\u003cDBIx::Class\u003e schema, it needs\nto be placed on the form stash, with the name C\u003cschema\u003e.\n\nThis is easy if you're using L\u003cCatalyst-Controller-HTML-FormFu\u003e, as you can\nset this up to happen in your Catalyst app's config file.\n\nFor example, if your model is named C\u003cMyApp::Model::Corp\u003e, you would set this\n(in L\u003cConfig::General\u003e format):\n\n    \u003cController::HTML::FormFu\u003e\n        \u003cmodel_stash\u003e\n            schema Corp\n        \u003c/model_stash\u003e\n    \u003c/Controller::HTML::FormFu\u003e\n\nOr if your app's config file is in L\u003cYAML\u003e format:\n\n    'Controller::HTML::FormFu':\n        model_stash:\n            schema: Corp\n\n=head1 METHODS\n\n=head2 default_values\n\nArguments: $dbic_row, [\\%config]\n\nReturn Value: $form\n\n    $form-\u003emodel-\u003edefault_values( $dbic_row );\n\nSet a form's default values from the database, to allow a user to edit them.\n\n=head2 update\n\nArguments: [$dbic_row], [\\%config]\n\nReturn Value: $dbic_row\n\n    $form-\u003emodel-\u003eupdate( $dbic_row );\n\nUpdate the database with the submitted form values.\n\n=head2 create\n\nArguments: [\\%config]\n\nReturn Value: $dbic_row\n\n    my $dbic_row = $form-\u003emodel-\u003ecreate( {resultset =\u003e 'Book'} );\n\nLike L\u003c/update\u003e, but doesn't require a C\u003c$dbic_row\u003e argument.\n\nYou need to ensure the DBIC schema is available on the form stash - see\nL\u003c/SYNOPSIS\u003e for an example config.\n\nThe C\u003cresultset\u003e must be set either in the method arguments, or the form or\nblock's C\u003cmodel_config\u003e.\n\nAn example of setting the ResultSet name on a Form:\n\n    ---\n    model_config:\n      resultset: FooTable\n\n    elements:\n      # [snip]\n\n=head2 options_from_model\n\nPopulates a multi-valued field with values from the database.\n\nThis method should not be called directly, but is called for you during\nC\u003c\u003c $form-\u003eprocess \u003e\u003e by fields that inherit from\nL\u003cHTML::FormFu::Element::_Group\u003e. This includes:\n\n=over\n\n=item L\u003cHTML::FormFu::Element::Select\u003e\n\n=item L\u003cHTML::FormFu::Element::Checkboxgroup\u003e\n\n=item L\u003cHTML::FormFu::Element::Radiogroup\u003e\n\n=item L\u003cHTML::FormFu::Element::ComboBox\u003e\n\n=back\n\nTo use you must set the appropriate C\u003cresultset\u003e on the element C\u003cmodel_config\u003e:\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n\n=head1 BUILDING FORMS\n\n=head2 single table\n\nTo edit the values in a row with no related rows, the field names simply have\nto correspond to the database column names.\n\nFor the following DBIx::Class schema:\n\n    package MySchema::Book;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"book\");\n\n    __PACKAGE__-\u003eadd_columns(\n        id     =\u003e { data_type =\u003e \"INTEGER\" },\n        title  =\u003e { data_type =\u003e \"TEXT\" },\n        author =\u003e { data_type =\u003e \"TEXT\" },\n        blurb  =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"id\");\n\n    1;\n\nA suitable form for this might be:\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Text\n        name: author\n\n      - type: Textarea\n        name: blurb\n\n=head2 might_have and has_one relationships\n\nSet field values from a related row with a C\u003cmight_have\u003e or C\u003chas_one\u003e\nrelationship by placing the fields within a\nL\u003cBlock|HTML::FormFu::Element::Block\u003e (or any element that inherits from\nBlock, such as L\u003cFieldset|HTML::FormFu::Element::Fieldset\u003e) with its\nL\u003cHTML::FormFu/nested_name\u003e set to the relationship name.\n\nFor the following DBIx::Class schemas:\n\n    package MySchema::Book;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"book\");\n\n    __PACKAGE__-\u003eadd_columns(\n        id    =\u003e { data_type =\u003e \"INTEGER\" },\n        title =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"id\");\n\n    __PACKAGE__-\u003emight_have( review =\u003e 'MySchema::Review', 'book' );\n\n    1;\n\n\n    package MySchema::Review;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"review\");\n\n    __PACKAGE__-\u003eadd_columns(\n        id          =\u003e { data_type =\u003e \"INTEGER\" },\n        book        =\u003e { data_type =\u003e \"INTEGER\", is_nullable =\u003e 1 },\n        review_text =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"book\");\n\n    __PACKAGE__-\u003ebelongs_to( book =\u003e 'MySchema::Book' );\n\n    1;\n\nA suitable form for this would be:\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Block\n        nested_name: review\n        elements:\n          - type: Textarea\n            name: review_text\n\nFor C\u003cmight_have\u003e and C\u003chas_one\u003e relationships, you generally shouldn't need\nto have a field for the related table's primary key, as DBIx::Class will\nhandle retrieving the correct row automatically.\n\nYou can also set a C\u003chas_one\u003e or C\u003cmight_have\u003e relationship using a multi value\nfield like L\u003cSelect|HTML::FormFu::Element::Select\u003e.\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Select\n        nested: review\n        model_config:\n          resultset: Review\n\nThis will load all reviews into the select field. If you select a review from\nthat list, a current relationship to a review is removed and the new one is\nadded. This requires that the primary key of the C\u003cReview\u003e table and the\nforeign key do not match.\n\n=head2 has_many and many_to_many relationships\n\nThe general principle is the same as for C\u003cmight_have\u003e and C\u003chas_one\u003e above,\nexcept you should use a L\u003cRepeatable|HTML::FormFu::Element::Repeatable\u003e\nelement instead of a Block, and it needs to contain a\nL\u003cHidden|HTML::FormFu::Element::Hidden\u003e field corresponding to the primary key\nof the related table.\n\nThe Repeatable block's\nL\u003cnested_name|HTML::FormFu::Element::Repeatable/nested_name\u003e must be set to the\nname of the relationship.\n\nThe Repeable block's\nL\u003cincrement_field_names|HTML::FormFu::Element::Repeatable/increment_field_names\u003e\nmust be true (which is the default value).\n\nThe Repeable block's\nL\u003ccounter_name|HTML::FormFu::Element::Repeatable/counter_name\u003e must be set to\nthe name of a L\u003cHidden|HTML::FormFu::Element::Hidden\u003e field, which is placed\noutside of the Repeatable block.\nThis field is used to store a count of the number of repetitions of the\nRepeatable block were created.\nWhen the form is submitted, this value is used during C\u003c\u003c $form-\u003eprocess \u003e\u003e\nto ensure the form is rebuilt with the correct number of repetitions.\n\nTo allow the user to add new related rows, either C\u003cempty_rows\u003e or\nC\u003cnew_rows_max\u003e must be set - see L\u003c/\"Config options for Repeatable blocks\"\u003e\nbelow.\n\nFor the following DBIx::Class schemas:\n\n    package MySchema::Book;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"book\");\n\n    __PACKAGE__-\u003eadd_columns(\n        id    =\u003e { data_type =\u003e \"INTEGER\" },\n        title =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"id\");\n\n    __PACKAGE__-\u003ehas_many( review =\u003e 'MySchema::Review', 'book' );\n\n    1;\n\n\n    package MySchema::Review;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"review\");\n\n    __PACKAGE__-\u003eadd_columns(\n        book        =\u003e { data_type =\u003e \"INTEGER\" },\n        review_text =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"book\");\n\n    __PACKAGE__-\u003ebelongs_to( book =\u003e 'MySchema::Book' );\n\n    1;\n\nA suitable form for this might be:\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Hidden\n        name: review_count\n\n      - type: Repeatable\n        nested_name: review\n        counter_name: review_count\n        model_config:\n          empty_rows: 1\n        elements:\n          - type: Hidden\n            name: book\n\n          - type: Textarea\n            name: review_text\n\n=head2 belongs_to relationships\n\nBelongs-to relationships can be edited / created with a ComboBox element.\nIf the user selects a value with the Select field, the belongs-to will be set\nto an already-existing row in the related table.\nIf the user enters a value into the Text field, the belongs-to will be set\nusing a newly-created row in the related table.\n\n    elements:\n      - type: ComboBox\n        name: author\n        model_config:\n          resultset: Author\n          select_column: id\n          text_column: name\n\nThe element name should match the relationship name.\nC\u003c\u003c $field-\u003emodel_config-\u003e{select_column} \u003e\u003e should match the related primary\ncolumn.\nC\u003c\u003c $field-\u003emodel_config-\u003e{text_column} \u003e\u003e should match the related text\ncolumn.\n\n=head2 many_to_many selection\n\nTo select / deselect rows from a C\u003cmany_to_many\u003e relationship, you must use\na multi-valued element, such as a\nL\u003cCheckboxgroup|HTML::FormFu::Element::Checkboxgroup\u003e or a\nL\u003cSelect|HTML::FormFu::Element::Select\u003e with\nL\u003cmultiple|HTML::FormFu::Element::Select/multiple\u003e set.\n\nThe field's L\u003cname|HTML::FormFu::Element::_Field/name\u003e must be set to the\nname of the C\u003cmany_to_many\u003e relationship.\n\n=head3 default_column\n\nIf you want to search / associate the related table by a column other it's\nprimary key, set C\u003c\u003c $field-\u003emodel_config-\u003e{default_column} \u003e\u003e.\n\n    ---\n    element:\n        - type: Checkboxgroup\n          name: authors\n          model_config:\n            default_column: foo\n\n=head3 link_values\n\nIf you want to set columns on the link table you can do so if you add a\nC\u003clink_values\u003e attribute to C\u003cmodel_config\u003e:\n\n    ---\n    element:\n        - type: Checkboxgroup\n          name: authors\n          model_config:\n            link_values:\n              foo: bar\n\n=head3 additive\n\nThe default implementation will first remove all related objects and set the\nnew ones (see L\u003chttp://search.cpan.org/perldoc?DBIx::Class::Relationship::Base#set_$rel\u003e).\nIf you want to add the selected objects to the current set of objects\nset C\u003cadditive\u003e in the C\u003cmodel_config\u003e.\n\n    ---\n    element:\n        - type: Checkboxgroup\n          name: authors\n          model_config:\n            additive: 1\n            options_from_model: 0\n\nL\u003c/options_from_model\u003e is set to C\u003c0\u003e because it will try to fetch\nall objects from the result class C\u003cAuthors\u003e if C\u003cmodel_config\u003e is specified\nwithout a C\u003cresultset\u003e attribute.)\n\n=head1 COMMON ARGUMENTS\n\nThe following items are supported in the optional C\u003cconfig\u003e hash-ref argument\nto the methods L\u003cdefault_values\u003e, L\u003cupdate\u003e and L\u003ccreate\u003e.\n\n=over\n\n=item base\n\nIf you want the method to process a particular Block element, rather than the\nwhole form, you can pass the element as a C\u003cbase\u003e argument.\n\n    $form-\u003edefault_values(\n        $row,\n        {\n            base =\u003e $formfu_element,\n        },\n    );\n\n=item nested_base\n\nIf you want the method to process a particular Block element by\nL\u003cname|HTML::FormFu::Element/name\u003e, you can pass the name as an argument.\n\n    $form-\u003edefault_values(\n        $row,\n        {\n            nested_base =\u003e 'foo',\n        }'\n    );\n\n=back\n\n=head1 CONFIGURATION\n\n=head2 Config options for fields\n\nThe following items are supported as C\u003cmodel_config\u003e options on form fields.\n\n=over\n\n=item accessor\n\nIf set, C\u003caccessor\u003e will be used as a method-name accessor on the\nC\u003cDBIx::Class\u003e row object, instead of using the field name.\n\n=item ignore_if_empty\n\nIf the submitted value is blank, no attempt will be made to save it to the database.\n\n=item null_if_empty\n\nIf the submitted value is blank, save it as NULL to the database. Normally an empty string is saved as NULL when its corresponding field is numeric, and as an empty string when its corresponding field is a text field. This option is useful for changing the default behavior for text fields.\n\n=item delete_if_empty\n\nUseful for editing a \"might_have\" related row containing only one field.\n\nIf the submitted value is blank, the related row is deleted.\n\nFor the following DBIx::Class schemas:\n\n    package MySchema::Book;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"book\");\n\n    __PACKAGE__-\u003eadd_columns(\n        id    =\u003e { data_type =\u003e \"INTEGER\" },\n        title =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"id\");\n\n    __PACKAGE__-\u003emight_have( review =\u003e 'MySchema::Review', 'book' );\n\n    1;\n\n\n    package MySchema::Review;\n    use base 'DBIx::Class';\n\n    __PACKAGE__-\u003eload_components(qw/ Core /);\n\n    __PACKAGE__-\u003etable(\"review\");\n\n    __PACKAGE__-\u003eadd_columns(\n        book        =\u003e { data_type =\u003e \"INTEGER\" },\n        review_text =\u003e { data_type =\u003e \"TEXT\" },\n    );\n\n    __PACKAGE__-\u003eset_primary_key(\"book\");\n\n    __PACKAGE__-\u003ebelongs_to( book =\u003e 'MySchema::Book' );\n\n    1;\n\nA suitable form for this would be:\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Block\n        nested_name: review\n        elements:\n          - type: Text\n            name: review_text\n            model_config:\n              delete_if_empty: 1\n\n=item label\n\nTo use a column value for a form field's\nL\u003clabel|HTML::FormFu::Element::_Field/label\u003e.\n\n=back\n\n=head2 Config options for fields within a Repeatable block\n\n=over\n\n=item delete_if_true\n\nIntended for use on a L\u003cCheckbox|HTML::FormFu::Element::Checkbox\u003e field.\n\nIf the checkbox is checked, the following occurs: for a has-many relationship,\nthe related row is deleted; for a many-to-many relationship, the relationship\nlink is removed.\n\nAn example of use might be:\n\n    elements:\n      - type: Text\n        name: title\n\n      - type: Hidden\n        name: review_count\n\n      - type: Repeatable\n        nested_name: review\n        counter_name: review_count\n        elements:\n          - type: Hidden\n            name: book\n\n          - type: Textarea\n            name: review_text\n\n          - type: Checkbox\n            name: delete_review\n            label: 'Delete Review?'\n            model_config:\n              delete_if_true: 1\n\nNote: make sure the name of this field does not clash with one of your\nL\u003cDBIx::Class::Row\u003e method names (e.g. \"delete\") - see L\u003c/CAVEATS\u003e.\n\n=back\n\n=head2 Config options for Repeatable blocks\n\n=over\n\n=item empty_rows\n\nFor a Repeatable block corresponding to a has-many or many-to-many\nrelationship, to allow the user to insert new rows, set C\u003cempty_rows\u003e to\nthe number of extra repetitions you wish added to the end of the Repeatable\nblock.\n\n=item new_rows_max\n\nSet to the maximum number of new rows that a Repeatable block is allowed to\nadd.\n\nIf not set, it will fallback to the value of C\u003cempty_rows\u003e.\n\n=back\n\n=head2 Config options for options_from_model\n\nThe column used for the element values is set with the C\u003cmodel_config\u003e\nvalue C\u003cid_column\u003e - or if not set, the table's primary column is used.\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n          id_column: pk_col\n\nThe column used for the element labels is set with the C\u003cmodel_config\u003e\nvalue C\u003clabel_column\u003e - or if not set, the first text/varchar column found\nin the table is used - or if one is not found, the C\u003cid_column\u003e is used\ninstead.\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n          label_column: label_col\n\nTo pass the database label values via the form's localization object, set\nC\u003clocalize_label\u003e\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          localize_label: 1\n\nYou can set a C\u003ccondition\u003e, which will be passed as the 1st argument to\nL\u003cDBIx::Class::ResultSet/search\u003e.\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n          condition:\n            type: is_foo\n\nYou can set a C\u003ccondition_from_stash\u003e, which will be passed as the 1st argument to\nL\u003cDBIx::Class::ResultSet/search\u003e.\n\nC\u003ckey\u003e is the column-name to be passed to\nL\u003csearch|DBIx::Class::ResultSet/search\u003e,\nand C\u003cstash_key\u003e is the name of a key on the form L\u003cstash|HTML::FormFu/stash\u003e\nfrom which the value to be passed to L\u003csearch|DBIx::Class::ResultSet/search\u003e\nis found.\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n          condition_from_stash:\n            key: stash_key\n\nIs comparable to:\n\n    $form-\u003eelement({\n        type =\u003e 'Select',\n        name =\u003e 'foo',\n        model_config =\u003e {\n            resultset =\u003e 'TableClass',\n            condition =\u003e {\n                key =\u003e $form-\u003estash-\u003e{stash_key}\n            }\n        }\n    })\n\nIf the value in the stash is nested in a data-structure, you can access it by\nsetting C\u003cexpand_stash_dots\u003e. As you can see in the example below, it\nautomatically handles calling methods on objects, accessing hash-keys on\nhash-references, and accessing array-slots on array references.\n\n    element:\n      - type: Select\n        name: foo\n        model_config:\n          resultset: TableClass\n          condition_from_stash:\n            key: foo.bar.0\n          expand_stash_dots: 1\n\nIs comparable to:\n\n    $form-\u003eelement({\n        type =\u003e 'Select',\n        name =\u003e 'foo',\n        model_config =\u003e {\n            resultset =\u003e 'TableClass',\n            condition =\u003e {\n                key =\u003e $form-\u003estash-\u003e{foo}-\u003ebar-\u003e[0];\n            }\n        }\n    })\n    # Where stash returns a hashref.\n    # The 'foo' hash-key returns an object.\n    # The object-method 'bar' returns an arrayref.\n    # The first array slot returns the value used in the query.\n\nYou can set C\u003cattributes\u003e, which will be passed as the 2nd argument to\nL\u003cDBIx::Class::ResultSet/search\u003e.\n\n=head3 ENUM Column Type\n\nIf the field name matches (case-insensitive) a column name with type 'ENUM'\nand the Schema contains enum values in\nC\u003c\u003c $resultset-\u003ecolumn_info($name)-\u003e{extra}{list} \u003e\u003e, the field's options\nwill be populated with the enum values.\n\n=head1 FAQ\n\n=head2 Add extra values not in the form\n\nTo update values to the database which weren't submitted to the form,\nyou can first add them to the form with L\u003cadd_valid|HTML::FormFu/add_valid\u003e.\n\n    my $passwd = generate_passwd();\n\n    $form-\u003eadd_valid( passwd =\u003e $passwd );\n\n    $form-\u003emodel-\u003eupdate( $row );\n\nC\u003cadd_valid\u003e works for fieldnames that don't exist in the form.\n\n=head2 Set a field read only\n\nYou can make a field read only. The value of such fields cannot be changed by\nthe user even if they submit a value for it.\n\n  $field-\u003emodel_config-\u003e{read_only} = 1;\n\n  - Name: field\n    model_config:\n      read_only: 1\n\nSee L\u003cHTML::FormFu::Element::Label\u003e.\n\n=head1 CAVEATS\n\nTo ensure your column's inflators and deflators are called, we have to\nget / set values using their named methods, and not with C\u003cget_column\u003e /\nC\u003cset_column\u003e.\n\nBecause of this, beware of having column names which clash with DBIx::Class\nbuilt-in method-names, such as C\u003cdelete\u003e. - It will have obviously\nundesirable results!\n\n=head1 REMOVED METHODS\n\n=head2 new_empty_row\n\nSee C\u003cempty_rows\u003e in L\u003c/\"Config options for Repeatable blocks\"\u003e instead.\n\n=head2 new_empty_row_multi\n\nSee C\u003cnew_rows_max\u003e in L\u003c/\"Config options for Repeatable blocks\"\u003e instead.\n\n=head2 Range constraint\n\nSee C\u003cempty_rows\u003e in L\u003c/\"Config options for Repeatable blocks\"\u003e instead.\n\n=head1 SUPPORT\n\nProject Page:\n\nL\u003chttp://code.google.com/p/html-formfu/\u003e\n\nMailing list:\n\nL\u003chttp://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu\u003e\n\nMailing list archives:\n\nL\u003chttp://lists.scsys.co.uk/pipermail/html-formfu/\u003e\n\n=head1 BUGS\n\nPlease submit bugs / feature requests to\nL\u003chttp://code.google.com/p/html-formfu/issues/list\u003e (preferred) or\nL\u003chttp://rt.perl.org\u003e.\n\n=head1 GITHUB REPOSITORY\n\nThis module's sourcecode is maintained in a git repository at\nL\u003cgit://github.com/fireartist/HTML-FormFu-Model-DBIC.git\u003e\n\nThe project page is L\u003chttps://github.com/fireartist/HTML-FormFu-Model-DBIC\u003e\n\n=head1 SEE ALSO\n\nL\u003cHTML::FormFu\u003e, L\u003cDBIx::Class\u003e, L\u003cCatalyst::Controller::HTML::FormFu\u003e\n\n=head1 AUTHOR\n\nCarl Franks\n\n=head1 CONTRIBUTORS\n\nBased on the code of C\u003cDBIx::Class::HTML::FormFu\u003e, which was contributed to\nby:\n\nAdam Herzog\n\nDaisuke Maki\n\nMario Minati\n\n=head1 COPYRIGHT AND LICENSE\n\nCopyright (C) 2007 by Carl Franks\n\nBased on the original source code of L\u003cDBIx::Class::HTMLWidget\u003e, copyright\nThomas Klausner.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself, either Perl version 5.8.8 or,\nat your option, any later version of Perl 5 you may have available.\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformfu%2Fhtml-formfu-model-dbic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformfu%2Fhtml-formfu-model-dbic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformfu%2Fhtml-formfu-model-dbic/lists"}