django-shop-categoriesA extendable category app using django-mptt for django-shop | |
Download |
django-shop-categories Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Oyvind Saltvik
- Publisher web site:
- http://github.com/fivethreeo/
django-shop-categories Tags
django-shop-categories Description
django-shop-categories is an extendable category app using django-mptt for django-shop.InstallationFor the current stable version:pip install django-shop-categoriesFor the development version:pip install -e git+git://github.com/fivethreeo/django-shop-categories.git#egg=django-shop-categoriesConfigurationAdd shop_categories to settings.INSTALLED_APPS.Set SHOP_PRODUCT_MODEL to shop_categories.models.default.product.default.CategoryProduct.In your urls.py add this before your shop patterns:urlpatterns += patterns('', url(r'^catalog/', include('shop_categories.urls')),)Then run:manage.py syncdbExtendingIn your own app make a models dir with __init__.py and a category.py dir, like so:app/models/__init__.pyapp/models/category.pyIn category.py:from django.db import modelsfrom shop_categories.models.defaults.category.base import ProductCategoryBaseclass Category(ProductCategoryBase): image = models.ImageField(upload_to='categoryimages/', null=True, blank=True) class Meta: abstract = False app_label = 'app'Set SHOP_CATEGORIES_CATEGORY_MODEL to app.models.category.CategoryThen, assuming your Product model is not already synced, run:manage.py syncdbWhen extending Product models in your shop make sure they subclass from shop_categories.models.defaults.product.base.CategoryProductBaseProduct's homepage
django-shop-categories Related Software