You're only returning two fields from the __unicode__ method, not the model as a whole. All of the fields are available when importing the model. The __unicode__ method simply affects how a record from a model is displayed within particular areas such as the admin (but not regular template output).
On Sat, Mar 24, 2012 at 10:27 PM, spike <pwashingto...@gmail.com> wrote: > Thanks for the reply. > > Why am I only returning one or two fields from each model? If I define 5 > fields, shouldn't I return all 5? > > > On Saturday, March 24, 2012 9:19:51 PM UTC-7, jondbaker wrote: > >> The __unicode__ method allows models to return a more usable >> representation of a record instead of a unicode object. This is useful in a >> variety of places, from the Django admin to using the manage.py shell on >> the command line. >> >> The return statement effectively ends the execution of a particular >> function or method by returning something (an object, string, whatever you >> may need to return for the task at hand). >> >> On Sat, Mar 24, 2012 at 10:10 PM, spike <pwashingto...@gmail.com> wrote: >> >>> Running the tut here: >>> https://docs.djangoproject.com/en/1.1/intro/tutorial01/<https://docs.djangoproject.com/en/1.1/intro/tutorial01/> >>> but I'm having trouble understanding what the point of __unicode__ is. >>> Also, what is the point of the return statements? I've read the docs over >>> and over but don't get it. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/django-users/-/jKgyKR2iRdgJ<https://groups.google.com/d/msg/django-users/-/jKgyKR2iRdgJ> >>> . >>> 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<django-users%2bunsubscr...@googlegroups.com> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en> >>> . >>> >> >> >> >> -- >> Jonathan D. Baker >> Web Developer >> http://jonathandbaker.com >> 303.257.4144 >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/IFpUg5EEj7oJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jonathan D. Baker Web Developer http://jonathandbaker.com 303.257.4144 -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.