Make it possible to go from deployments to sites in the data model.
authorSapan Bhatia <gwsapan@gmail.com>
Fri, 13 Jun 2014 17:37:46 +0000 (13:37 -0400)
committerSapan Bhatia <gwsapan@gmail.com>
Fri, 13 Jun 2014 17:37:46 +0000 (13:37 -0400)
planetstack/core/models/site.py

index eea62fe..fe7fb93 100644 (file)
@@ -21,7 +21,7 @@ class Site(PlCoreBase):
     abbreviated_name = models.CharField(max_length=80)
 
     #deployments = models.ManyToManyField('Deployment', blank=True, related_name='sites')
     abbreviated_name = models.CharField(max_length=80)
 
     #deployments = models.ManyToManyField('Deployment', blank=True, related_name='sites')
-    deployments = models.ManyToManyField('Deployment', through='SiteDeployments', blank=True, help_text="Select which sites are allowed to host nodes in this deployment")
+    deployments = models.ManyToManyField('Deployment', through='SiteDeployments', blank=True, help_text="Select which sites are allowed to host nodes in this deployment", related_name='sites')
     tags = generic.GenericRelation(Tag)
 
     def __unicode__(self):  return u'%s' % (self.name)
     tags = generic.GenericRelation(Tag)
 
     def __unicode__(self):  return u'%s' % (self.name)