I don't want to use a ForeignKey. I want to be able to set up a class
in the model and not have a table created. Maybe the base model thing
is the way to do it. I've read somewhere about mixins, could these be
of interest?

On Feb 10, 4:37 pm, "Collin Grady" <[EMAIL PROTECTED]> wrote:
> Subclassing doesn't work right yet, you need to use a ForeignKey or
> similar to the base model in order to relate them - if you do it the
> way you're trying it will break things randomly.
>
> On Feb 10, 12:25 pm, "Zach Seifts" <[EMAIL PROTECTED]> wrote:
>
> > I have been working on a project where I need to create a few classes
> > in the model that are very similar. What I want to do is subclass a
> > model but have it not set up a database table. I know there are ways
> > of doing this I just haven't figured out yet.
>
> > Here's an example of what I am trying to do
>
> > class Foo(models.Model)
> >     """ This class does not have a db table """
> >     name = models.CharField(maxlength=100)
>
> > class Bar(Foo)
> >     """ This class has a db table """
> >     eyeColor = models.CharField(maxlength=100)
>
> > Thanks for you help.


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