Esempio n. 1
0
def create_customer(request):
	name = request.POST['name']
	address = request.POST['address']
	if (name != '') and (address != ''):
		c= Customer(name= name, address = address)
		c.save()
	return priv_site_views.customers(request)
Esempio n. 2
0
def del_customer(request, customerID):
	cust = Customer(name = 'unknown')
	is_success=True
	try:
		cust = Customer.objects.get(pk = customerID)
		cust.delete()
	except:
		is_success= False
	return is_success, cust