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

2013-10-01 Thread Chris
Ivan,

Did this code paste correctly? There is a syntax error in the save method:

 def save (self, force_insert = False, force_update = False):
 self.nome self.nome.upper = () <--- SYNTAX ERROR
 super (Carrier, self). save (force_insert, force_update)

Is that supposed to be:
self.name = self.name.upper()

?

On Monday, September 30, 2013 9:52:09 AM UTC-5, Ivan Goncalves wrote:
>
> 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 (, 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+unsubscr...@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/251f724e-55fe-47b6-8436-8ab6aa966b0e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-10-01 Thread Leonardo Giordani
Can you use the models.py file with the user field on a bare DB?
I mean: if you start from scratch with an empty DB everything works
correctly? You can create Carriers from the Django shell?


Leonardo Giordani
Author of The Digital Cat 
My profile on About.me  - My GitHub
page- My Coderwall
profile 


2013/9/30 Ivan Goncalves 

> 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 (, 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+unsubscr...@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.
>

-- 
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+unsubscr...@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/CAEhE%2BOmH060TDzmVw%2BOgEdzMKsh1jJPnpn%3DeiZ0rkae7MJPCxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-09-30 Thread Ivan Goncalves
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 (, 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+unsubscr...@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.