Re: __unicode__ and return.self
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).
--
Jonathan D. Baker
Web Developer
http://jonathandbaker.com
303.257.4144
-- On Sat, Mar 24, 2012 at 10:10 PM, spike <pwashington85@gmail.com> wrote:
Running the tut here: 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.
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.
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home