Re: Graphic and form in the same template
It can't be done like that. Look at any website and you'll see that never is the picture somehow "embedded" in the page, it's linked by an img tag that points at the url of the image. What he was saying is that you need two separate views. In the first, return your page with an img tag pointing at the other view that returns the img. On Oct 26, 5:16 pm, Waleria wrote: > I don't understand what you said. > > Thanks > > On 26 out, 12:19, Daniel Roseman wrote: > > > On Oct 26, 3:08 pm, Waleria wrote: > > > > I know that the execution of the function stops there, but i don't > > > know how do i resolve. I need to display the graphic generated and > > > just below the form. > > > > Can you help me, please? > > > > Thanks > > > Well as far as I can tell, the generated graphic doesn't depend on the > > request or the form at all. So why does it need to be created in the > > same view as the form? It seems like you just need your template to > > contain a normal HTML image tag, whose `src` attribute is a URL that > > points to the gera_grafico function (or a wrapped version that returns > > the FigureCanvas). > > -- > > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Graphic and form in the same template
I don't understand what you said. Thanks On 26 out, 12:19, Daniel Roseman wrote: > On Oct 26, 3:08 pm, Waleria wrote: > > > I know that the execution of the function stops there, but i don't > > know how do i resolve. I need to display the graphic generated and > > just below the form. > > > Can you help me, please? > > > Thanks > > Well as far as I can tell, the generated graphic doesn't depend on the > request or the form at all. So why does it need to be created in the > same view as the form? It seems like you just need your template to > contain a normal HTML image tag, whose `src` attribute is a URL that > points to the gera_grafico function (or a wrapped version that returns > the FigureCanvas). > -- > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Graphic and form in the same template
On Oct 26, 3:08 pm, Waleria wrote: > I know that the execution of the function stops there, but i don't > know how do i resolve. I need to display the graphic generated and > just below the form. > > Can you help me, please? > > Thanks Well as far as I can tell, the generated graphic doesn't depend on the request or the form at all. So why does it need to be created in the same view as the form? It seems like you just need your template to contain a normal HTML image tag, whose `src` attribute is a URL that points to the gera_grafico function (or a wrapped version that returns the FigureCanvas). -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Graphic and form in the same template
I know that the execution of the function stops there, but i don't know how do i resolve. I need to display the graphic generated and just below the form. Can you help me, please? Thanks On 26 out, 11:42, Daniel Roseman wrote: > On Oct 26, 2:17 pm, Waleria wrote: > > > Hi all, > > > I have this code:http://pastebin.com/Ra1G7twn > > > I need to display the graphic generated and just below the form, now > > the code only display the form. The image of graphic isn't displayed. > > > What could it be? > > > How do i resolve? > > > Thanks > > I don't understand what you are expecting to happen here. Line 22 is a > return statement, and so execution of the function stops there. > There's no way to get to the code in lines 29-34. > -- > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Graphic and form in the same template
On Oct 26, 2:17 pm, Waleria wrote: > Hi all, > > I have this code:http://pastebin.com/Ra1G7twn > > I need to display the graphic generated and just below the form, now > the code only display the form. The image of graphic isn't displayed. > > What could it be? > > How do i resolve? > > Thanks I don't understand what you are expecting to happen here. Line 22 is a return statement, and so execution of the function stops there. There's no way to get to the code in lines 29-34. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Graphic and form in the same template
Hi all, I have this code: http://pastebin.com/Ra1G7twn I need to display the graphic generated and just below the form, now the code only display the form. The image of graphic isn't displayed. What could it be? How do i resolve? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.