view queryset object in admin view

2015-04-12 Thread makayabou
# Je voudrais, dans ma vue admin, avoir un affichage clair des maintenances # effectuées, qui corresponde à __unicode__ définie dans Ordi # mais j'ai : In admin view, I would like to get a clear list of results, as defined in __unicode__ from class User. Instead, I get: > I just need Jean Duboi

Re: view queryset object in admin view

2015-04-12 Thread makayabou
Hello, Sorry for the previous send unattended... I have problems trying to print values of a QUerySet Object in Admin View. In admin view, I would like to get a clear list of results, > as defined in __unicode__ from class User. > Instead, I get: > > > > > I just need Jean Dubois.. > > Here's th

Re: view queryset object in admin view

2015-04-12 Thread Avraham Serour
Well, your class User doesn't have an attribute name you are using on the method __unicode__, you should define and set the attribute name with something like a textfield On Apr 13, 2015 3:21 AM, "makayabou" wrote: > Hello, > > Sorry for the previous send unattended... > > I have problems trying

Re: view queryset object in admin view

2015-04-13 Thread makayabou
Hello, thanks for reply, of course attribute name was defined, I just ommited to past it! Here's code: [code] #In models.py: class PC(models.Model): def users(self): pc = self.user_set.all() for o in pc: return o.__unicode__ def __unicode__(self): ret

Re: view queryset object in admin view

2015-04-13 Thread Jani Tiainen
Hi, there are several flaws in your code. On Mon, 13 Apr 2015 04:12:55 -0700 (PDT) makayabou wrote: > Hello, > thanks for reply, > of course attribute name was defined, I just ommited to past it! > > Here's code: > > [code] > #In models.py: > > > class PC(models.Model): > def users(self

Re: view queryset object in admin view

2015-04-13 Thread makayabou
I made a clearer and full sample code. When I use the code as is, I get results in a poor readable format in PCAdmin view [, ] although I just want Jean Dubois, martin franck Thanks for help My models.py [code] from django.db import models class PC(mode

Re: view queryset object in admin view

2015-04-13 Thread makayabou
Thank you Jani, it solved it! I was just loosing around, I finally got it... thanks all On Monday, April 13, 2015 at 2:29:36 PM UTC+2, makayabou wrote: > > I made a clearer and full sample code. > When I use the code as is, I get results in a poor readable > format in PCAdmin view > [, ] >