--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@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/7e90ad4d-bffe-5690-2559-ec4655fc79b6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
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.
Thanks for your reply.
My model consists of the following:
id, first_name, last_name, middle_initial, contact_num, address,
town(FK to Town table), date_of_birth, occupation(FK to Occupation
table), email & gender. The Django query returns ONLY
first_name & last_name.
I run migrations after any changes to any models. The database
has the same fields that are shown.
BTW, the query is being run after running ./manage.py shell.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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.
I was getting the same as you are as I had just first_name & last_name set in the "def __str__(self)". I added a couple of more fields to that statement but they are still not showing up even after running a makemigration which says "No Change"
I tried "p.address" but it gave me an error message, (which I don't remember) as I did not know about the "[]"s. Now if I do "p.[0].address" it gives me the address. Also if I do "p[0].town" it show me the town name, which is in another table and is a FK to that table.
Like I said in my original message, I am just starting to use
Django Queries so there is a lot to learn so I thank you for your
assistance.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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.
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.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@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/c2eb898e-cf9a-ca70-b3d1-8d37e437fa7f%40gmail.com.