On Wed, 2007-10-31 at 18:05 -0700, Ken wrote: > > > On Oct 31, 6:07 pm, Ken <[EMAIL PROTECTED]> wrote: > > > > > I have a similar thing I wish to accomplish. It's not quite model > > validation, rather model completion. The form provides a field that > > fills one model field but has to be munged to fill a second model > > field. I thought the appropriate place is in the model's save() > > function prior to calling the base class save() function. Can you > > show an example of how to access the model's fields? I tried using > > self._meta.fields, but I'm apparently indexing it wrong. models/ > > __init__.py is beyond me. :( > > > > I have also wondered why Model.save() returns nothing. How do you > > detect if the SQL insert or update fails? > > Duh! :\ I was making things too complicated. I was able to redefine > save() to do what I want. But, I would still like to hear why save() > does not confirm if the SQL insert or update succeed or failed? Or, > perhaps I've overlooked something in the docs.
It raises an exception. Normal Python error handling process. Regards, Malcolm -- If it walks out of your refrigerator, LET IT GO!! http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---