def todict(self): d = modeltodict(self) if self.user is not None: d['user'] = self.user.todict() if self.equipment is not None: d['equipment'] = self.equipment.todict() return d
def todict(self, notifications=False): d = modeltodict(self, exclude='password') if notifications: a = [] for item in self.notification_set.filter(unread=True): a.append({ 'id': item.id, 'content': item.content }) d['notifications'] = a return d
def todict(self): d = modeltodict(self) d['user'] = self.user.todict() d['equipment'] = self.equipment.todict() return d
def todict(self): d = modeltodict(self) d['user'] = self.user.todict() return d
def todict(self): d = modeltodict(self) d['provider'] = self.provider.todict() return d