Monday, September 30, 2013

Django South - SyntaxError: invalid syntax (, line 1)

Hi.... 

I'm having trouble with the South.

In the model below:

class Carrier (models.Model):
     name = models.CharField (max_length = 40, blank = False, null = False, verbose_name = 'Name')
     user = models.ForeignKey (User, blank = True, null = True)
    
     def save (self, force_insert = False, force_update = False):
         self.nome self.nome.upper = ()
         super (Carrier, self). save (force_insert, force_update)
        
     def __ unicode__ (self):
         return u '% s'% (self.nome)

the error occurs when i run the migrate after South on the app.
SyntaxError: invalid syntax (<string>, line 1)

But if my model does not have the user field, then the error message does not occur, as shown below:

class Carrier (models.Model):
     name = models.CharField (max_length = 40, blank = False, null = False, verbose_name = 'Name')
    
     def save (self, force_insert = False, force_update = False):
         self.nome self.nome.upper = ()
         super (Carrier, self). save (force_insert, force_update)
        
     def __ unicode__ (self):
         return u '% s'% (self.nome)


I need the field User. What I have to do ?

Thanks a lot.

Ivan 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/45f2764c-c903-41c2-b692-2afb9f9332ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment