Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
A few corrections... > 2. I'm not sure weather multiple inheritance will be a feasible > solution in Python (because the code that is going to introspect the > Thing super class and add its fields to our class is model.Model, which > is one of the suer classes). It is actually feasible, I just c

Re: Model inheritance API

2006-07-26 Thread Ahmad Alhashemi
Malcolm Tredinnick wrote: > --- > 1. Abstract Base class > --- > One use-case for subclassing is to use the base class as a place to > store common fields and functionality. It is purely a "factor out the > common stuff" holder and you don't ever intend to u

Re: Model inheritance API

2006-07-24 Thread David Blewett
Jacob Kaplan-Moss wrote: > On Jul 22, 2006, at 9:37 PM, Malcolm Tredinnick wrote: > > Rather than watch the "inherit from User" thread go round and round, > > maybe I should give people something more concrete to think about. First of all, +1 on this proposal. I've been approaching this problem f

Re: Model inheritance API

2006-07-24 Thread Gábor Farkas
Bill de hÓra wrote: > Malcolm Tredinnick wrote: > >> table design with >> lots of sparse columns won't get me invited to the cool parties. > > Qotd! > (added to my quotes-collection :-) gabor --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Model inheritance API

2006-07-24 Thread Bill de hÓra
Malcolm Tredinnick wrote: > table design with > lots of sparse columns won't get me invited to the cool parties. Qotd! [I should say what you're doing sounds great; just trying to figure out where the constraints and gotchas are at.] cheers Bill --~--~-~--~~~---~

Re: Model inheritance API

2006-07-24 Thread DavidA
Malcolm Tredinnick wrote: > On Sun, 2006-07-23 at 17:12 +0100, Bill de hÓra wrote: > > Malcolm Tredinnick wrote: > > > --- > > > 3. What you don't get > > > --- > > > [...] > > > I am not implementing the "everything in one table" storage model. It is > >

Re: Model inheritance API

2006-07-24 Thread Nebojsa Djordjevic
Malcolm Tredinnick wrote: > Rather than watch the "inherit from User" thread go round and round, > maybe I should give people something more concrete to think about. > > This is a follow-up to the mail I sent late on Friday. It describes the > area where we need API additions or some kind of semi

Re: Model inheritance API

2006-07-23 Thread Russell Keith-Magee
On 7/24/06, Bryan <[EMAIL PROTECTED]> wrote: Russell Keith-Magee wrote:> 2) A decorator:When did python support class decorators?You know... one of these days, I'm going to learn to have coffee before I touch a keyboard :-) You are correct - the @ syntax doesn't work for classes. However, that does

Re: Model inheritance API

2006-07-23 Thread Bryan
+1 This is great, Malcom, and a step forward to my comments/goals/rants in the other thread. Russell Keith-Magee wrote: > 2) A decorator: > > @models.Abstract > class Thing(models.Model): >... > When did python support class decorators? Jacob Kaplan-Moss wrote: > ... I like seeing that a m

Re: Model inheritance API

2006-07-23 Thread Russell Keith-Magee
First off: +1 and then some from me - this is some great stuff, Malcolm. On 7/24/06, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote:On Sun, 2006-07-23 at 11:31 -0500, Jacob Kaplan-Moss wrote: > On Jul 22, 2006, at 9:37 PM, Malcolm Tredinnick wrote:[...]>> > (1) What notation to use to declare a clas

Re: Model inheritance API

2006-07-23 Thread Malcolm Tredinnick
On Sun, 2006-07-23 at 11:31 -0500, Jacob Kaplan-Moss wrote: > On Jul 22, 2006, at 9:37 PM, Malcolm Tredinnick wrote: [...] > > > (1) What notation to use to declare a class as abstract? I've > > thrown out > > Meta.is_abstract -- any preference for alternatives? > > Bill de hÓra suggests ``mod

Re: Model inheritance API

2006-07-23 Thread Malcolm Tredinnick
On Sun, 2006-07-23 at 17:12 +0100, Bill de hÓra wrote: > Malcolm Tredinnick wrote: > > > --- > > 1. Abstract Base class > > --- > > [...] > >For example, > > > > class Thing(models.Model): > >name = models.CharField(...) > > >

Re: Model inheritance API

2006-07-23 Thread Jacob Kaplan-Moss
On Jul 22, 2006, at 9:37 PM, Malcolm Tredinnick wrote: > Rather than watch the "inherit from User" thread go round and round, > maybe I should give people something more concrete to think about. W00t -- I'm about +1,000 on your proposal; it's well-thought-out, clean, and seems to hit all the ri

Re: Model inheritance API

2006-07-23 Thread Bill de hÓra
Malcolm Tredinnick wrote: > --- > 1. Abstract Base class > --- > [...] >For example, > > class Thing(models.Model): >name = models.CharField(...) > > class Animal(Thing): >genus = models.CharField(...) >

Re: Model inheritance API

2006-07-23 Thread Malcolm Tredinnick
On Sun, 2006-07-23 at 13:02 +0400, Ivan Sagalaev wrote: > First of all: Malcolm, this looks damn cool and very well thought out! > Thank you! Thanks. > > Malcolm Tredinnick wrote: > > --- > > 2. "Pythonic" Inheritance > > > > ... > > > > (i

Re: Model inheritance API

2006-07-23 Thread Ivan Sagalaev
First of all: Malcolm, this looks damn cool and very well thought out! Thank you! Malcolm Tredinnick wrote: > --- > 2. "Pythonic" Inheritance > > ... > > (in the above classes, Animal > would have a foreign key reference to the Thing table, s

Model inheritance API

2006-07-22 Thread Malcolm Tredinnick
Rather than watch the "inherit from User" thread go round and round, maybe I should give people something more concrete to think about. This is a follow-up to the mail I sent late on Friday. It describes the area where we need API additions or some kind of semi-major change to incorporate model i