Collect more deomgraphic data

0 views
Skip to first unread message

Bojan Mihelac

unread,
Oct 10, 2008, 4:48:32 AM10/10/08
to Satchmo users
Hi all,

I would like to add company name and VAT number to
PaymentContactInfoForm.

1. option is to monkey patch PaymentContactInfoForm or
ContactInfoForm, add this two fields and update template.

2. option would be to replace common_contact.contact_info with custom
view and use PaymentContactInfoForCompanyForm custom form inside.

How would you do it? Is there another option for this?

best regards,
Bojan

Bruce Kroeze

unread,
Oct 10, 2008, 2:30:36 PM10/10/08
to satchm...@googlegroups.com
On Fri, Oct 10, 2008 at 1:48 AM, Bojan Mihelac <bmih...@gmail.com> wrote:

Hi all,

I would like to add company name and VAT number to
PaymentContactInfoForm.

Signals to the rescue!

1) Using the payment.signals.payment_form_init signal, add your fields to the form. See the examples at payment.listeners

2) Using the contact.signals.form_save signal, catch the contact form save event.  Grab the data from the formdata parameter, and save it in your own custom app model which has a foreignkey to Contact.

Don't monkeypatch if you can possibly avoid it.

Note: I just added the form_save signal, so you'll need at least rev 1602 to use it.

Bruce Kroeze

Bojan Mihelac

unread,
Oct 13, 2008, 2:48:43 AM10/13/08
to Satchmo users
Thanks Bruce!

On Oct 10, 8:30 pm, "Bruce Kroeze" <bkro...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages