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 -~----------~----~----~----~------~----~------~--~---