Skip to content
Snippets Groups Projects
Commit ce47f00e authored by Tomáš Čejka's avatar Tomáš Čejka
Browse files

String representation of Django model objects

parent 52d2311a
Branches
No related tags found
No related merge requests found
......@@ -97,6 +97,8 @@ class MatchPort(models.Model):
port = models.CharField(max_length=24, unique=True)
def __unicode__(self):
return self.port
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'match_port'
......@@ -104,6 +106,8 @@ class MatchDscp(models.Model):
dscp = models.CharField(max_length=24)
def __unicode__(self):
return self.dscp
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'match_dscp'
......@@ -111,6 +115,8 @@ class MatchProtocol(models.Model):
protocol = models.CharField(max_length=24, unique=True)
def __unicode__(self):
return self.protocol
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'match_protocol'
......@@ -120,6 +126,9 @@ class FragmentType(models.Model):
def __unicode__(self):
return "%s" %(self.fragmenttype)
def __str__(self):
return self.__unicode__()
class ThenAction(models.Model):
action = models.CharField(max_length=60, choices=THEN_CHOICES, verbose_name="Action")
......@@ -129,6 +138,9 @@ class ThenAction(models.Model):
ret = "%s:%s" %(self.action, self.action_value)
return ret.rstrip(":")
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'then_action'
ordering = ['action', 'action_value']
......@@ -187,6 +199,9 @@ class Route(models.Model):
def __unicode__(self):
return self.name
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'route'
verbose_name = "Rule"
......
......@@ -28,6 +28,8 @@ class PeerRange(models.Model):
def __unicode__(self):
return self.network
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'peer_range'
......@@ -40,6 +42,8 @@ class TechcEmail(models.Model):
def __unicode__(self):
return self.email
def __str__(self):
return self.__unicode__()
class Meta:
db_table = "techc_email"
......@@ -58,6 +62,8 @@ class Peer(models.Model):
def __unicode__(self):
return self.peer_name
def __str__(self):
return self.__unicode__()
class Meta:
db_table = u'peer'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment