I'm having a problem designing my data model. I'm sure there must be an
elementary solution but I can't find it.
Below i have two models. ProjectVersion and Project. It all kind of works,
however the admin "add" section for Project displays all rows for
ProjectVersion in that field, instead of all the versions for just that
Project. Is there a constraint or something i'm missing?
Many Thanks
Gerry
class ProjectVersion(models.Model):
name = models.CharField(maxlength=30)
released = models.NullBooleanField()
release_date = models.DateField(blank = True, null=True)
unnasigned = models.BooleanField()
project_for_version = models.ForeignKey("Project")
def __str__(self):
return self.name
class Admin:
pass
class Project(models.Model):
name = models.CharField(maxlength=30)
tag = models.CharField(maxlength=5)
project_lead = models.ForeignKey(UserProfile)
component = models.ForeignKey(ProjectComponent, blank=True, null=True)
version = models.ManyToManyField(ProjectVersion, blank=True, null=True)
def __str__(self):
return self.name
class Admin:
pass
--
http://belfast.no-ip.info/
Get http://www.ubuntu.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---