Did I find the right examples for you? yes no

All Samples(9)  |  Call(7)  |  Derive(0)  |  Import(2)

src/d/j/django-lfs-HEAD/lfs/manage/manufacturers/views.py   django-lfs(Download)
from lfs.catalog.models import Product
from lfs.core.utils import LazyEncoder
from lfs.manage.manufacturers.forms import ManufacturerDataForm, ManufacturerAddForm
from lfs.manufacturer.models import Manufacturer
from lfs.manage.manufacturers.forms import ViewForm
    manufacturer = Manufacturer.objects.get(pk=manufacturer_id)
    if request.method == "POST":
        form = ManufacturerDataForm(instance=manufacturer, data=request.POST)
    else:
        form = ManufacturerDataForm(instance=manufacturer)
def update_data(request, manufacturer_id):
    """Updates data of manufacturer with given manufacturer id.
    """
    manufacturer = Manufacturer.objects.get(pk=manufacturer_id)
    form = ManufacturerDataForm(instance=manufacturer, data=request.POST,

src/d/j/django-lfs-0.7.7/lfs/manage/manufacturers/views.py   django-lfs(Download)
from lfs.catalog.models import Product
from lfs.core.utils import LazyEncoder
from lfs.manage.manufacturers.forms import ManufacturerDataForm
from lfs.manufacturer.models import Manufacturer
 
        })
 
    data_form = ManufacturerDataForm(instance=manufacturer)
    return render_to_response(template_name, RequestContext(request, {
        "categories": categories,
def add_manufacturer(request, template_name="manage/manufacturers/add_manufacturer.html"):
    """Form and logic to add a manufacturer.
    """
    if request.method == "POST":
        form = ManufacturerDataForm(data=request.POST)
 
    else:
        form = ManufacturerDataForm()
 
    return render_to_response(template_name, RequestContext(request, {
def update_data(request, manufacturer_id):
    """Updates data of manufacturer with given manufacturer id.
    """
    manufacturer = Manufacturer.objects.get(pk=manufacturer_id)
    form = ManufacturerDataForm(instance=manufacturer, data=request.POST)