OK, I checked the logs, and true, 18 requests are being made, but the
request and the API ARE smart enough, so every request is the same:
`ratesAndServicesRequest`, and they all return the same, a list of all
possible services and prices, so only ONE request needs to be done.

I haven't checked the source to figure out why is this being called
once per shipping option, but I'm affraid I'm going to find some
method the payment module checking the price of each registered
shipping module, which, from what I've seen, has a list of instances
of the Shipper class for each service type.

So I'm guessing there's two possibilities here, either
a) modify the canadapost.Shipper class so it registers only once and
uses the config_choices_values list to generate a list of results
instead of being called a number of times, or
b) making some parts of it @classmethods and class variables, so they
can be shared, or
b') to use some kind of cache.

I'm guessing a) won't be possible without breaking the payment modules
in some way, because we'll need to tell the shipper which service was
chosen, instead of having an instance per option. I'm also guessing b)
will not be possible because there's no telling which instances (since
the __init__ receives a cart and a contact kwargs I'm guessing there's
an instance per shipping option per checkout action) share information
with whichs, and et-cetera, so I'm thinking I can make use of
keyedcache to make a key with the cart id, so if a request was already
sent for this cart, I don't make another when I'm asked the price.

So, what's the people who have more knowledge of the code base insight
on this matter?

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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