Permalink
Browse files

Merge remote-tracking branch 'upstream/master' into custom_products

  • Loading branch information...
2 parents 53d1b0a + 965019f commit 542689caee429afa297f93b8346f4007d2312554 @AlexHill committed Jan 10, 2013
Showing with 3,183 additions and 2,141 deletions.
  1. +2 −0 .gitignore
  2. +34 −0 .hgtags
  3. +1 −1 .tx/config
  4. +4 −0 AUTHORS
  5. +30 −0 CHANGELOG
  6. +22 −1 README.rst
  7. +1 −1 cartridge/__init__.py
  8. +3 −25 cartridge/project_template/settings.py
  9. +37 −9 cartridge/project_template/urls.py
  10. +2 −0 cartridge/shop/admin.py
  11. +21 −2 cartridge/shop/defaults.py
  12. +6 −3 cartridge/shop/forms.py
  13. +428 −381 cartridge/shop/locale/ca/LC_MESSAGES/django.po
  14. +374 −345 cartridge/shop/locale/cs/LC_MESSAGES/django.po
  15. +193 −170 cartridge/shop/locale/en/LC_MESSAGES/django.po
  16. +245 −192 cartridge/shop/locale/es/LC_MESSAGES/django.po
  17. BIN cartridge/shop/locale/fr/LC_MESSAGES/django.mo
  18. +326 −276 cartridge/shop/locale/fr/LC_MESSAGES/django.po
  19. +240 −218 cartridge/shop/locale/it/LC_MESSAGES/django.po
  20. +242 −218 cartridge/shop/locale/pt_BR/LC_MESSAGES/django.po
  21. +247 −244 cartridge/shop/locale/ru/LC_MESSAGES/django.po
  22. +255 −0 cartridge/shop/migrations/0017_auto__add_field_category_featured_image.py
  23. +257 −0 cartridge/shop/migrations/0018_auto__add_field_product_in_sitemap.py
  24. +17 −10 cartridge/shop/models.py
  25. +3 −1 cartridge/shop/page_processors.py
  26. +1 −0 cartridge/shop/payment/authorizenet.py
  27. +11 −3 cartridge/shop/payment/egate.py
  28. +12 −7 cartridge/shop/payment/paypal.py
  29. +46 −0 cartridge/shop/payment/stripe_api.py
  30. +2 −0 cartridge/shop/static/css/cartridge.css
  31. +3 −2 cartridge/shop/templates/accounts/account_profile_update.html
  32. +2 −3 cartridge/shop/templates/admin/shop/order/change_form.html
  33. +4 −4 cartridge/shop/templates/includes/user_panel.html
  34. +19 −6 cartridge/shop/templates/pages/category.html
  35. +3 −3 cartridge/shop/templates/shop/billing_shipping.html
  36. +2 −2 cartridge/shop/templates/shop/cart.html
  37. +3 −3 cartridge/shop/templates/shop/checkout.html
  38. +3 −3 cartridge/shop/templates/shop/complete.html
  39. +3 −3 cartridge/shop/templates/shop/order_history.html
  40. +2 −2 cartridge/shop/templates/shop/wishlist.html
  41. +3 −0 cartridge/shop/templatetags/shop_tags.py
  42. +64 −0 cartridge/shop/tests.py
  43. +1 −1 cartridge/shop/utils.py
  44. +1 −1 cartridge/shop/views.py
  45. BIN docs/img/graph-small.png
  46. BIN docs/img/graph.png
  47. +7 −0 docs/settings.rst
  48. +1 −1 setup.py
View
@@ -1,3 +1,5 @@
*.pyc
*.pyo
*.db
+*.egg-info
+.idea/
View
34 .hgtags
@@ -0,0 +1,34 @@
+24c12f6c2c16919a030e84397ac83bcb14e42e57 0.7.0
+5e8944419600fb67d2ea349b8054b7335107c6ed 0.6.0
+ac9d01d6d925b8cee098c9f3eb3f1f8f4c81c5fa 0.5.2
+bf4255a3986a5c895204d13334f4bb966a8343d9 0.5.1
+c3c13dc3cd39b35aeb4589447332bc1e574f4961 0.5.0
+fa06ffb4703111dc935676247334042e1952aa75 0.4.9
+1b9c0fc83d1331039c95189fed8ac8f807d39139 0.4.8
+dc547e085b762ef219e0e5097928317b60b7df6e 0.4.7
+e7e1c2db0dae0d18cb19d8dec06422c864204502 0.4.6
+8f7d057f498415bb4df3c41aae0b4c613501736f 0.4.5
+772051082b3a09bc8641395ca79975be90fe47df 0.4.4
+1611c339a9929818a5aa5d8a8b14f375acf06b7f 0.4.3
+b71cc5a7404b9f3a9b89ab9691dd1385ea0d3409 0.4.2
+5281c3e67d0081ae493f9f80a327545bf066cfa4 0.4.1
+bf079feca91a6215b45e106d67f2e0873ffdb801 0.4.0
+1167518cb51e63ad4df7e7eadbb27199832ee516 0.3.7
+eeb4ef7b3908801f5ebcf74f608483898a15c624 0.3.6
+f1e346df1843d40292bba58a1ef165644ee339d7 0.3.5
+62eb250936a72945d146f2cca21a1bd08beaad52 0.3.4
+8f70ebdc81c9fa5f98e3a31bfdc9178826300417 0.3.3
+796b096b5ad2aa77a19b0c14d74b927b7a476a39 0.3.2
+772cb37d1dd9bee3b04532eec7aea60e72281515 0.3.1
+9533a620556d992203068fe7e0b6675e3c5368b7 0.3
+87163d532de1d5fab19ca4701cf044d8940651b1 0.2.2
+1f28b51c013988dd881249ee2fe657bbff9822a6 0.2.1
+b5af6c0415a23b8ec25d1fd2f6533e419b9a5f1d 0.2
+128f53e29ebc2f4ddcf71ffc987be865569a3d21 0.1.8
+741bfe6fd4b2f779fd1f647d06c2a295ac0c176c 0.1.7
+931b4cb3c47b1f3c1d95260ac842cdcfa7c37fe7 0.1.6
+c5b518b69c768e65d504fc604eed1309df8d6059 0.1.5
+33dd94280c4e8ee4d590c4527f168556c548bb90 0.1.4
+9cbc4963667f31c3b7be1e85a951f239e8f8091e 0.1.2
+058dd00c34ed2c72b19b63c1531bb9571b17e368 0.1.1
+5912c2ce614a313de3c0d53448026a8e8bc12c9d 0.1
View
@@ -1,5 +1,5 @@
[main]
-host = https://www.transifex.net
+host = https://www.transifex.com
[cartridge.default]
file_filter = cartridge/shop/locale/<lang>/LC_MESSAGES/django.po
View
@@ -19,3 +19,7 @@
* Alexander Hill
* Yong Choi
* Michal Kuffa
+* Josh VanderLinden
+* Thomas Wajs
+* Kenneth Love
+* Sachin Shende
View
@@ -1,3 +1,33 @@
+Version 0.7.0 (Dec 26, 2012)
+----------------------------
+
+ * Specify the product object in the product view to be the editable object to link to from the admin toolbar - Stephen McDonald
+ * add featured image for category - Dmitry Falk
+ * Update url templatetags for Django 1.5. See ``https://docs.djangoproject.com/en/1.4/releases/1.3/#changes-to-url-and-ssi``. "{% load url from future %}" is omitted in favour of a global import in. mezzanine's ``boot/__init__.py`` - Alex Hill
+ * Load future tag lib explicitly in templates - Stephen McDonald
+ * get ``child_categories`` via ``page_processor`` - Dmitry Falk
+ * fix child categories css - Dmitry Falk
+ * Initialize credit card expiry month to the current month - Josh Cartmell
+ * Added Stripe Integration - Sean Voss
+ * Rename stripe package and clean up some of the exception handling - Stephen McDonald
+ * Fix imports - Stephen McDonald
+ * ``Order.setup`` stores ``discount_code`` from session - Luke Miller
+ * Add Mezzanine's new 404 handler to project template's ``urls.py`` - Stephen McDonald
+ * Update ``.po`` files - Sebastián Ramírez Magrí
+ * #66 - Execute the MySQL workaround code - Josh VanderLinden
+ * Ensure valid cart in handling checkout steps. Fixes the case of session timeout in final step - Stephen McDonald
+ * Use Mezzanine's ``upload_to`` handler for configurable ``upload_to`` args on file fields - Stephen McDonald
+ * Catch a missing key error. Since you can't guarantee that every session has the `order` key in it,. put a try/except around the deletion - Kenneth Love
+ * shensac: ``locale.currency`` was failing on Windows for GBP (£) as it returned hex string \xa3 for the currency symbol. Added a platform check and if Windows convert the string to unicode using ``iso_8859_1`` encoding - Sachin Shende
+ * shensac: The previous commit made the build fail. The issue was with the length of line. Have fixed it now - Sachin Shende
+ * Make the windows handling of currency symbol a bit drier - Stephen McDonald
+ * Add the product model to Mezzanine's new ``SEARCH_MODEL_CHOICES`` setting - Stephen McDonald
+ * Add Mezzanine's new site perms middleware to ``project_template's`` ``settings.py`` - Stephen McDonald
+ * Updated comments in ``project_template's`` ``urls.py`` module from Mezzanine - Stephen McDonald
+ * Added migration for Mezzanine's ``Displayable.in_sitemap`` - Stephen McDonald
+ * Remove editable settings commented out in project template's ``settings.py`` since it led to confusion when updated via admin - Stephen McDonald
+ * Bump mezzanine version to 1.3.0 - Stephen McDonald
+
Version 0.6.0 (Aug 05, 2012)
----------------------------
View
@@ -1,4 +1,5 @@
.. image:: https://secure.travis-ci.org/stephenmcd/cartridge.png?branch=master
+ :target: http://travis-ci.org/#!/stephenmcd/cartridge
Created by `Stephen McDonald <http://twitter.com/stephen_mcd>`_
@@ -116,6 +117,21 @@ Please note the following guidelines for contributing:
* If you are adding new functionality, you must include basic tests
and documentation.
+If you want to do development with Cartridge, here's a quick way to set
+up a development environment and run the Cartridge unit tests, using
+`virtualenvwrapper`_ to set up a virtualenv::
+
+ $ mkvirtualenv cartridge
+ $ workon cartridge
+ $ pip install -e git://github.com/stephenmcd/mezzanine.git#egg=mezzanine
+ $ pip install pep8 pyflakes
+ $ git clone https://github.com/stephenmcd/cartridge
+ $ cd cartridge
+ $ python setup.py develop
+ $ cp cartridge/project_template/local_settings.py.template cartridge/project_template/local_settings.py
+ $ ./cartridge/project_template/manage.py test shop
+
+
Language Translations
=====================
@@ -160,6 +176,11 @@ Sites Using Cartridge
* `Life is Good <http://lifeisgoodforall.co.uk/>`_
* `Brooklyn Navy Yard <http://bldg92.org/>`_
* `Cotton On Asia <http://asia.cottonon.com/>`_
+ * `Manai Glitter <https://manai.co.uk>`_
+ * `Tactical Bags <http://tacticalbags.ru>`_
+ * `Charles Koll Jewelry <http://charleskoll.com>`_
+ * `Puraforce Remedies <http://puraforceremedies.com/>`_
+ * `Adrenaline <http://www.adrln.com/>`_
.. _`Django`: http://djangoproject.com/
.. _`BSD licensed`: http://www.linfo.org/bsdlicense.html
@@ -180,4 +201,4 @@ Sites Using Cartridge
.. _`#mezzanine IRC channel`: irc://freenode.net/mezzanine
.. _`Freenode`: http://freenode.net
.. _`Django's internationalization`: https://docs.djangoproject.com/en/dev/topics/i18n/translation/
-
+.. _`virtualenvwrapper`: http://www.doughellmann.com/projects/virtualenvwrapper
View
@@ -1 +1 @@
-__version__ = "0.6.0"
+__version__ = "0.7.0"
@@ -10,8 +10,8 @@
# Sequence of available credit card types for payment.
# SHOP_CARD_TYPES = ("Mastercard", "Visa", "Diners", "Amex")
-# If True, users must create a login for the checkout process.
-# SHOP_CHECKOUT_ACCOUNT_REQUIRED = False
+# Setting to turn on featured images for shop categories. Defaults to False.
+# SHOP_CATEGORY_USE_FEATURED_IMAGE = True
# Set an alternative OrderForm class for the checkout process.
# SHOP_CHECKOUT_FORM_CLASS = 'cartridge.shop.forms.OrderForm'
@@ -24,17 +24,11 @@
# completion.
# SHOP_CHECKOUT_STEPS_CONFIRMATION = True
-# If False, there is no payment step on the checkout process.
-# SHOP_PAYMENT_STEP_ENABLED = True
-
# Controls the formatting of monetary values accord to the locale
# module in the python standard library. If an empty string is
# used, will fall back to the system's locale.
# SHOP_CURRENCY_LOCALE = ""
-# Default cost of shipping when no custom shipping is implemented.
-# SHOP_DEFAULT_SHIPPING_VALUE = 10
-
# Dotted package path and class name of the function that
# is called on submit of the billing/shipping checkout step. This
# is where shipping calculation can be performed and set using the
@@ -143,23 +137,6 @@
#
# BLOG_USE_FEATURED_IMAGE = True
-# If ``True``, users will be automatically redirected to HTTPS
-# for the URLs specified by the ``SSL_FORCE_URL_PREFIXES`` setting.
-#
-# SSL_ENABLED = True
-
-# Host name that the site should always be accessed via that matches
-# the SSL certificate.
-#
-# SSL_FORCE_HOST = "www.example.com"
-
-# Sequence of URL prefixes that will be forced to run over
-# SSL when ``SSL_ENABLED`` is ``True``. i.e.
-# ('/admin', '/example') would force all URLs beginning with
-# /admin or /example to run over SSL. Defaults to:
-#
-# SSL_FORCE_URL_PREFIXES = ("/admin", "/account", "/shop/checkout",)
-
# If True, the south application will be automatically added to the
# INSTALLED_APPS setting.
USE_SOUTH = True
@@ -363,6 +340,7 @@
"mezzanine.core.middleware.TemplateForDeviceMiddleware",
"mezzanine.core.middleware.TemplateForHostMiddleware",
"mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
+ "mezzanine.core.middleware.SitePermissionMiddleware",
# Uncomment the following if using any of the SSL settings:
# "mezzanine.core.middleware.SSLRedirectMiddleware",
"mezzanine.pages.middleware.PageMiddleware",
@@ -12,12 +12,17 @@
# to the project's homepage.
urlpatterns = patterns("",
+
+ # Change the admin prefix here to use an alternate URL for the
+ # admin interface, which would be marginally more secure.
("^admin/", include(admin.site.urls)),
+
+ # Cartridge URLs.
("^shop/", include("cartridge.shop.urls")),
url("^account/orders/$", "cartridge.shop.views.order_history",
name="shop_order_history"),
- # We don't want to presume how your homepage works, so here are a
+ # We don't want to presume how your homepage works, so here are a
# few patterns you can use to set it up.
# HOMEPAGE AS STATIC TEMPLATE
@@ -34,13 +39,18 @@
# This pattern gives us a normal ``Page`` object, so that your
# homepage can be managed via the page tree in the admin. If you
# use this pattern, you'll need to create a page in the page tree,
- # and specify its URL (in the Meta Data section) as "home", which
- # is the name used below in the ``{"slug": "home"}`` part. Make
- # sure to uncheck "show in navigation" when you create the page,
- # since the link to the homepage is always hard-coded into all the
- # page menus that display navigation on the site.
-
- # url("^$", "mezzanine.pages.views.page", {"slug": "home"}, name="home"),
+ # and specify its URL (in the Meta Data section) as "/", which
+ # is the value used below in the ``{"slug": "/"}`` part. Make
+ # sure to uncheck all templates for the "show in menus" field
+ # when you create the page, since the link to the homepage is
+ # always hard-coded into all the page menus that display navigation
+ # on the site. Also note that the normal rule of adding a custom
+ # template per page with the template name using the page's slug
+ # doesn't apply here, since we can't have a template called
+ # "/.html" - so for this case, the template "pages/index.html" can
+ # be used.
+
+ # url("^$", "mezzanine.pages.views.page", {"slug": "/"}, name="home"),
# HOMEPAGE FOR A BLOG-ONLY SITE
# -----------------------------
@@ -54,18 +64,36 @@
# MEZZANINE'S URLS
# ----------------
- # Note: ADD YOUR OWN URLPATTERNS *ABOVE* THE LINE BELOW.
+ # ADD YOUR OWN URLPATTERNS *ABOVE* THE LINE BELOW.
# ``mezzanine.urls`` INCLUDES A *CATCH ALL* PATTERN
# FOR PAGES, SO URLPATTERNS ADDED BELOW ``mezzanine.urls``
# WILL NEVER BE MATCHED!
+
# If you'd like more granular control over the patterns in
# ``mezzanine.urls``, go right ahead and take the parts you want
# from it, and use them directly below instead of using
# ``mezzanine.urls``.
("^", include("mezzanine.urls")),
+ # MOUNTING MEZZANINE UNDER A PREFIX
+ # ---------------------------------
+ # You can also mount all of Mezzanine's urlpatterns under a
+ # URL prefix if desired. When doing this, you need to define the
+ # ``SITE_PREFIX`` setting, which will contain the prefix. Eg:
+ # SITE_PREFIX = "my/site/prefix"
+ # For convenience, and to avoid repeating the prefix, use the
+ # commented out pattern below (commenting out the one above of course)
+ # which will make use of the ``SITE_PREFIX`` setting. Make sure to
+ # add the import ``from django.conf import settings`` to the top
+ # of this file as well.
+ # Note that for any of the various homepage patterns above, you'll
+ # need to use the ``SITE_PREFIX`` setting as well.
+
+ # ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls"))
+
)
# Adds ``STATIC_URL`` to the context of error pages, so that error
# pages can use JS, CSS and images.
+handler404 = "mezzanine.core.views.page_not_found"
handler500 = "mezzanine.core.views.server_error"
View
@@ -66,6 +66,8 @@
category_fieldsets += ((_("Product filters"), {
"fields": ("sale", ("price_min", "price_max"), "combined"),
"classes": ("collapse-closed",)},),)
+if settings.SHOP_CATEGORY_USE_FEATURED_IMAGE:
+ category_fieldsets[0][1]["fields"].insert(3, "featured_image")
# Options are only used when variations are in use, so only provide
# them as filters for dynamic categories when this is the case.
View
@@ -26,6 +26,18 @@
),
)
+# Add the product model to the list of search choices.
+register_setting(
+ name="SEARCH_MODEL_CHOICES",
+ description=_("Sequence of models that will be provided by default as "
+ "choices in the search form. Each model should be in the format "
+ "``app_label.model_name``. Only models that subclass "
+ "``mezzanine.core.models.Displayable`` should be used."),
+ editable=False,
+ default=("shop.Product",),
+ append=True,
+)
+
# Add the checkout URLs prefix to those forced to run over SSL.
# Only relevant if SSL_ENABLED (defined in Mezzanine) is True.
register_setting(
@@ -45,8 +57,8 @@
name="TEMPLATE_ACCESSIBLE_SETTINGS",
description=_("Sequence of setting names available within templates."),
editable=False,
- default=("SHOP_CARD_TYPES", "SHOP_CHECKOUT_STEPS_SPLIT",
- "SHOP_PRODUCT_SORT_OPTIONS",),
+ default=("SHOP_CARD_TYPES", "SHOP_CATEGORY_USE_FEATURED_IMAGE",
+ "SHOP_CHECKOUT_STEPS_SPLIT", "SHOP_PRODUCT_SORT_OPTIONS",),
append=True,
)
@@ -71,6 +83,13 @@
)
register_setting(
+ name="SHOP_CATEGORY_USE_FEATURED_IMAGE",
+ description=_("Enable featured images in shop categories"),
+ editable=False,
+ default=False,
+)
+
+register_setting(
name="SHOP_CHECKOUT_ACCOUNT_REQUIRED",
label=_("Checkout account required"),
description=_("If True, users must create a login for the checkout "
View
@@ -1,5 +1,6 @@
from copy import copy
+from datetime import date
from itertools import dropwhile, takewhile
from locale import localeconv
from re import match
@@ -257,13 +258,15 @@ class OrderForm(FormsetForm, DiscountForm):
remember = forms.BooleanField(required=False, initial=True,
label=_("Remember my address for next time"))
card_name = forms.CharField(label=_("Cardholder name"))
- card_type = forms.ChoiceField(widget=forms.RadioSelect,
+ card_type = forms.ChoiceField(label=_("Card type"),
+ widget=forms.RadioSelect,
choices=make_choices(settings.SHOP_CARD_TYPES))
- card_number = forms.CharField()
+ card_number = forms.CharField(label=_("Card number"))
card_expiry_month = forms.ChoiceField(
+ initial="%02d" % date.today().month,
choices=make_choices(["%02d" % i for i in range(1, 13)]))
card_expiry_year = forms.ChoiceField()
- card_ccv = forms.CharField(label="CCV", help_text=_("A security code, "
+ card_ccv = forms.CharField(label=_("CCV"), help_text=_("A security code, "
"usually the last 3 digits found on the back of your card."))
class Meta:
Oops, something went wrong.

0 comments on commit 542689c

Please sign in to comment.