Thanks..but I'm already overriding save, and creating an event record... I need to know how to do something extra when the data is loaded initially..... I know I could query the record again into a new object and use that for the original values..but that seems pretty hackish ...so I'd prefer to try and save off the original values into a dict when the record gets loaded...
On Aug 29, 1:21 pm, "Jure Čuhalev" <[EMAIL PROTECTED]> wrote: > 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-... > > 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---

