r27908 - in /trunk/libhtml-formfu-model-dbic-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/HTML/FormFu/Model/ t/default_values/ t/lib/ t/lib/MySchema/ t/options_from_model/ t/update/ t/x_roundtrip/

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Mon Dec 8 16:55:41 UTC 2008


Author: bricas-guest
Date: Mon Dec  8 16:55:38 2008
New Revision: 27908

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27908
Log:
* New upstream version
* debian/control:
  + Added myself to Uploaders
  + Bump libhtml-formfu-perl dep to 0.03007

Added:
    trunk/libhtml-formfu-model-dbic-perl/t/default_values/belongs_to_lookup_table_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/default_values/belongs_to_lookup_table_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/default_values/belongs_to_lookup_table_combobox.yml
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/default_values/belongs_to_lookup_table_combobox.yml
    trunk/libhtml-formfu-model-dbic-perl/t/default_values/has_many_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/default_values/has_many_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/default_values/has_many_combobox.yml
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/default_values/has_many_combobox.yml
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/belongs_to_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/belongs_to_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/belongs_to_combobox.yml
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/belongs_to_combobox.yml
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/belongs_to_config_zero_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/belongs_to_config_zero_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/belongs_to_config_zero_combobox.yml
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/belongs_to_config_zero_combobox.yml
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/condition_from_stash_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/condition_from_stash_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/options_from_model/condition_from_stash_combobox.yml
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/options_from_model/condition_from_stash_combobox.yml
    trunk/libhtml-formfu-model-dbic-perl/t/update/belongs_to_combobox.t
      - copied unchanged from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/update/belongs_to_combobox.t
    trunk/libhtml-formfu-model-dbic-perl/t/x_roundtrip/
      - copied from r27907, branches/upstream/libhtml-formfu-model-dbic-perl/current/t/x_roundtrip/
Removed:
    trunk/libhtml-formfu-model-dbic-perl/inc/Module/AutoInstall.pm
    trunk/libhtml-formfu-model-dbic-perl/inc/Module/Install/AutoInstall.pm
    trunk/libhtml-formfu-model-dbic-perl/inc/Module/Install/Include.pm
Modified:
    trunk/libhtml-formfu-model-dbic-perl/Changes
    trunk/libhtml-formfu-model-dbic-perl/MANIFEST
    trunk/libhtml-formfu-model-dbic-perl/META.yml
    trunk/libhtml-formfu-model-dbic-perl/Makefile.PL
    trunk/libhtml-formfu-model-dbic-perl/debian/changelog
    trunk/libhtml-formfu-model-dbic-perl/debian/control
    trunk/libhtml-formfu-model-dbic-perl/lib/HTML/FormFu/Model/DBIC.pm
    trunk/libhtml-formfu-model-dbic-perl/t/lib/DBICTestLib.pm
    trunk/libhtml-formfu-model-dbic-perl/t/lib/MySchema/Master.pm
    trunk/libhtml-formfu-model-dbic-perl/t/update/basic.yml
    trunk/libhtml-formfu-model-dbic-perl/t/update/basic_create.t
    trunk/libhtml-formfu-model-dbic-perl/t/update/basic_update.t
    trunk/libhtml-formfu-model-dbic-perl/t/update/has_many_repeatable_delete_true.yml
    trunk/libhtml-formfu-model-dbic-perl/t/update/methods.yml
    trunk/libhtml-formfu-model-dbic-perl/t/update/nested.yml
    trunk/libhtml-formfu-model-dbic-perl/t/update/nested_create.t

Modified: trunk/libhtml-formfu-model-dbic-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/Changes?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/Changes (original)
+++ trunk/libhtml-formfu-model-dbic-perl/Changes Mon Dec  8 16:55:38 2008
@@ -1,3 +1,20 @@
+0.03007 2008-12-08
+
+    - Bump required version no. of HTML-FormFu to 0.03007
+
+0.03006 2008-12-03
+
+    - options_from_model() - If we've a Catalyst context but no schema on
+      the form stash, use config values for 'model' and 'resultset'
+    
+    - update() - if a checkbox/radio value isn't submitted, and the column
+      is NOT NULL, set it to 0 (zero), not DEFAULT VALUE.
+    
+    - Tests for new ComboBox element.
+    
+    - Modified delete_if_true example to no longer use "delete" as a
+      form item name - this is bad!
+
 0.03003 2008-08-21
 
     - Updated to work with is_field/is_block changes in HTML-FormFu

Modified: trunk/libhtml-formfu-model-dbic-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/MANIFEST?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/MANIFEST (original)
+++ trunk/libhtml-formfu-model-dbic-perl/MANIFEST Mon Dec  8 16:55:38 2008
@@ -1,11 +1,8 @@
 Changes
-inc/Module/AutoInstall.pm
 inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
 inc/Module/Install/Base.pm
 inc/Module/Install/Can.pm
 inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
 inc/Module/Install/Makefile.pm
 inc/Module/Install/Metadata.pm
 inc/Module/Install/Win32.pm
@@ -22,6 +19,10 @@
 t/default_values/basic_nested.yml
 t/default_values/belongs_to_lookup_table.t
 t/default_values/belongs_to_lookup_table.yml
+t/default_values/belongs_to_lookup_table_combobox.t
+t/default_values/belongs_to_lookup_table_combobox.yml
+t/default_values/has_many_combobox.t
+t/default_values/has_many_combobox.yml
 t/default_values/has_many_repeatable.t
 t/default_values/has_many_repeatable.yml
 t/default_values/has_many_repeatable_label.t
@@ -151,10 +152,16 @@
 t/lib/MySchema/UserBand.pm
 t/options_from_model/belongs_to.t
 t/options_from_model/belongs_to.yml
+t/options_from_model/belongs_to_combobox.t
+t/options_from_model/belongs_to_combobox.yml
 t/options_from_model/belongs_to_config_zero.t
 t/options_from_model/belongs_to_config_zero.yml
+t/options_from_model/belongs_to_config_zero_combobox.t
+t/options_from_model/belongs_to_config_zero_combobox.yml
 t/options_from_model/condition_from_stash.t
 t/options_from_model/condition_from_stash.yml
+t/options_from_model/condition_from_stash_combobox.t
+t/options_from_model/condition_from_stash_combobox.yml
 t/options_from_model/constraint_autoset.t
 t/options_from_model/constraint_autoset.yml
 t/options_from_model/many_to_many_select.t
@@ -164,6 +171,7 @@
 t/update/basic_create.t
 t/update/basic_update.t
 t/update/belongs_to.t
+t/update/belongs_to_combobox.t
 t/update/column_without_field.t
 t/update/column_without_field.yml
 t/update/has_many_repeatable.t
@@ -203,3 +211,6 @@
 t/update/opt_accessor_nested.t
 t/update/opt_accessor_nested.yml
 t/update/unchecked_not_null_checkbox.t
+t/x_roundtrip/checkbox.yml
+t/x_roundtrip/checkbox_false2true.t
+t/x_roundtrip/checkbox_true2false.t

Modified: trunk/libhtml-formfu-model-dbic-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/META.yml?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/META.yml (original)
+++ trunk/libhtml-formfu-model-dbic-perl/META.yml Mon Dec  8 16:55:38 2008
@@ -19,9 +19,9 @@
   DBD::SQLite: 0
   DBIx::Class: 0.08002
   DateTime::Format::MySQL: 0
-  HTML::FormFu: 0.03003
+  HTML::FormFu: 0.03007
   Task::Weaken: 0
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.03003
+version: 0.03007

Modified: trunk/libhtml-formfu-model-dbic-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/Makefile.PL?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/Makefile.PL (original)
+++ trunk/libhtml-formfu-model-dbic-perl/Makefile.PL Mon Dec  8 16:55:38 2008
@@ -7,12 +7,11 @@
 requires 'DateTime::Format::MySQL';
 requires 'DBD::SQLite';
 requires 'DBIx::Class' => '0.08002';
-requires 'HTML::FormFu' => '0.03003';
+requires 'HTML::FormFu' => '0.03007';
 requires 'Task::Weaken'; # to ensure Scalar::Util was built with weaken()
 
 test_requires 'Test::MockObject';
 
-tests 't/*.t t/*/*.t';
+tests_recursive;
 
-auto_install();
 &WriteAll;

Modified: trunk/libhtml-formfu-model-dbic-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/debian/changelog?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/debian/changelog (original)
+++ trunk/libhtml-formfu-model-dbic-perl/debian/changelog Mon Dec  8 16:55:38 2008
@@ -1,4 +1,4 @@
-libhtml-formfu-model-dbic-perl (0.03003-2) UNRELEASED; urgency=low
+libhtml-formfu-model-dbic-perl (0.03007-1) UNRELEASED; urgency=low
 
   [ Ansgar Burchardt ]
   * add README.source to document quilt usage
@@ -7,7 +7,13 @@
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
 
- -- Ansgar Burchardt <ansgar at 43-1.org>  Tue, 23 Sep 2008 22:09:07 +0200
+  [ Brian Cassidy ]
+  * New upstream version
+  * debian/control:
+    + Added myself to Uploaders
+    + Bump libhtml-formfu-perl dep to 0.03007
+
+ -- Brian Cassidy <brian.cassidy at gmail.com>  Mon, 08 Dec 2008 12:45:41 -0400
 
 libhtml-formfu-model-dbic-perl (0.03003-1) unstable; urgency=low
 

Modified: trunk/libhtml-formfu-model-dbic-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/debian/control?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/debian/control (original)
+++ trunk/libhtml-formfu-model-dbic-perl/debian/control Mon Dec  8 16:55:38 2008
@@ -2,17 +2,23 @@
 Section: perl
 Priority: optional
 Build-Depends: debhelper (>= 7), quilt
-Build-Depends-Indep: perl (>= 5.8.1), libdatetime-format-mysql-perl, libdbd-sqlite3-perl, libtask-weaken-perl, libdbix-class-perl (>= 0.08002), libhtml-formfu-perl (>= 0.03003), libtest-mockobject-perl
+Build-Depends-Indep: perl (>= 5.8.1), libdatetime-format-mysql-perl,
+ libdbd-sqlite3-perl, libtask-weaken-perl, libdbix-class-perl (>= 0.08002),
+ libhtml-formfu-perl (>= 0.03007), libtest-mockobject-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ansgar Burchardt <ansgar at 43-1.org>
+Uploaders: Ansgar Burchardt <ansgar at 43-1.org>,
+ Brian Cassidy <brian.cassidy at gmail.com>
 Standards-Version: 3.8.0
 Homepage: http://www.formfu.org/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/
-Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/
+Vcs-Browser:
+ http://svn.debian.org/viewsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/
 
 Package: libhtml-formfu-model-dbic-perl
 Architecture: all
-Depends: perl (>= 5.8.1), ${misc:Depends}, libdatetime-format-mysql-perl, libtask-weaken-perl, libdbix-class-perl (>= 0.08002), libhtml-formfu-perl (>= 0.03003)
+Depends: perl (>= 5.8.1), ${misc:Depends}, libdatetime-format-mysql-perl,
+ libtask-weaken-perl, libdbix-class-perl (>= 0.08002),
+ libhtml-formfu-perl (>= 0.03007)
 Description: integrate HTML::FormFu with DBIx::Class
  HTML::FormFu is a HTML form creation, rendering and validation framework.
  .

Modified: trunk/libhtml-formfu-model-dbic-perl/lib/HTML/FormFu/Model/DBIC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/lib/HTML/FormFu/Model/DBIC.pm?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/lib/HTML/FormFu/Model/DBIC.pm (original)
+++ trunk/libhtml-formfu-model-dbic-perl/lib/HTML/FormFu/Model/DBIC.pm Mon Dec  8 16:55:38 2008
@@ -8,7 +8,7 @@
 use Storable qw( dclone );
 use Carp qw( croak );
 
-our $VERSION = '0.03003';
+our $VERSION = '0.03007';
 $VERSION = eval $VERSION;
 
 # sub _compatible_config() is only required as long as we support the legacy
@@ -113,11 +113,13 @@
     }
     elsif ( defined $context && defined $attrs->{model} ) {
 
-        return $context->model( $attrs->{model} );
-    }
-    elsif ( defined $context ) {
-
-        return $context->model;
+        my $model = $context->model( $attrs->{model} );
+        
+        if ( defined( my $rs = $attrs->{resultset} ) ) {
+            $model = $model->resultset( $rs );
+        }
+        
+        return $model;
     }
 
     croak "need a schema or context";
@@ -565,9 +567,11 @@
 
 sub _fix_value {
     my ( $dbic, $col, $value, $field, ) = @_;
+    
     my $col_info    = $dbic->column_info($col);
     my $is_nullable = $col_info->{is_nullable} || 0;
     my $data_type   = $col_info->{data_type} || '';
+    
     if ( defined $value ) {
         if ( (     $is_nullable
                 || $data_type =~ m/^timestamp|date|int|float|numeric/i
@@ -581,15 +585,15 @@
             $value = undef;
         }
     }
-    else {
-        if ( defined $field
-            && $field->isa('HTML::FormFu::Element::Checkbox') )
-        {
-            if ( !$is_nullable ) {
-                $value = $col_info->{default_value};
-            }
-        }
-    }
+    
+    if ( !defined $value
+        && defined $field
+        && $field->isa('HTML::FormFu::Element::Checkbox')
+        && !$is_nullable )
+    {
+        $value = 0;
+    }
+    
     return $value;
 }
 
@@ -855,18 +859,29 @@
 
 =head1 SYNOPSIS
 
+If using L<Catalyst>, ensure your L<DBIx::Class> schema is placed in the
+form's L<stash|HTML::FormFu/stash>, by setting this in your application
+config (C<MyApp.pm>), where C<ModelName> is the name of your model that will
+be passed to C<< $c->model($name) >>.
+
+    <Controller::HTML::FormFu>
+        <model_stash>
+            schema = ModelName
+        <model_stash>
+    </Controller::HTML::FormFu>
+
 Set a forms' default values from a DBIx::Class row object:
 
     my $row = $resultset->find( $id );
     
-    $form->default_values( $row );
+    $form->model->default_values( $row );
 
 Update the database from a submitted form:
 
     if ( $form->submitted_and_valid ) {
         my $row = $resultset->find( $form->param('id') );
         
-        $form->update( $row );
+        $form->model->update( $row );
     }
 
 =head1 METHODS
@@ -876,6 +891,8 @@
 Arguments: $dbic_row, [\%config]
 
 Return Value: $form
+
+    $form->model->default_values( $row );
 
 Set a form's default values from a DBIx::Class row.
 
@@ -1034,14 +1051,15 @@
 similar field, to allow the user to select whether given rows should be 
 deleted (or, in the case of C<many_to_many> relationships, unrelated),
 set C<< $block->model_config->{delete_if_true} >> to the name of that
-field.
+field.  Make sure the name of this field does not clash with one of
+your L<DBIx::Class::Row> object method names (especially delete).
 
     ---
     element:
       - type: Repeatable
         nested_name: authors
         model_config:
-          delete_if_true: delete
+          delete_if_true: deletion_marker
         
         elements:
           - type: Hidden
@@ -1051,7 +1069,7 @@
             name: author
           
           - type: Checkbox
-            name: delete
+            name: deletion_marker
 
 =head3 many_to_many selection
 
@@ -1094,39 +1112,102 @@
 
 Return Value: $dbic_row
 
+    $form->model->update( $row );
+
 Update the database with the submitted form values. Uses 
 L<update_or_insert|DBIx::Class::Row/update_or_insert>.
 
 See L</default_values> for specifics about what relationships are supported
 and how to structure your forms.
 
-=head3 Automatically creating a new row object
-
-If you're using L</update> to create a new row object, you don't 
-need to create one yourself, as long as the L<DBIx::Class> Schema is on the
-form L</stash>, and the ResultSet name is set in either the C<%config>
-argument, the Form's L<HTML::FormFu/model_config>, or the Block's
-L<HTML::FormFu/model_config> (if L</update> is called on a Block
-element).
-
-If you're using L<Catalyst::Controller::HTML::FormFu>, it can automatically
-place the schema on the Form's stash, by using the following Catalyst config
-(where C<MySchema> is the name of your Catalyst model).
-
-    'Controller::HTML::FormFu':
-      model_stash:
-        schema: MySchema
+=head2 create
+
+Arguments: [\%config]
+
+Return Value: $dbic_row
+
+    $form->model->create( $row );
+
+Like L</update>, but doesn't require a C<$dbic_row> argument.
+
+You need to ensure the DBIC schema is available on the form stash - see
+L</SYNOPSIS> for an example config.
+
+The C<resultset> must be set either in the method arguments, or the form or
+block's C<model_config>.
 
 An example of setting the ResultSet name on a Form:
 
     ---
     model_config:
       resultset: FooTable
-
-Note that if you still want to pass a C<%config> argument, you must pass
-C<undef> in place of the row:
-
-    $form->update( undef, \%config );
+    
+    elements:
+      # [snip]
+
+=head2 options_from_model
+
+Populates a multi-valued field, with values from the database.
+
+This method should not be called directly, but is called for you during
+C<< $form->process >> by fields that inherit from
+L<HTML::FormFu::Element::_Group>. This includes:
+
+=over
+
+=item L<HTML::FormFu::Element::Select>
+
+=item L<HTML::FormFu::Element::Checkboxgroup>
+
+=item L<HTML::FormFu::Element::Radiogroup>
+
+=back
+
+To use, ensure the DBIC schema is available on the form stash - see
+L</SYNOPSIS> for an example config - and you must set the appropriate
+C<resultset> on the element C<model_config>:
+
+    element:
+      - type: Select
+        name: foo
+        model_config:
+          resultset: TableClass
+
+The column used for the element values is set with the C<model_config>
+value C<id_column> - or if not set, the table's primary column is used.
+
+    element:
+      - type: Select
+        name: foo
+        model_config:
+          resultset: TableClass
+          id_column: pk_col
+
+The column used for the element labels is set with the C<model_config>
+value C<label_column> - or if not set, the first text/varchar column found
+in the table is used - or if one is not found, the <id_column> is used
+instead.
+
+    element:
+      - type: Select
+        name: foo
+        model_config:
+          resultset: TableClass
+          label_column: label_col
+
+You can set a C<condition>, which will be passed as the 1st arguement to
+L<DBIx::Class::ResultSet/search>.
+
+    element:
+      - type: Select
+        name: foo
+        model_config:
+          resultset: TableClass
+          condition:
+            type: is_foo
+
+You can set C<attributes>, which will be passed as the 2nd arguement to
+L<DBIx::Class::ResultSet/search>.
 
 =head1 FAQ
 
@@ -1139,7 +1220,7 @@
     
     $form->add_valid( passwd => $passwd );
     
-    $form->update( $row );
+    $form->model->update( $row );
 
 C<add_valid> works for fieldnames that don't exist in the form.
 

Modified: trunk/libhtml-formfu-model-dbic-perl/t/lib/DBICTestLib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/lib/DBICTestLib.pm?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/lib/DBICTestLib.pm (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/lib/DBICTestLib.pm Mon Dec  8 16:55:38 2008
@@ -33,8 +33,9 @@
   id             INTEGER PRIMARY KEY NOT NULL,
   text_col       TEXT,
   password_col   TEXT,
-  checkbox_col   TEXT DEFAULT '0',
+  checkbox_col   BOOLEAN DEFAULT 1,
   select_col     TEXT,
+  combobox_col   TEXT,
   radio_col      TEXT,
   radiogroup_col TEXT,
   date_col       DATETIME,

Modified: trunk/libhtml-formfu-model-dbic-perl/t/lib/MySchema/Master.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/lib/MySchema/Master.pm?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/lib/MySchema/Master.pm (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/lib/MySchema/Master.pm Mon Dec  8 16:55:38 2008
@@ -11,15 +11,19 @@
 __PACKAGE__->table("master");
 
 __PACKAGE__->add_columns(
-    id             => { data_type => "INTEGER", is_nullable => 0 },
+    id             => {
+        data_type => "INTEGER",
+        is_nullable => 0,
+    },
     text_col       => { data_type => "TEXT" },
     password_col   => { data_type => "TEXT" },
     checkbox_col   => {
-        data_type => "TEXT",
-        default_value => 0,
+        data_type => "BOOLEAN",
+        default_value => 1,
         is_nullable   => 0,
     },
     select_col     => { data_type => "TEXT" },
+    combobox_col   => { data_type => "TEXT" },
     radio_col      => { data_type => "TEXT" },
     radiogroup_col => { data_type => "TEXT" },
     date_col       => { data_type => "DATETIME" },

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/basic.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/basic.yml?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/basic.yml (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/basic.yml Mon Dec  8 16:55:38 2008
@@ -22,6 +22,13 @@
       - [2, two]
       - [3, three]
       
+  - type: ComboBox
+    name: combobox_col
+    options:
+      - [1, one]
+      - [2, two]
+      - [3, three]
+  
   - type: Radio
     name: radio_col
     value: yes

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/basic_create.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/basic_create.t?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/basic_create.t (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/basic_create.t Mon Dec  8 16:55:38 2008
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 7;
+use Test::More tests => 8;
 
 use HTML::FormFu;
 use lib 't/lib';
@@ -19,13 +19,15 @@
 
 # Fake submitted form
 $form->process( {
-        id             => 1,
-        text_col       => 'a',
-        password_col   => 'b',
-        checkbox_col   => 'foo',
-        select_col     => '2',
-        radio_col      => 'yes',
-        radiogroup_col => '3',
+        id                  => 1,
+        text_col            => 'a',
+        password_col        => 'b',
+        checkbox_col        => 'foo',
+        select_col          => '2',
+        combobox_col_select => 'sel',
+        combobox_col_text   => '',
+        radio_col           => 'yes',
+        radiogroup_col      => '3',
     } );
 
 {
@@ -41,6 +43,7 @@
     is( $row->password_col,   'b' );
     is( $row->checkbox_col,   'foo' );
     is( $row->select_col,     '2' );
+    is( $row->combobox_col,   'sel' );
     is( $row->radio_col,      'yes' );
     is( $row->radiogroup_col, '3' )
 }

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/basic_update.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/basic_update.t?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/basic_update.t (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/basic_update.t Mon Dec  8 16:55:38 2008
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
 
 use HTML::FormFu;
 use lib 't/lib';
@@ -23,6 +23,7 @@
             password_col   => 'xyzb',
             checkbox_col   => 'xyzfoo',
             select_col     => 'xyz2',
+            combobox_col   => 'combo',
             radio_col      => 'xyzyes',
             radiogroup_col => 'xyz3',
         } );
@@ -32,13 +33,15 @@
 
 # Fake submitted form
 $form->process( {
-        id             => 1,
-        text_col       => 'a',
-        password_col   => 'b',
-        checkbox_col   => 'foo',
-        select_col     => '2',
-        radio_col      => 'yes',
-        radiogroup_col => '3',
+        id                  => 1,
+        text_col            => 'a',
+        password_col        => 'b',
+        checkbox_col        => 'foo',
+        select_col          => '2',
+        combobox_col_select => '',
+        combobox_col_text   => 'txt',
+        radio_col           => 'yes',
+        radiogroup_col      => '3',
     } );
 
 {
@@ -53,6 +56,7 @@
     is( $row->text_col,       'a' );
     is( $row->password_col,   'b' );
     is( $row->checkbox_col,   'foo' );
+    is( $row->combobox_col,   'txt' );
     is( $row->select_col,     '2' );
     is( $row->radio_col,      'yes' );
     is( $row->radiogroup_col, '3' );

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/has_many_repeatable_delete_true.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/has_many_repeatable_delete_true.yml?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/has_many_repeatable_delete_true.yml (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/has_many_repeatable_delete_true.yml Mon Dec  8 16:55:38 2008
@@ -21,7 +21,6 @@
       
       - type: Checkbox
         name: delete
-        value: 1
         model_config:
           delete_if_true: 1
   

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/methods.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/methods.yml?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/methods.yml (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/methods.yml Mon Dec  8 16:55:38 2008
@@ -5,5 +5,4 @@
     - type: Select
       name: method_select_test
     - type: Checkbox
-      value: 1
-      name: method_checkbox_test
+      name: method_checkbox_test

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/nested.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/nested.yml?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/nested.yml (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/nested.yml Mon Dec  8 16:55:38 2008
@@ -22,7 +22,14 @@
       - [1, one]
       - [2, two]
       - [3, three]
-      
+  
+  - type: ComboBox
+    name: combobox_col
+    options:
+      - [1, one]
+      - [2, two]
+      - [3, three]
+  
   - type: Radio
     name: radio_col
     value: yes

Modified: trunk/libhtml-formfu-model-dbic-perl/t/update/nested_create.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-model-dbic-perl/t/update/nested_create.t?rev=27908&op=diff
==============================================================================
--- trunk/libhtml-formfu-model-dbic-perl/t/update/nested_create.t (original)
+++ trunk/libhtml-formfu-model-dbic-perl/t/update/nested_create.t Mon Dec  8 16:55:38 2008
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
 
 use HTML::FormFu;
 use lib 't/lib';
@@ -19,13 +19,15 @@
 
 # Fake submitted form
 $form->process( {
-        "foo.id"             => 1,
-        "foo.text_col"       => 'a',
-        "foo.password_col"   => 'b',
-        "foo.checkbox_col"   => 'foo',
-        "foo.select_col"     => '2',
-        "foo.radio_col"      => 'yes',
-        "foo.radiogroup_col" => '3',
+        "foo.id"                  => 1,
+        "foo.text_col"            => 'a',
+        "foo.password_col"        => 'b',
+        "foo.checkbox_col"        => 'foo',
+        "foo.select_col"          => '2',
+        "foo.combobox_col_select" => "",
+        "foo.combobox_col_text"   => "combo",
+        "foo.radio_col"           => 'yes',
+        "foo.radiogroup_col"      => '3',
     } );
 
 {
@@ -41,6 +43,7 @@
     is( $row->password_col,   'b' );
     is( $row->checkbox_col,   'foo' );
     is( $row->select_col,     '2' );
+    is( $row->combobox_col,   'combo' );
     is( $row->radio_col,      'yes' );
     is( $row->radiogroup_col, '3' )
 }




More information about the Pkg-perl-cvs-commits mailing list