Hi Felipe
try autoField is auto increment.
try autoField is auto increment.
On Fri, Jan 25, 2013 at 4:53 AM, Fellipe Henrique <fellipeh@gmail.com> wrote:
I have this models:--class Pedido(models.Model):idvenda_pedido = models.IntegerField(verbose_name=u"Código", primary_key=True, null=False)num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True, null=True)class ItensPedido(models.Model):idvenda_pedido_itens = models.IntegerField(u'Código', primary_key=True, null=False, default=-1)idvenda_pedido = models.ForeignKey('Pedido', db_column='idvenda_pedido', null=False, blank=False)qnt = models.IntegerField(verbose_name=u'Quantidade', null=False, blank=False, default=1)When I save ItensPedido, the idvenda_pedido is null. How Can I pass the idvenda_pedido field? I try to pass the integer but django tell me it`s need a "pedido" not integer value.Thanks.T.·.F.·.A.·. S+FFellipe Henrique P. Soares"Quemadmodum gladius neminem occidit, occidentis telum est." (Epistulae morales ad Lucilium, Lucius Annaeus Seneca)"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."Albert Einstein (March 14th 1879 – April 18th 1955)
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
Anderson Dias Borges
Senior Analyst Developer
Tu cumprirás o desejo do meu coração se eu Te buscar...
I can't see but I'll take my chances
To hear You call my name
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment