Add two selector methods to get partner's addresses
Introduced get_primary_address and get_address_for_stockrecord. I opted
to implement rudimentary logic supporting only one PartnerAddress
instead of raising NotImplemented. I'm assuming that given the demand
for multiple partners scenario, it is more likely than not that a user
will need to store an address for a partner.
This allows updating code in both places, if necessary. Getting Django
1.5 support would be painful otherwise. This also removes the circular
dependency of django-oscar-testsupport on Oscar.
The requirements were merged. The imports were updated
accordingly. Unused imports in the touched files were removed. No
further changes.
* Fixes bug with prefetch_related where looking up secondary relations
raises a DoesNotExist exception.
* Reworks cached partner map to use PKs instead of names.
Availability logic from product class is looked up in product obj
rather than in wrapper to avoid unnecessary queries.