Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/d/j/django-lfs-0.7.7/lfs/manage/customer_tax/views.py   django-lfs(Download)
from lfs.catalog.models import Product
from lfs.customer_tax.models import CustomerTax
from lfs.manage.customer_tax.forms import CustomerTaxForm
 
 
    customer_tax = get_object_or_404(CustomerTax, pk=id)
    if request.method == "POST":
        form = CustomerTaxForm(instance=customer_tax, data=request.POST, files=request.FILES)
        if form.is_valid():
            form.save()
            )
    else:
        form = CustomerTaxForm(instance=customer_tax)
 
    return render_to_response(template_name, RequestContext(request, {
def add_customer_tax(request, template_name="manage/customer_tax/add_customer_tax.html"):
    """Provides a form to add a new customer tax.
    """
    if request.method == "POST":
        form = CustomerTaxForm(data=request.POST, files=request.FILES)
            )
    else:
        form = CustomerTaxForm()
 
    return render_to_response(template_name, RequestContext(request, {

src/d/j/django-lfs-HEAD/lfs/manage/customer_tax/views.py   django-lfs(Download)
from lfs.core.utils import LazyEncoder
from lfs.customer_tax.models import CustomerTax
from lfs.manage.customer_tax.forms import CustomerTaxForm
 
 
    """
    if form is None:
        form = CustomerTaxForm(instance=customer_tax)
 
    return render_to_string(template_name, RequestContext(request, {
def add_customer_tax(request, template_name="manage/customer_tax/add_customer_tax.html"):
    """Provides a form to add a new customer tax.
    """
    if request.method == "POST":
        form = CustomerTaxForm(data=request.POST, files=request.FILES)
            )
    else:
        form = CustomerTaxForm()
 
    return render_to_response(template_name, RequestContext(request, {
    """
    customer_tax = get_object_or_404(CustomerTax, pk=id)
    form = CustomerTaxForm(instance=customer_tax, data=request.POST, files=request.FILES)
    if form.is_valid():
        form.save()