On 12/16/06, Gary Doades <[EMAIL PROTECTED]> wrote: > > Adrian Holovaty wrote: > > Ah, but we *will* have USStateField and USStateField field -- I just > > haven't written those Field classes yet. :) > > > > Why not just have a CharField and a USState validator and an IPaddress4 > validator. That way you have a USState validator to apply to other > fields as well.
but you *can* do that now, the only difference between what is now and what you are proposing is that you call validators, what are now Fields and you would call it CharField( validators=[USState, IsAllUpperCase] ) where you can now write ComboField( CharField, USStateField, IsAllUpperCaseField ) the only problem I see is with SelectMultipleField, where ComboField doesn't work properly... but since these always have choices, I wouldn't worry about these... You may well have a USState validator and an > IsAllUpperCase validator. You could then combine the USState validator > with the IsAllUpperCase validator without creating any new fields. You > could even use those validators in different combinations with other > validators to achieve different functionality, again without creating > any new fields or even validators at all. > > Again a trivial (and in this case possibly stupid) example, but I think > the principle is sound. > > > > -- Honza Král E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---