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+F
Fellipe Henrique P. Soares
"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)