Re: Thoughts on a CDBI::AsForm::_to_new()
[prev]
[thread]
[next]
[Date index for 2004/10/25]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ithink what Peter is trying to do, is what I'm also trying to do. If you
have the following structure:
table person:
~ id serial
~ name text
~ adress integer references addresses
~ phone integer references phones
table addresses
~ id serial
~ street text
~ number text
~ city text
~ zip text
tabel phones
~ id serial
~ area text
~ number text
- -----------
MyClass::Person
__PACKAGE__->set-up-everything
__PACKAGE__->has_a ( adress => MyClass::Addresses )
__PACKAGE__->has_a ( phone => MyClass::Phones )
- -----------
CDBI::AsForm will make a form for person with select-boxes for address
and phone, and what Perter (and I) would like to have is a form
containing input-boxes for the fields from person, addresses and phones.
Peter maybe asked for some extramagic of inserting default values for
the non-referencing fields of person (didn't understand that part
either). This is the reason why I don't use AsForm.
I have been playing around with something like this a bit, but didn't
found the time to finish it up. It would be nice to include something
like this in AsFrom. My idea was to prefix the field names with the
table name the fields belong to, such as the field 'name' would become
'person.name', 'street' => 'address.street' and so on. Maybe
CDBI::FromCGI could be tweeked to process that kind of requests
properly, but I never looked at FromCGI in more detail then the description.
Tony Bowden wrote:
| On Thu, Oct 21, 2004 at 09:07:55AM -0700, Peter Speltz wrote:
|
|>In forms, often I want my has_a relationships to expand into inputs
for each
|>column in the has a class. Now, has_a classes are just made into
select boxes.
|>I'd like a _to_new() sub which would turn has_a 's into inputs for
each column
|>in the class and just the default text input for non has_a columns.
|
|
| Can you try saying this a slightly different way. I don't quite follow
| it.
|
| Thanks
|
| Tony
- --
Grüße,
Andreas Fromm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBfKfIUmBtSMq5cGURAgIbAJ4vyVhwP7fJog4Bpuqd8vJ/urNolACfR30Z
2GceqS6+txdZBD03npDC9Ow=
=Dq4C
-----END PGP SIGNATURE-----