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 'name' from since I deleted it.
I also looked around and saw that some other have had similar
problems, and it seemed to be a string definition problem. So I put
back 'name' and changed it to an IntegerField - same unhappy result.

Do you have any notion of what the problem is? The code looks right to
me.

Thanks,

Peter


On May 6, 1:33 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
> 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 myself lol - most people don't seem to even ever
> have looked at assembler these days. I used to love it - 7 years of
> that after university) Oh, and of course C was always the bomb too :-)
>
> Thanks again,
>
> Peter
>
> On May 6, 12:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > 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,
> > -Alen
>
> > On May 6, 5:43 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
>
> > > 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, and a
> > > fk to an Item object. The item object is the generic superclass. It
> > > could be a RadioType, a CheckBoxType, a VerbatimType, etc. These all
> > > have attributes specific to themselves.
>
> > > Anyway, I don't grok how to set up this type of relationship in my
> > > models.py file. Is there a standard way of doing this, or does anyone
> > > have an suggestions or can point me to some relevant info?
>
> > > e.g.     Pages - pointed to by fk in Items
> > >           ----------
>
> > >           Items - has key to one of the below
> > >           --------
>
> > > RadioBoxTypes   CheckboxTypes   VerbatimTypes   etc
> > > -----------------------   -----------------------
> > > ---------------------    ----
>
> > > Thanks very much. Sorry if this is a dumb question - always fun being
> > > a newbie :-(
>
> > > Peter
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to