Re: User.objects.all() only returns username

2020-07-03 Thread Тарас Лисак
Hello, you get this because in django by default implements __str__ method of User model, which returns only username of each user. If you want to have different behaviour, you should implement your one __str__ method in User model. пт, 3 лип. 2020 о 09:35 Mohsen Pahlevanzadeh пише: > When I

Re: User.objects.all() only returns username

2020-07-03 Thread Jatin Agrawal
When we do, User.objects.all(), it returns a queryset which will show you all the objects that are present in the database for the model. So, when you print that queryset, it just displays the username of the user. This is also because the def __str__ method of the User model must be returning

Re: User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh
By managed.py inspectdb auth_user : $ ./manage.py inspectdb auth_user; from django.db import models class AuthUser(models.Model): password = models.CharField(max_length=128) last_login = models.DateTimeField(blank=True, null=True) is_superuser = models.IntegerField() username =

Re: User.objects.all() only returns username

2020-07-03 Thread Hella Nick
send me your models.py and views.py RANGA BHARATH JINKA 于2020年7月3日 周五15:13写道: > Send me views.py > > On Fri, 3 Jul 2020, 12:36 pm Mohsen Pahlevanzadeh, < > m.pahlevanza...@gmail.com> wrote: > >> I don't have model.py for auth_user. >> >> On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA

Re: User.objects.all() only returns username

2020-07-03 Thread RANGA BHARATH JINKA
Send me views.py On Fri, 3 Jul 2020, 12:36 pm Mohsen Pahlevanzadeh, < m.pahlevanza...@gmail.com> wrote: > I don't have model.py for auth_user. > > On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA wrote: >> >> send me your models.py >> >> On Fri, Jul 3, 2020 at 12:06 PM Mohsen

Re: User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh
I don't have model.py for auth_user. On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA wrote: > > send me your models.py > > On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh > wrote: > >> When I use select * from auth_user; I get the following result: >>

Re: User.objects.all() only returns username

2020-07-03 Thread RANGA BHARATH JINKA
send me your models.py On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh < m.pahlevanza...@gmail.com> wrote: > When I use select * from auth_user; I get the following result: > > >

User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh
When I use select * from auth_user; I get the following result: