> does this post have anything to do with the subject of the previous post?

Yes, but I wasn't sure if the indentation would cause the problem
encountered by neridaj. In my screen I saw that neridaj had wrong
indent for the code about unicode line.

And thanks for the suggestion to try the code on IDE. Here's the
result:

>>> class SearchKeyword(models.Model):
            keyword = models.CharField(max_length=50)
            page = models.ForeignKey(FlatPage)
    def __unicode__(self):
        return self.keyword

  File "<pyshell#5>", line 4
    def __unicode__(self):
^
IndentationError: unindent does not match any outer indentation level

>>> class SearchKeyword(models.Model):
            keyword = models.CharField(max_length=50)
            page = models.ForeignKey(FlatPage)
            def __unicode__(self):
                return self.keyword


The ide gives an error when

def __unicode__(self):
        return self.keyword

has no indent as the op had.


On Nov 11, 11:09 pm, Kenneth Gonsalves <[email protected]> wrote:
> On Thursday 12 Nov 2009 9:36:11 am Zeynel wrote:
>
> > Sorry, I am a beginner but I noticed that in my models the indent of
> > unicode is indented like this:
>
> > class SearchKeyword(models.Model):
> >     keyword = models.CharField(max_length=50)
> >     page = models.ForeignKey(FlatPage)
> >     def __unicode__(self):
> >         return self.keyword
>
> > I have no idea if this will cause an error, though.
>
> does this post have anything to do with the subject of the previous post? if
> not, it is a good idea to start a new thread with a proper subject line. I do
> not see any error in indentation, but the best way to check is to press
> 'compile' on your ide and see if any errors show - indentation errors will
> show.
> --
> regards
> Kenneth Gonsalves
> Senior Project Officer
> NRC-FOSShttp://nrcfosshelpline.in/web/

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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=.


Reply via email to