| 71 | return "{0} ({1}:{2})".format(s.name, host, port) |
| 72 | |
| 73 | def get_object_msg(self): |
| 74 | msg = _("on database '{0}'").format(self.data['database']) |
| 75 | if 'primary_key' in self.data or 'unique_constraint' in self.data: |
| 76 | msg = _("on constraint '{0}/{1}/{2}/{3}'").format( |
| 77 | self.data['database'], self.data['schema'], self.data['table'], |
| 78 | self.data['primary_key'] if 'primary_key' in self.data else |
| 79 | self.data['unique_constraint']) |
| 80 | elif 'index' in self.data: |
| 81 | msg = _("on index '{0}/{1}/{2}/{3}'").format( |
| 82 | self.data['database'], self.data['schema'], |
| 83 | self.data['table'], self.data['index']) |
| 84 | elif 'table' in self.data: |
| 85 | msg = _("on table '{0}/{1}/{2}'").format( |
| 86 | self.data['database'], self.data['schema'], self.data['table']) |
| 87 | elif 'schema' in self.data: |
| 88 | msg = _("on schema '{0}/{1}'").format(self.data['database'], |
| 89 | self.data['schema']) |
| 90 | return msg |
| 91 | |
| 92 | @property |
| 93 | def message(self): |