[Product-Developers] Re: Need Help with Remember Workflow
Mark Phillips
mark at phillipsmarketing.biz
Tue Jan 8 16:48:47 UTC 2008
Hedley,
Thanks so much for the suggestion! I have learned a lot from our
conversations - I really appreciate it! I like your programming style -
simple, clean, and elegant.
I updated my product to use the method validators as you suggested. The
validation works. BTW, one uses the field name as written - no upper
case unless it is in the field name.
When the validation methods are enabled, I get the same result as
before. When someone tries to join, they are automatically added (so no
member_approval_workflow) and no email with a password. If I comment out
the validation methods, then the member_approval_workflow kicks in and
the validation does not.
Is there a third way to validate fields?
Thanks!
Mark
On Tue, 2008-01-08 at 03:11 -0500, Hedley Roos wrote:
> Use another part of the Archetypes API: method validators.
>
> Example: you have a field called school_affiliation.
>
> Write a method in the AHSMember class:
>
> def validate_school_affiliation(self, new_value):
> if value == 'nothing':
> return 'School affiliation must be something'
> return None
>
> The method may be called validate_School_affiliation, not sure about
> the
> case.
>
> This way you avoid validation classes. Besides, unless you plan to
> re-use validators the validation classes are overkill.
>
> Hedley
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ahsmember-0.1.13.zip
Type: application/zip
Size: 9756 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080108/bb98089d/attachment.zip>
More information about the Product-Developers
mailing list