On 07/15/2011 02:14 PM, Suprnaturall wrote:
  def get_short_name():
                return name[0,20]

Try this:
def get_short_name(self):

    return self.name[0:20]



You need 'self' in two places, and I assume you want a string of the first 20 characters rather than a list of the first and 21st.


--
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.

Reply via email to