Tuesday, February 1, 2011

Re: using return upper

Hello,
I try to simplify the problem.

This model gives me a (None) result:

class OperatingSystem (models.Model):
operatingsystem = CharField (max_length=30, blank=True, null=True)
def __unicode__(self):
return "%s" % (self.operatingsystem)
class Ordi(models.Model):
architecture = CharField (max_length=30, blank=True, null=True)
operatingsystemused = ManyToManyField(OperatingSystem, null=True,
blank=True)

def __unicode__(self):
oses_installed =
u','.join(self.operationsystemused_set.all().values('operatingsystem',flat=True))
return ("%s" % (oses_installed)).upper()

Or also the same with that last line:

return models.join(list(self.operatingsystemused))


What can I do??

thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment