On Sun, 2006-03-12 at 14:46 -0800, Glenn Tenney wrote: > I found that a subclass' _pre_save method superceeds it's parent's > and I have a situation where I need it to do something in addition > to what it's parent does. > > e.g. > > class One(model): > def _pre_save: ...something... > class Two(One): > def _pre_save: > ????? > Based on Python docs, I've tried... with no luck: > One._pre_save > one._pre_save > meta.Model.One._pre_save > Model.One._pre_save > > In a subclass' _pre_save method how do I invoke it's parent's > _pre_save method?
Not sure why some of these aren't working, but the "magic" that happens with modules in Django might have something to do with it. However, I believe super(Two, self).pre_save() should do what you are after. Cheers, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---