A small shop for Django Framework
Project description
Django Plugshop
===============
A set of useless abstract models
Requirements
============
1. [django](https://github.com/django/django/) >= 1.4, <=1.5
2. [django-mptt](https://github.com/django-mptt/django-mptt/)
Installation
============
* Add the `plugshop` directory to your Python path.
* Add `plugshop` to your `INSTALLED_APPS`
* Add the following middleware to your project's settings.py file:
`plugshop.middleware.CartMiddleware`
* Add the request context processor:
TEMPLATE_CONTEXT_PROCESSORS = (
# ...
'django.core.context_processors.request',
# ...
)
* Add URL-patterns:
urlpatterns = patterns('',
url(r'^shop/', include('plugshop.urls')),
)
* Override default models. Example:
PLUGSHOP_MODELS = {
'PRODUCT': 'myshop.Product',
'CATEGORY': 'myshop.Category',
'ORDER': 'myshop.Order',
}
* Run `python manage.py syncdb`
* Profit!
Configuration
=============
Models:
PLUGSHOP_MODELS = {
'PRODUCT': 'plugshop.Product',
'CATEGORY': 'plugshop.Category',
'ORDER': 'plugshop.Order',
'ORDER_PRODUCTS': 'plugshop.OrderProducts',
}
Forms:
PLUGSHOP_FORMS = {
'ORDER': 'plugshop.forms.OrderForm',
}
Config:
PLUGSHOP_CONFIG = {
'REQUEST_NAMESPACE': 'cart',
'SESSION_NAMESPACE': 'cart',
'URL_PREFIX': 'shop/',
}
Other options:
PLUGSHOP_OPTIONS = {
# Possible values of the status of the order. Default values:
'STATUS_CHOICES': (
(1, _('Created')),
(2, _('Confirmed')),
(3, _('Denied')),
(4, _('Shipped')),
(5, _('Completed')),
),
}
Cart
====
#views.py
def my_view(request):
cart = request.cart
Or
#settings.py
PLUGSHOP_CONFIG = {
...
'REQUEST_NAMESPACE': 'my_cart_namespace',
...
}
#views.py
def my_view(request):
cart = request.my_cart_namespace
===============
A set of useless abstract models
Requirements
============
1. [django](https://github.com/django/django/) >= 1.4, <=1.5
2. [django-mptt](https://github.com/django-mptt/django-mptt/)
Installation
============
* Add the `plugshop` directory to your Python path.
* Add `plugshop` to your `INSTALLED_APPS`
* Add the following middleware to your project's settings.py file:
`plugshop.middleware.CartMiddleware`
* Add the request context processor:
TEMPLATE_CONTEXT_PROCESSORS = (
# ...
'django.core.context_processors.request',
# ...
)
* Add URL-patterns:
urlpatterns = patterns('',
url(r'^shop/', include('plugshop.urls')),
)
* Override default models. Example:
PLUGSHOP_MODELS = {
'PRODUCT': 'myshop.Product',
'CATEGORY': 'myshop.Category',
'ORDER': 'myshop.Order',
}
* Run `python manage.py syncdb`
* Profit!
Configuration
=============
Models:
PLUGSHOP_MODELS = {
'PRODUCT': 'plugshop.Product',
'CATEGORY': 'plugshop.Category',
'ORDER': 'plugshop.Order',
'ORDER_PRODUCTS': 'plugshop.OrderProducts',
}
Forms:
PLUGSHOP_FORMS = {
'ORDER': 'plugshop.forms.OrderForm',
}
Config:
PLUGSHOP_CONFIG = {
'REQUEST_NAMESPACE': 'cart',
'SESSION_NAMESPACE': 'cart',
'URL_PREFIX': 'shop/',
}
Other options:
PLUGSHOP_OPTIONS = {
# Possible values of the status of the order. Default values:
'STATUS_CHOICES': (
(1, _('Created')),
(2, _('Confirmed')),
(3, _('Denied')),
(4, _('Shipped')),
(5, _('Completed')),
),
}
Cart
====
#views.py
def my_view(request):
cart = request.cart
Or
#settings.py
PLUGSHOP_CONFIG = {
...
'REQUEST_NAMESPACE': 'my_cart_namespace',
...
}
#views.py
def my_view(request):
cart = request.my_cart_namespace
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-plugshop-0.4.1.tar.gz
(15.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
django_plugshop-0.4.1-py2.7.egg
(45.6 kB
view details)
File details
Details for the file django-plugshop-0.4.1.tar.gz.
File metadata
- Download URL: django-plugshop-0.4.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d7a09e026877cbb8df0b702e027d8327da60025e405dcbaa9e0a7147715a72c
|
|
| MD5 |
dc583ed5c388aa0a7a6e5b8820f26e98
|
|
| BLAKE2b-256 |
67dca292c33cdb3f825f5bf922844be28e29f6172a5bb1a048774c0f19ff8343
|
File details
Details for the file django_plugshop-0.4.1-py2.7.egg.
File metadata
- Download URL: django_plugshop-0.4.1-py2.7.egg
- Upload date:
- Size: 45.6 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8120f35e5d40eba8544864a028c9d4c6351b3bca5fc451b8a4812bb2a3438644
|
|
| MD5 |
2d26b4654428654b5f709f6587c36dcc
|
|
| BLAKE2b-256 |
ad2d1f15aa711914022b4d061bb2f59732fbf347f3156d22931ea1b398194d12
|