correct field reference in AbstractCommunicationEvent
Merge pull request #674 from st4lk/minor_fixes

Correct field reference in AbstractCommunicationEvent.__unicode__
Avoid hitting the database twice for primary image
Simplify validation of saved basket

Before this commit, all products of Lines in the saved basket would be
checked for availability on each action, even on unrelated actions
like deleting a line or moving another line to the basket. This was
mentioned in issue #666.
This changeset only does the availability check if the Line is to be
moved back to the basket.

I refactored the fields list for SavedLineForm from blacklisting six
fields to whitelisting two field for clarity reasons.

Fixes #666
Reduce query count for product list page

Avoids lookups like that are essentially
"product.stockrecord.product" by passing both the stock record and
product where appropriate.

move product arg to the end, to not break existing code, if any
Further reduce query count when listing products

- browse.html used to check products.count to decide whether do display
  any products. The most common case of products.count returning >0
  would mean an additional query to then fetch the products.
- Product reviews were part of the product base query set. As the
  product rating has been denormalised onto AbstractProduct, that's
  unnecessary.
Add AbstractProduct rating calculate function
Merge pull request #688 from soloweb/f/rating_calculation

Add overridable function to calculate product rating
Improve UX for deleted products

When a user ordered a product and it was deleted afterwards, there were
two problems with her order history view.
It wasn't working because the 'Add review' button relied on
line.product.slug, which threw a NoReverseMatch error.
The 'Reorder' button threw an error message '%title is no longer
available for purchase'. That was changed to '%title is no longer
available' to clarify.
Additionally, both the review and reorder buttons are now only displayed
when the product is still in our database - saving the user from a
disappointing click.
Bugfix for has_stock_record

Stockrecord can be None if loaded with select_related.

Fixes #648
Fixes #690
Test if offer is applied before showing upsell msg
Whitespace!
Fix basket form issue for group products

The change in 72c3d7cf broke validation for group products as it tested
if the user could add the initial product to his/her basket.  This fails
for group products as they have no stock.
Relocate the 'edit this product' link

Made smaller and moved to avoid shifting the basic page layout.
ProductClass admin now includes inline for ProductAttribute
Housekeeping
Tabs to spaces in templates.

We mostly seem to use 4 spaces for indentation, but I kept running into
tabs used, which clutters diffs when touched.

Fixes #680
Merge pull request #691 from tangentlabs/issue/691/upsellmessages

Upsell messages are shown even after the offer is applied to the basket
get_classes now allows top-level apps.

Fixes #614
Add variant to parent product redirect on detail page. Fixes #695