Re: forms and one-to-many relationships

2006-12-13 Thread MerMer
Mathew, I think you need to look at "Signals". It's an implementation of Pydispatcher. Basically, you register your signal to a particular object. Whenever that object is about to be changed the signal is sent and your code is runt. There is a "Pre-Save" state which should allow you to ru

Re: forms and one-to-many relationships

2006-12-13 Thread [EMAIL PROTECTED]
Hi. Im not sure, but i guess You are using generic views. If yes, make a wrapper of your view, and put that code in that wrapper function. Besides overriding save of the model works fine. But i personally would put such code in my own form manipulator, you keep clean views and your model also. Kin

forms and one-to-many relationships

2006-12-09 Thread mfremont
I'm trying to create a simple invoice application where an Invoice has (0..n) LineItems. I've created form that contains a few entries for line items, and using the standard AddManipulator I'm able to save a new invoice and its line items to the database. But I would like to add some code that p