Skip to main content

A extendable category app using django-mptt for django-shop

Project description

A extendable category app using django-mptt for django-shop.

Installation

For the current stable version:

pip install django-shop-categories

For the development version:

pip install -e git+git://github.com/fivethreeo/django-shop-categories.git#egg=django-shop-categories

Configuration

Add 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 syncdb

Extending

In your own app make a models dir with __init__.py and a category.py dir, like so:

app/models/__init__.py
app/models/category.py

In category.py:

from django.db import models
from shop_categories.models.defaults.category.base import ProductCategoryBase

class 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.Category

Then, assuming your Product model is not already synced, run:

manage.py syncdb

When extending Product models in your shop make sure they subclass from shop_categories.models.defaults.product.base.CategoryProductBase

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-shop-categories-0.8.beta.2.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file django-shop-categories-0.8.beta.2.tar.gz.

File metadata

File hashes

Hashes for django-shop-categories-0.8.beta.2.tar.gz
Algorithm Hash digest
SHA256 a6bf29ef5ad901213f9ff4a1e59bae62372435db9ffa00f64ea2e9e1b8c21a0a
MD5 1a86ac098dad3944429cbb8bc1031871
BLAKE2b-256 1e4b2c0a003170fc397dbd08e35485d01f49b5bd4b3c65fb754cfce7b09c59ef

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page