maccesch / cmsplugin-contact

Extendable contact plugin for django-cms with spam protection and i18n
BSD 2-Clause "Simplified" License
71 stars 62 forks source link

Overwriting form #2

Closed driesdesmet closed 13 years ago

driesdesmet commented 13 years ago

Hi,

I'm trying to use a custom contact form with your plugin. In cms_plugins.py there is: from forms import AkismetContactForm, RecaptchaContactForm, HoneyPotContactForm which uses the supplied forms.py file. Is there a pythonic way of overwriting this? Putting a forms.py in my main project's directory doesn't seem to work. Any pointers welcome.

maccesch commented 13 years ago

Hm, that's a good question.

Why do you need a custom contact form and how does it look like? Maybe I can extend my plugin accordingly.

driesdesmet commented 13 years ago

I simply need some extra fields: name, address, location, tel number in addition to what you have right now: e-mail, subject and content. I'm not too familiar with how cms_plugin models work, but with conventional models, you would simply pass a form class as an argument. That would be the ideal, more versatile solution. You could also name the current form 'baseform' and the one I need would become 'extendeform' but I'm afraid other users will have different needs...

driesdesmet commented 13 years ago

btw: thanks for providing this plugin nevertheless. I'm new with github and how to work with it. But it's awesome...

maccesch commented 13 years ago

Ok, I'll think about extending the plugin either by enabling the user to choose a custom form or by providing means for adding custom fields. For now just hack the plugin and change the provided forms and template to fit your needs.

maccesch commented 13 years ago

Thanks to dsh2dsh subclassing is now possible. Have a look at the examples folder.