OK it is finally working after a lot of strange errors! 3 hours spent on
this crap! Can you really trust the built in server that it always update
your code?

Also It should be so much easier to follow this tutorial if all the code
from each tutorial was posted at the end of the tutorial. It is possible
somehow to pass that message to someone in charge for the tutorials?  For me
this thing with Indentation Errors is totally new.

Thanks Karen for your help.

2009/1/2 Karen Tracey <kmtra...@gmail.com>

> On Fri, Jan 2, 2009 at 9:35 AM, johan <johan.post...@gmail.com> wrote:
>
>> I'm still struggling with the tutorial. Now I have the code snippet from:
>> http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02
>>
>> def was_published_today(self):
>> return self.pub_date.date() == datetime.date.today()
>> was_published_today.short_description = 'Published today?'
>>
>>
>>
>> I can't figure out what to do with this code.
>> I'm I supposed to swop this code with the
>>
>> def was_published_today(self):
>>     return self.pub_date.date() == datetime.date.today()
>>
>> in models.py?
>>
>> No mater what I do I get errors?
>>
>
> The first code block you list is not identical to what is in the tutorial:
> you have introduced a difference in indentation there, on the return line.
> In the tutorial this line is indented, as it was when the method was first
> introduced.  If you restore the indentation to what the tutorial actually
> lists you can see that the originally-added code for the was_published_today
> method is identical to what's shown in the 2nd part of the tutorial.  The
> only difference in the snippets is the addition of the line for setting
> short_description, which goes along with the sentence from the tutorial "But
> you can change that by giving that method a short_description attribute:"
>
> So all the tutorial is trying to illustrate is that you can add that new
> line and control what is displayed in the column header.  The existing
> method definition is repeated simply to illustrate where to put the new line
> -- if the tutorial wanted you to change code it had previously mentioned it
> would have said so explicitly in the tutorial text.
>
> Karen
>
>
> >
>

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