Are you sure the idmercadoria is not None on that idproduto record?

{{ form.instance.idproduto.**idmercadoria }} Does this display anything?
How about {{ form.instance.idproduto }}?

If these don't display, verify the records in your database. In Django
templates, if something is None or does not exist, it will not raise an
exception, it just ignores it and remains blank. Also verify the referencia
field is not empty. If the field is 'NOT NULL' then it will be an empty
string if it is blank.



On Thu, Aug 22, 2013 at 12:58 PM, Fellipe Henrique <felli...@gmail.com>wrote:

> No, nothing displayed..
>
> Em quinta-feira, 22 de agosto de 2013 13h38min04s UTC-3, Mark escreveu:
>>
>> Try dropping the .value from referencia. Like {{ form.instance.idproduto.
>> **idmercadoria.referencia }}. Does this work?
>>
>>
>> On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique <fell...@gmail.com>wrote:
>>
>>> I tried again.. and work if I have just 1 FK, if I have more then one,
>>> doesn't work, like this:
>>>
>>> I have this models:
>>> Itens -> produto -> mercadoria
>>>
>>> itens:
>>>   idproduto = FK (produto)
>>> produto:
>>>   idmercadoria = FK(mercadoria)
>>> mercadoria:
>>>   referencia = Char
>>>
>>> I try to get "referencia" field, as you told:
>>>
>>> {{ form.instance.idproduto.**idmercadoria.referencia.value }}
>>>
>>> doesn't work.. what I miss?
>>>
>>> Here is my complete models, forms and view: http://pastebin.com/**
>>> w2TmyLzt <http://pastebin.com/w2TmyLzt>
>>>
>>>  Cheers,
>>>
>>>
>>> Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe
>>> Henrique escreveu:
>>>
>>>> Ok, I read that, but the problem persist.. I try to use as you told,
>>>> but nothing show... and no errors appears..
>>>>
>>>> Sorry about my first line.. I just stop here, simple problem, in more
>>>> then 1 day, and I don't find any solution, anything on internet to...
>>>>
>>>> Cheers
>>>> Fellipe
>>>>
>>>>
>>>>>  --
>>> 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...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to