Skip to content

Instantly share code, notes, and snippets.

View kenbolton's full-sized avatar

Ken Bolton kenbolton

  • BScientific
  • Beacon, NY
View GitHub Profile
@kenbolton
kenbolton / gist:3953717
Created October 25, 2012 16:10 — forked from joshcartme/gist:3943826
cartridge order setup which adds in tax total
from decimal import Decimal
from cartridge.shop.models import Order, SelectedProduct
def setup(self, request):
"""
Set order fields that are stored in the session, item_total, tax_total,
and total based on the given cart, and copy the cart items to the order.
Called in the final step of the checkout process prior to the payment
@kenbolton
kenbolton / gist:3438455
Created August 23, 2012 16:37
Taxability Information Code
EXTRA_MODEL_FIELDS = (
(
"cartridge.shop.models.Product.tic",
"CharField",
("Taxability Information Code",),
{"max_length":"5", "blank": True, "default":"00000", },
),
)
@kenbolton
kenbolton / gist:1436612
Created December 6, 2011 03:42 — forked from alokmishra/gist:835276
deploy with gunicorn django fabric git
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._