This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """View classes for the get_client_info application.""" | |
| from shop.views import ShopTemplateView | |
| from shop.views.checkout import SelectShippingView | |
| class GetClientInfoView(SelectShippingView): | |
| """Displays form for gathering shipping and billing address.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHOP_SHIPPING_FLAT_RATE = '-30' | |
| SHOP_SHIPPING_BACKENDS = [ | |
| 'shop.shipping.backends.flat_rate.FlatRateShipping', | |
| ] | |
| SHOP_PAYMENT_BACKENDS = [ | |
| 'shop.payment.backends.pay_on_delivery.PayOnDeliveryBackend' | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib import admin | |
| from myshop import models as shop_models | |
| class LEDAdmin(admin.ModelAdmin): | |
| prepopulated_fields = {"slug": ("name",)} | |
| admin.site.register(shop_models.Category) | |
| admin.site.register(shop_models.Distributor) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import models | |
| from shop.models.productmodel import Product | |
| class Category(models.Model): | |
| """Master data: Names of categories.""" | |
| name = models.CharField(max_length=256) | |
| def __unicode__(self): | |
| return self.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkvirtualenv -p python2.7 --no-site-packages django-shop-adventures | |
| workon django-shop-adventures | |
| pip install django==1.3 | |
| pip install south | |
| pip install django-shop | |
| # this folder structure is not a must | |
| # it helps if you want to host your app at webfaction.com | |
| mkdir $HOME/Projects/django-shop-adventures/src/webapps/django | |
| mkdir $HOME/Projects/django-shop-adventures/src/webapps/static |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # kudos to https://github.com/drewlesueur | |
| # stolen from here: https://github.com/blog/266-fast-forward-your-fork#comment-11535 | |
| git checkout -b upstream-master | |
| git remote add upstream git://github.com/documentcloud/underscore.git | |
| git pull upstream master | |
| git checkout master // [my master branch] | |
| git merge upstream-master | |
| git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo(object): | |
| """Epic Docstring. What if it has 80 characters. Will gist add a scrollbar?""" | |
| def __init__(self): | |
| self.bar = 'foobar' |
NewerOlder