~negronjl/python-jrapiclient/trunk

« back to all changes in this revision

Viewing changes to jrapiclient/common/base.py

  • Committer: Patrick Hetu
  • Date: 2012-06-15 20:00:28 UTC
  • Revision ID: patrick.hetu@gmail.com-20120615200028-y0j2sjb6ib7fjfko
add more api

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    (UUID) as a parameter when dealing with relationships.
32
32
    """
33
33
    try:
34
 
        return obj.id
 
34
        return obj.name
35
35
    except AttributeError:
36
36
        return obj
37
37
 
107
107
        if not hasattr(self.manager, 'get'):
108
108
            return
109
109
 
110
 
        new = self.manager.get(self.id)
 
110
        new = self.manager.get(self.name)
111
111
        if new:
112
112
            self._add_details(new._info)
113
113
 
114
114
    def __eq__(self, other):
115
115
        if not isinstance(other, self.__class__):
116
116
            return False
117
 
        if hasattr(self, 'id') and hasattr(other, 'id'):
118
 
            return self.id == other.id
 
117
        if hasattr(self, 'name') and hasattr(other, 'name'):
 
118
            return self.name == other.name
119
119
        return self._info == other._info
120
120
 
121
121
    def is_loaded(self):