Re: Saving an inline view and executing an aggregating function only once

2013-11-09 Thread Victor
You're almost right. I want that - for each item_code - the sum aggregated by item_code of the items inserted into OrderDetail be automatically inserted into total_quantity_in_store by the same code in Items model. Ciao Vittorio Il giorno 08/nov/2013, alle ore 16:13, Vincenzo Prignano ha

Re: Saving an inline view and executing an aggregating function only once

2013-11-08 Thread Vincenzo Prignano
I got that you are executing a raw sql query every time you insert a new OrderDetail record. But can I ask why are you doing this? I think you should really need to redesign your models.. On Thursday, November 7, 2013 10:04:33 AM UTC+1, vittorio wrote: > > I made an effort to simplify my app

Saving an inline view and executing an aggregating function only once

2013-11-07 Thread Victor
I made an effort to simplify my app and translate it into English. Here it is = models.py . class Items(models.Model): code = models.CharField(primary_key=True,max_length=15,db_column='code') description = models.CharField(max_length=255,

Re: saving in a view

2012-01-27 Thread Ian Clelland
On Fri, Jan 27, 2012 at 9:26 AM, MikeKJ wrote: > 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

saving in a view

2012-01-27 Thread MikeKJ
=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. -- You received this message because you