I think you're looking for the save-and-delete hooks:

http://www.djangoproject.com/documentation/models/save_delete_hooks/

They will allow you to make the changes before the object is
saved without overriding django's own internal save
functionality.

If I understand this correctly, it's for a descendant of a Model, not for a descendant of a Field. It led me though to digging for things with "save" in the name. Combined with looking at the Date/Time Field's "auto_now" abilities, I found that Field objects seem to respect a "pre_save()" method that can be overridden at the field level. I've implemented that in a way similar to how the Date/Time fields do, and hope it will do the trick. I'll test it shortly.

Most of what I've been learning about creating one's own custom types has been by the seat of my pants. I couldn't find any compilation of best-practices on the matters. Such things could address:

-using the pre_save()/post_save() functions

-using get_internal_type() to use an existing storage type mapping

-adapting render() to do any display-purposes formatting of the custom type

I'm sure there are other things that would be helpful on such a page, and there may be yet more things I learn would have been helpful as I muddle along.

So while it wasn't exactly what I was looking for, thanks for a nudge in what I hope is the right direction.

-tkc



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to