Hi Andre, I just post my current models, the first model it`s just example.
My real model is this: http://pastebin.com/w2TmyLzt as a posted in my last email. As I told, if I get the "first" FK value works.. in my real problem, link above, I try to get "Mercadoria" values, from my "ItensPedido" but, between "ItensPedido" I have "Produto" model. if I do what Tom suggested, works if I get something from "Produto" model, but, when I try to get from "Mercadoria" I don't get anything, like this: {% for itens in formsetItens.forms %} {{ itens.intance.idproduto.codigobarra }} <<- Works fine! {{ itens.intance.idproduto.idmercadoria.referencia }} <<--- Don't work! Unfortunately this database, is a legacy database, used by your ERP Delphi software, and table was made this way.. :( And, unfortunately, if I rename all my models and fields to english probably I will make one mistake, because of this I put in my native language, sorry about that. Cheers Em quinta-feira, 22 de agosto de 2013 15h31min56s UTC-3, Andre Terra (airstrike) escreveu: > > For the record, it's considered a good coding practice to keep everything > in English, including classes, functions and variables. This way it's > easier for people to help you. > > Secondly, your Filhos model should really just be Filho. > > Finally, don't use obscure names like Brinq. Instead, prefer the verbose > 'Brinquedo'. > > So I suggest renaming things like this: > > Pai -> Parent > Brinq -> Toy > Filhos -> Child > > and so forth. > > > Cheers, > AT > > > On Thu, Aug 22, 2013 at 1:38 PM, Mark Furbee <markf...@gmail.com<javascript:> > > wrote: > >> 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<javascript:> >> > 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 >>> >>> 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 <javascript:>. >>> To post to this group, send email to django...@googlegroups.com<javascript:> >>> . >>> 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...@googlegroups.com <javascript:>. >> To post to this group, send email to django...@googlegroups.com<javascript:> >> . >> 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.