Clone wiki

satchmo / BackwardsIncompatibleChangesAfter0.9

Backwards Incompatible Changes After 0.9

Improved Product Attribute Support

With 50284356fdf9 , we added improved functionality for custom product attributes. This change does introduce a database schema change.

If you are not using Product Attributes, the simplest method to upgrade is to:

drop table product_productattribute;

Then syncdb:

python manage.py syncdb

If you are using attributes, you will need to dump the data and re-enter it with the new schema.

To alter the table add option_id as reference to product_attributeoption.

Improved currency handling

In 601f1bc697f2 , we changed the locale handling to reduce configuration issues.

The livesettings system is no longer used for setting and configuring currency. Please look at l10n.l10n_settings for examples of configuration. Essentially, if your default currency is not USD, you will need to add a new setting to your settings.py file, and configure the "currency_formats" and "default_currency" for your country.

For example, say you had a new currency, the FOO, which you wanted to use as your default currency, and say that it usually is written as ^value, or if negative ^(value)

In your settings.py you would do something like this

L10N_SETTINGS = {
  'currency_formats : {
     'FOO' : {'symbol': '^', 'positive' : "^%(val)0.2f", 'negative': "^(%(val)0.2f)", 'decimal' : '.'},
  },
  'default_currency' : 'FOO'
}

Removed some url slugs from livesettings

In 0f57815f1632 , removed PRODUCT_SLUG and CATEGORY_SLUG from the livesettings app. If you have configured these, you will now need to set it through the SATCHMO_SETTINGS variable. If you stayed with the defaults, there is no need to change anything.

Removed automatic adding of payment modules via livesettings

In 36235eb06717 , removed selection of payment modules via livesettings. Moving forward, you must explicitly add each payment module to your INSTALLED_APPS.

For example, to add the Authorize.net processor, you will want to add "payment.modules.authorizenet" to your INSTALLED_APPS.

This change is part of our goal to remove all settings from the livesettings system that require a restart to activate.

Add a unique_together constraint

In 75a2ea838067 added a unique_together constraint on the product CustomTextField model.

Change handling of discounts across multiple products

Prior to efd4515f00b1 , if a discount could not be evenly split across products, you could end up with the total discount being off by .01. For example, a discount total of $10 which applies to 3 items in one cart would end up with a discount of $3.33 from each item, giving a total discount of $9.99, rather than $10. For most people this change will be transparent but if you built special logic to handle this situation, this is slightly backwards incompatible.

Rename validProducts Table

In dd135395e9ac , we changed the name of the validProducts table to valid_products. This change was required because this table naming convention caused headaches for several different databases. The change you need to make is simply renaming the database table from product_discount_validProducts to product_discount_valid_products. Example SQL is below:

ALTER TABLE product_discount_validProducts RENAME TO product_discount_valid_products;

Moved Livesettings and Keyedcache to separate modules

In 043feaf2306b removed the Satchmo implementations of "keyedcache" and "livesettings". These modules are now available as separate modules, installable from PyPi, or source available from Bitbucket. http://bitbucket.org/bkroeze/django-livesettings, http://bitbucket.org/bkroeze/django-keyedcache

Changed L10N Settings variable names

In 3eaffb35d32f changed two of theL10n variables to new names so it makes more sense. The defaults will continue to work fine, if you did set them in L10N_SETTINGS, change show_translations to show_admin_translations and allow_translations to allow_translation_choice

Example admin:

    L10N_SETTINGS = {
      'show_admin_translations': False,
      'allow_translation_choice': False,
    }

Removed SSL from Livesettings

As part of the push to remove all settings which are not immediately applicable without restart, we removed "SSL" from all payment modules in 8dac9231d45c .

If you are using SSL in your checkout, add to your SATCHMO_SETTINGS:

  'SSL' : True

Split products into multiple modules

In 52fdf02869e0 , we split products into separate modules. These modules must be activated in your settings.py INSTALLED_APPS:

INSTALLED_APPS = (
   ...
    'product.modules.configurable',
    'product.modules.custom',
    'product.modules.downloadable',
    'product.modules.subscription',
   ...
)

Also, you must run a South migration to rename all the tables moved in this split.

Lastly, there is no longer any livesetting which controls the types of product modules activated. Instead, if they are in your INSTALLED_APPS, they are enabled.

In 46ceca1ebc77 , the related names for wishlists were changed so that it is a more logical naming convention. For a default satchmo install, this is entirely backwards compatible (no db changes are required.) However, if you had a custom view for the wishlists with code, similar to this:

my_wishlist_items = contact.contacts.all()
popularity = product.products.count()

You would need to change it to the much more logical sounding:

my_wishlist_items = contact.wishlist.all()
popularity = product.wishes.count()

Updated