>
> My assumption as to why the signal got called twice was that is was calling
> it once for the Parent product (Satchmo's model) and once for our Child
> Product (the inherited Product).  My other assumption (and this could be way
> off) was that had I done it the way Satchmo intends it to be done, that our
> subtype product would have been found and THAT model's order_success method
> would have run.  (for reference, here is the link to the discussion I had
> with Chris:
> http://groups.google.com/group/satchmo-users/browse_thread/thread/6f88be5a09bb6f41/6cd1799fd3c823f4?hl=en&lnk=gst&q=signal+called+twice#6cd1799fd3c823f4
> )



Ryan (and Chris):

I think I'm confused here.

Sounds to me like Ryan's custom order_success method wasn't called because
his CustomProduct wasn't being picked up as a subtype, given what I see in
the code for the Order.order_success() method (lines 917-925).

Ryan, if your goal was to have your custom order_success() method picked up
at this point, then wouldn't we want to troubleshoot/define how a
CustomProduct via model inheritance gets picked up as a subtype via the call
to `orderitem.product.get_subtype_with_attr('order_success')`?

However, listening to the order_success SIGNAL sent via the Order object is
a different matter entirely, from how I'm reading the code (and I could very
well be wrong). An Order is a unique object. It should send the SIGNAL once
and only once. If it is sending the signal more than once, then there must
be a bug somewhere that is causing Order.order_success() to be called more
than once -- as this is the method that sends the Order.order_success
signal.

>From how I read the code, this is the workflow (in pseudocode and/or plain
English) of Order.order_success():

log "Order Success"
execute order_success() method for every Product.sub_type that defines an
order_sucess() method of its own
send order_success SIGNAL

Given this expected workflow, it has to be a bug if the signal is sent more
than once.

Now, if the problem is the order_success() method is not called, then it
seems to me the problem is that your custom product is not being recognized
as a valid subtype?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to