On Mon, 2002-11-18 at 20:34, Tom Harris wrote: > Greetings, > > I am playing with Middlekit, can someone tell me the correct way to clear > the error state in the store if an object added to the store with > addObject(), then attempted to be saved with saveChanges() raises an > exception (in my test this was because the object had None in a field that > was NOT NULL).
Hi Tom, There isn't really an "error state" as such in the store, except that on subsequent calls to saveChanges(), the store will try to save the same object again (which is a problem). There is no way to tell the store not to save an object which you have already changed, so your two choices are: 1) Catch the exception, then set the NOT NULL field to something other than None. The next saveChanges() should succeed. 2) Ensure that NOT NULL fields are filled before calling saveChanges(). In my development I go with #2. If you are by chance getting the values from a web form, you might want to use FunFormKit or FormKit to do validation on the field values before storing them in your object. Hope this helps, Jason > ------------------------------------------------------- > This sf.net email is sponsored by: To learn the basics of securing > your web site with SSL, click here to get a FREE TRIAL of a Thawte > Server Certificate: http://www.gothawte.com/rd524.html > _______________________________________________ > Webware-discuss mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webware-discuss -- Jason D. Hildebrand [EMAIL PROTECTED] ------------------------------------------------------- This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss