On 10/2/07, rhett <[EMAIL PROTECTED]> wrote:
>
> Total newbie here to Django and Python. Thanks for any insight.
>
> 1) I am working in TextMate and copied/pasted below code. In TextMate
> the "def __str__(self)" is not indented from the pub_date line - it's
> the same indent. I know indents are important - is there a way to set
> up TextMate to show correct indentation? Or should I use a different
> (Mac) editor? (I have to un-indent to not have a syntax error, but it
> seems like it should be indented and the code doesn't execute
> correctly).

In TextMate, View -> Show Invisibles.
Then, at the bottom of your document window, ensure "soft tabs" is
checked, and use 4 spaces.  In your document, replace any tabs with 4
spaces.

Whitespace is significant in Python.  Mixing tabs and spaces is a
cardinal sin.  I think TextMate is a fine editor for Python; you've
just gotten unlucky with your cut-and-paste.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to