That was a typo. The error I'm getting is
"ForeignKey cannot define a relation with abstract class Word"
It is a ManyToMany through table, that's the reason it is ForeignKey

Luke

On Nov 15, 8:29 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sat, 2008-11-15 at 06:57 -0800, Luke Seelenbinder wrote:
> > Basically, I want to allow a ManyToManyField to use any of a Model's
> > children, like this:
>
> > class Word(models.Model):
> >     word = models.CharField(...)
>
> >     class Meta:
> >           abstract = True
>
> > class Noun(Word):
> >    gender = models.CharField(...)
> > class Verb(Word):
> >    irregular = models.BooleanField(...)
>
> > #Here is where I need the help
> > def WordStats(models.Model):
>
> This isn't valid Python. It looks like a cross between defining a
> function and defining a class.
>
> >    word = models.ManyToManyField(Word)
>
> This isn't valid. Model field belong in models, not functions. I suspect
> you've just made a typo and typed "def" above when you meant "class". If
> you've actually mentioned what the error you were seeing was (or read it
> carefully), I suspect that Python would have told you basically that.
>
> >    stats = ...
>
> > Is there anyway to accomplish this? Without writing separate models
> > for each word.
>
> A many-to-many field to the Word model is an appropriate approach.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
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