I'm trying to modify Plone 4's registration form in a product. The new
plone.app.users layout in Plone 4 should make it possible to do this in a
non-intrusive way to do this. (This is a part of porting Products.PloneInvite
to Plone 4,
https://svn.plone.org/svn/collective/Products.PloneInvite/branches/plone4_RegistrationForm.
The previous version had an overridden join_form in the skin templates.)
My plan is to do the following:
- register a new browser layer
- for this layer, override plone.app.users' RegistrationForm
- InviteRegistrationForm subclasses RegistrationForm and modifies:
* form_fields method:
o appends 'invite_code' to super class's
* validate_registration:
o first checks if 'invite_code' is valid
o then executes super class's validate_registration
Q1. Is this a good approach? Any other suggestions?
Currently the form class's form_fields method (decorated with '@property') is
not being modified. I have:
> print "this is printed"
> @property
> def form_fields(self):
> defaultFields = super(InviteeRegistrationForm, self).form_fields
> print "this is not"
> return defaultFields
Code inside the class is executed (once, at startup), but code inside the
method is never run.
Q2. How can i override the super class's method?
Kees
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers