Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Dave Angel
Serdar Tumgoren wrote: Thanks to you both for the suggestions. I think I'll try the approach below. But just one follow-up: should I be setting "self.tablename", or is a static attribute ("tablename") the correct approach? A nice way to do this is with a class attribute. For example: class C

Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Serdar Tumgoren
> ..The atttribute is created in the class definition > (not in any method) as just "tablename". This creates an attribute of > the class, rather than of the instance. It is accessed as > "self.tablename". The attribute lookup rules will look first in the > instance, fail to find 'tablename', then

Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Kent Johnson
On Tue, Aug 18, 2009 at 3:16 PM, Serdar Tumgoren wrote: > On Tue, Aug 18, 2009 at 2:51 PM, Serdar Tumgoren wrote: >> Thanks to you both for the suggestions. I think I'll try the approach >> below. But just one follow-up: should I be setting "self.tablename", >> or is a static attribute ("tablename"

Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Serdar Tumgoren
On Tue, Aug 18, 2009 at 2:51 PM, Serdar Tumgoren wrote: > Thanks to you both for the suggestions. I think I'll try the approach > below. But just one follow-up: should I be setting "self.tablename", > or is a static attribute ("tablename") the correct approach? > Looks like it's the former (i.e. "s

Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Serdar Tumgoren
Thanks to you both for the suggestions. I think I'll try the approach below. But just one follow-up: should I be setting "self.tablename", or is a static attribute ("tablename") the correct approach? > A nice way to do this is with a class attribute. For example: > class Committee(object): > >   d

Re: [Tutor] yet another question on OO inheritance

2009-08-18 Thread Kent Johnson
On Tue, Aug 18, 2009 at 1:47 PM, Serdar Tumgoren wrote: > Hi all, > > I've hit another gray area for an application I'm working on. > Specifically, I have a campaign Committee object, and then subclasses > called CandidateCommittee and PresidentialCommittee. Depending on the > type of committee, I

[Tutor] yet another question on OO inheritance

2009-08-18 Thread Serdar Tumgoren
Hi all, I've hit another gray area for an application I'm working on. Specifically, I have a campaign Committee object, and then subclasses called CandidateCommittee and PresidentialCommittee. Depending on the type of committee, I have to execute a series of SQL statements to pull data (used to po