Re: Translate db api in model

2005-12-26 Thread Andreas Stuhlmüller
> I get the following error. 'WorkOrder' object has not attribute > 'get_values'. Any ideas? Try this: def _pre_save(self): lastid = get_values(fields=['id'])[-1]['id'] self.wonum = 'WO-'+lastid+1 Andreas

Translate db api in model

2005-12-26 Thread Burhan
Hello: I'm having a problem trying to convert something that works great on the python interpreter into the model. I need to set a property of a model before it is saved. This propery is dependent on the primary key (serial) of the record. I tried first to do it using _post_save() but the i