Need to model the relationship between servers, applications, and server role, in django admin.
If I have understood your requirement correctly, this is more like what you need
class ServerRole(models.Model):
name = models.CharField(max_length=200)
class Application(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self):
return self.name
class Server(models.Model):
name = models.CharField(max_length=200)
apps = models.ManyToMany('Application', through='ServerRole', related_name='servers')
Rational - A server can have many apps and an app can have many servers. if an app is on a particular server it should have only one role on it (if not your whole system because very much more complicated and harder to write) which can be implemented by the through model in a Many to Many relationship.