[Grok-dev] Re: FieldProperty

Darryl Cousins darryl at darrylcousins.net.nz
Mon Mar 12 20:12:16 EDT 2007


Thanks Tim and Martijn for your comments. I will continue to use
FieldProperty as often will insert data programmatically and I still
would prefer data to be validated at that point.

Regards,
Darryl

On Mon, 2007-03-12 at 10:29 +0100, Martijn Faassen wrote:
> Tim Terlegård wrote:
> >> Just wondering why FieldProperty is not used in the example apps
> >> (grokwiki and grokstar). Without it setting attributes is not validated
> >> - eg I can set myobj.title = 'Non unicode string' but when I use
> >> FieldProperty in the traditional manner then WrongType error is raised
> >> as I would expect.
> > 
> > Often you don't need FieldProperty because formlib does the validation
> > of forms for you. If you do lots of manual manipulations of attributes
> > you might want to use FieldProperty, but that's entirely up to you.
> > Python programmers have done well without type checking before :)
> 
> Yes, I agree with that. FieldProperty in my experience just gets in the 
> way by putting in more complication in the access logic. Your form logic 
> will do the checking already.
> 
> Feel free to use it though in your own applications. I can imagine it 
> could be of value in some circumstances, especially when you have other 
> developers who you expect will do a lot of manipulation of your objects.
> 
> Regards,
> 
> Martijn
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list