On 2/24/06, Dave Howorth <[EMAIL PROTECTED]> wrote:
> Aaron Trevena wrote:
> > Hi all,
> >
> > Peter and I are working through final documentation and API for forms
> > in Maypole and I was wondering how people would prefer empty fields
> > and required columns to work, at least as far as Untaint. FromCGI and
> > dropdowns in add/edit forms are concerned.

FromCGI has some bugs still in it. Namely, you cannot NULL a field. 
You can set a printable field to '' but you cannot set it to NULL.  I
patched it so that if the form input is empty and the field is
nullable, then it will set value to undef rather than ''. This is
important if the field your are nullifying is a unique key such as a
username field.  duplicate '' violate the constraints but NULLs dont.

I'll try to make a test script for these bugs today. That will give a
better idea what we are dealing with.   I think there are still 3 bugs
in FromCGI system. Not sure what they fixed or not.

What would be wrong with making Maypole::Model::CDBI::FromCGI  and
fixing it how we like? First we need to detemrmin how we like.


> > Peter's AsForm and Model::CDBI now provide a way to set a column as
> > nullable, and Model::CDBI also checks a per table configuration of
> > required and ignore fields for use with FromCGI.
> > I was thinking of combining these two methods, with a check of
> > required fields if specified, falling back to nullable fields if none
> > specified and/or checking the type with Type::Plugin..
> > Anybody have any preferences - default to required or optional?

I think he's saying should all non nullable filds in the table be put
in the required fields list automatically ?

I say leave it how it is. Let user specify required fields for now. In
mysql they encourage non nullable fields as tables with out any
nullable fields are faster to access.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel

Reply via email to