+
+# Old version
+#sub _to_select {
+# my ($self, $col, $hint) = @_;
+# my $fclass = $hint || $self->__hasa_rels->{$col}->[0];
+# my @objs = $fclass->retrieve_all;
+# my $a = HTML::Element->new("select", name => $col);
+# for (@objs) {
+# my $sel = HTML::Element->new("option", value => $_->id);
+# $sel->attr("selected" => "selected")
+# if ref $self
+# and eval { $_->id eq $self->$col->id };
+# $sel->push_content($_->stringify_self);
+# $a->push_content($sel);
+# }
+# $OLD_STYLE && return $a->as_HTML;
+# $a;
+#}
+
+
+
+
+=head2 recognized arguments
+
+ selected => $object|$id,
+ name => $name,
+ value => $value,
+ where => SQL 'WHERE' clause,
+ order_by => SQL 'ORDER BY' clause,
+ constraint => hash of constraints to search
+ limit => SQL 'LIMIT' clause,
+ items => [ @items_of_same_type_to_select_from ],
+ class => $class_we_are_selecting_from
+ stringify => $stringify_coderef|$method_name
+
+
+
+
+# select box requirements
+# 1. a select box for objecs of a has_a related class -- DONE
+=head2 1. a select box out of a has_a or has_many related class.
+ # For has_a the default behavior is to make a select box of every element in
+ # related class and you choose one.
+ #Or explicitly you can create one and pass options like where and order
+ BeerDB::Beer->to_field('brewery','select', {where => "location = 'Germany'");
+
+ # For has_many the default is to get a multiple select box with all objects.
+ # If called as an object method, the objects existing ones will be selected.
+ Brewery::BeerDB->to_field('beers','select', {where => "rating > 5"});
+
+
+=head2 2. a select box for objects of arbitrary class -- say BeerDB::Beer for fun.
+ # general
+ BeerDB::Beer->to_field('', 'select', $options)
+
+ BeerDB::Beer->to_field('', 'select'); # Select box of all the rows in class
+ # with PK as ID, $Class->to_field() same.
+ BeerDB::Beer->to_field('','select',{ where => "rating > 3 AND class like 'Ale'", order_by => 'rating DESC, beer_id ASC' , limit => 10});
+ # specify exact where clause
+
+=head2 3. If you already have a list of objects to select from --
+
+ BeerDB:;Beer->to_field($col, 'select' , {items => $objects});
+
+# 3. a select box for arbitrary set of objects
+ # Pass array ref of objects as first arg rather than field
+ $any_class_or_obj->to_field([BeerDB::Beer->search(favorite => 1)], 'select',);
+
+
+=cut