I guess my issue is that I only want to have to enter the project once. I don't want to create a Project and then have to create a StudentProject and link them via a foreign key. I'm having trouble visualizing how this would look/work in the admin. Ideally, I would have a select box that asked for the project type (student, professional, ect) and depending on which I chose, the appropriate extra fields would appear. I realize that his is not possible with a standard Django install, so I am trying to figure out the best alternative.
On Sep 3, 11:27 am, Stefan Rimaila <[EMAIL PROTECTED]> wrote: > I don't think you need to create this kind of > inheritance, but instead, you could create projects with ForeignKeys that > point to a certain project type. > > This would of course then require some additional tweaking or customising > on your models (such as the client, discipline, etc.), as Django, IIRC, > isn't yet capable of doing what you've described below. > > -- > Stefan Rimaila > "A few bolts loose and a set of switches broken" > Blog, personal portfolio & fun stuff:http://www.studionyami.com > > On Mon, 3 Sep 2007, Doug wrote: > > > I m creating new models for a portfolio application. I am creating a > > Project class and one of the fieldsof this class will be "type". There > > will be four types of Projects: Student, Professional, Competition, > > Personal. Each of these types will share most fields but some types > > will have addtional fields. At first I thought something like this > > would be best... > > > class Project(models.Model): > > name = models.CharField(max_length=250) > > slug = models.SlugField(prepopulate_from=('name',)) > > date = models.DateField() > > description = models.TextField(blank=True) > > disciplines = models.ManyToManyField(Discipline) > > type = models.ForeignKey(Type) > > publish = models.BooleanField("Publish?", default=False) > > images = models.ManytoManyField(imageBank.Image) > > lead_image = models.ForiegnKey(imageBank.Image) > > > class StudentProject(Project) > > critic = models.CharField(max_length=250) > > > class ProfessionalProject(Project) > > client = models.ForeignKey(Client) > > > etc, etc... > > > However, after looking through some of the posts on this site, it > > appears that this will not work yet in Django. As a new user of Django > > and Python, I was hoping to get some advice on what the alternative > > methods of handling this situation are. > > > Thanks for your help. > > > Doug --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---