In a view I get the latest sale and count then I want to save the incemented
count (number) to Count also save number to Sale
customer =
Sale.objects.all().order_by('-id').filter(email_address=email).distinct()0
this = Count.objects.all().order_by('-id')0
number = this.number + 1
a = this.save(force_insert=True)
ref = number
reference = number
name = customer.name
salutation = customer.salutation
b = customer.save(force_update=True)
I know the field names are rubbish but can anyone spot where I am going
wrong please
--
View this message in context: http://python.6.n6.nabble.com/saving-in-a-view-tp4343606p4343606.html
Sent from the django-users mailing list archive at Nabble.com.
I have 2 models Count is purely an incremental counter a model called Sale,
the reason for the Count models is to increment a reference for Sale and
other models
In a view I get the latest sale and count then I want to save the incemented
count (number) to Count also save number to Sale
customer = Sale.objects.all().order_by('-id').filter(email_address=email).distinct()[0]
this = Count.objects.all().order_by('-id')[0]
number = this.number + 1
a = this.save(force_insert=True)
b = customer.save(force_update=True)