Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Thanks for the info and pointers Karen, I really appreciate it. I got the feeling this might be a semi-scary way when searching the web for meta and python this afternoon, and didn't really find a lot. I did up screen prototypes for this app, and then designed a db model to accommodate it, and now

Re: Newbie Data Model Question

2008-05-06 Thread Karen Tracey
On Tue, May 6, 2008 at 3:01 PM, Peter Bailey <[EMAIL PROTECTED]> wrote: > > Hey Karen. I used manage.py validate. My model validated before I > added the abstract class and changed the class signatures. But I > probably did something silly. Here is a chunk of the code: > > # will use this for subc

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Hey Karen. I used manage.py validate. My model validated before I added the abstract class and changed the class signatures. But I probably did something silly. Here is a chunk of the code: # will use this for subclassing into our item subtypes class AbstractType(models.Model): name = models.

Re: Newbie Data Model Question

2008-05-06 Thread Karen Tracey
On Tue, May 6, 2008 at 2:25 PM, Peter Bailey <[EMAIL PROTECTED]> wrote: > > Hey alen. I have tried implementing this and it makes good sense as > far as I can see, but when I validate the model I always get an > AttributeError: 'NoneType' object has no attribute 'name'. > How are you validating t

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Hey alen. I have tried implementing this and it makes good sense as far as I can see, but when I validate the model I always get an AttributeError: 'NoneType' object has no attribute 'name'. I have tried removing name from the definition of the class - same message (not sure where it is getting '

Re: Newbie Data Model Question

2008-05-06 Thread Peter Bailey
Thanks very much for your solution and reply alen. I'm learning the ins and outs of python and django at the same time - fun adventure - so far python is blowing me away - I love it. Better than anything I have used before - 3 assemblers,c, c++ java, vb, ruby, php, asp, etc (guess I am dating myse

Re: Newbie Data Model Question

2008-05-06 Thread [EMAIL PROTECTED]
Define a 'abstract' attribute of Meta inner class and set it to true like so: class AbstractType(models.Model): name = models.CharField(max_length=100) class Meta: abstract = True class RadioBoxTypes(AbstractType): radio_lable = models.CharField(max_length=20) Regards, -Al

Newbie Data Model Question

2008-05-06 Thread Peter Bailey
I have designed a small db model (on paper) and want to implement it in my models.py file. So far, this has been pretty straight forward, but I have a generic superclass and several subclasses, and I am unsure how to implement this. My DB has page objects (webpages) with a few common attributes,