1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Add Instance.role property.

This commit is contained in:
Luke Sneeringer 2014-09-29 14:11:10 -05:00
parent 072ab2118f
commit 35c6c72f2e

View File

@ -16,3 +16,9 @@ class Instance(models.Model):
class Meta:
app_label = 'main'
@property
def role(self):
"""Return the role of this instance, as a string."""
if self.primary:
return 'primary'
return 'secondary'