Revision bb0c65c6 crm/robocrm/models.py

View differences:

crm/robocrm/models.py
9 9
  maint = models.BooleanField(default=False)
10 10
  dstart = models.DateTimeField()
11 11
  dend = models.DateTimeField()
12
  
13
  def __unicode__(self):
14
    return u'%s %s' % (self.type, self.id)
12 15

  
13 16
# User Model
14 17
class RoboUser(models.Model):
......
87 90
  shop_status = models.CharField(max_length=2,
88 91
                                  choices=STATUS_CHOICES,
89 92
                                  default=GOOD)
93
  def __unicode__(self):
94
    return self.user.username;
95

  
90 96
# needed for Django Auth model
91 97
def create_roboclub_user(sender, instance, created, **kwargs):
92 98
  if created:
......
105 111
  machine = models.ForeignKey('Machine')
106 112
  project = models.ForeignKey('Project')
107 113
  matuse = models.TextField()
114
  
115
  def __unicode__(self):
116
    return u'%s %s %s' (self.type, self.user.username, self.succ)
108 117

  
109 118
# Project Model
110 119
class Project(models.Model):
......
112 121
  primuser = models.ForeignKey('RoboUser', related_name='pri+')
113 122
  users = models.ManyToManyField('RoboUser', related_name='u+')
114 123
  charge = models.BooleanField(default=False)
124
  def __unicode__(self):
125
    return self.name
115 126

  
116 127
# Roboclub Resources Model
117 128
class RoboResource(models.Model):
......
122 133
  time_out = models.DateTimeField()
123 134
  time_due = models.DateTimeField()
124 135
  officer = models.ForeignKey('RoboUser', related_name='o+')
125

  
136
  def __unicode__(self):
137
    return u'%s %s %s' (self.type, self.id, self.checked_out)
126 138

  

Also available in: Unified diff