Please provide the exact output you are seeing. It may be that the output
has been truncated, which is correct behavior.

For example, when I run this query on the command line for my model
Document,

>>> Document.objects.all()
<QuerySet [<Document: a new title 2>, <Document: adfadfasdf>, <Document:
gggggg>, <Document: the title>]>

I get a QuerySet with 4 entries, as there are 4 rows/records in the
Document table. All the fields are there, just not shown. The __str__
method in the Document model returns the title of the document, which is
what is shown above for each Document in the QuerySet. I am guessing but
your People table probably defines the __str__ method to return the first
and last name.

I can look at one of the returned rows like this:

>>> d=Document.objects.all()
>>> d[0]
<Document: a new title 2>
>>> d[0].document_id
2
>>> d[0].title
'a new title 2'
>>> d[0].description
'a new description 2'
>>> d[0].document_state
1
>>> d[0].storage_file_name
<FieldFile: c4b592c8-662c-437a-819e-c36df8867a9c.png>
>>>

title, document_id, description, and storage_file_name are all fields
defined in the model for Document (along with others).

Read the django documentation about models and queries for more information.

Mark

On Fri, May 11, 2018 at 9:34 PM, Joseph Mutumi <jjmut...@gmail.com> wrote:

> Hello,
>
> That's strange what does your people model look like? Notice it
> will only populate the fields you have defined in the model not
> the columns of the table in the database.
>
> Did you run migrations after adding new fields to the model?
> $ python manage.py migrate
>
> Kind regards
>
> On Sat, May 12, 2018 at 5:15 AM, Gerald Brown <gsbrow...@gmail.com> wrote:
>
>> Greetings:
>>
>> I have just started to use Django Queries and I am having some problems.
>>
>> When i use the query: "p = People.objects.all()" & then "p" it shows just
>> the lastname & firstname fields even though there are many more fields in
>> the table.
>>
>> I thought ALL means ALL, ALL fields & ALL records!!!
>>
>> Only 2 records so far in the DB and it shows both of them so ALL RECORDS
>> is working.
>>
>> Another table I have has a date field and a ForeignKey to the people
>> table plus some additional fields.  The query returns the date and the
>> firstname and lastname from the people table ONLY.
>>
>> It looks like it is only showing the first two fields in the table.
>>
>> Any ideas on how I can get it to show ALL fields?
>>
>> Thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAN5idp8%2B4gx6_MOoXT-JAsbq4nbZLAZj%
> 3DTL8MDMd%2Bg_oQwip2A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAN5idp8%2B4gx6_MOoXT-JAsbq4nbZLAZj%3DTL8MDMd%2Bg_oQwip2A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2N-WCBwQX9s2r3E2bRKDPMbd%2B1Hg2xFN7AoSxaVDQQu2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to