On 8/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Since there isn't a load() method on a model... I'm thinking I somehow > have to do this on the manager..but not sure ... any tips would be > great. > > When I load a record, either via get() or by looping through the > results of a .filter(), I'd like to keep track of the original > attribute values via setting a custom property on that model which > would contain a dict of the attribute/value at the time the record was > loaded ... > > This is basically so that when I save, I can compare the current > values with those of the original to see which values have changed, > and which haven't, which I need to know for some event logs I'm > writing out at save time. > > Thanks for any info. >
You could hook yourself to pre_save: http://www.djangoproject.com/documentation/db-api/#what-happens-when-you-save kr, jure --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---