lundi 21 avril 2014

python - vues peuvent dans django embeded dans l'autre ? -Débordement de pile


As title suggest.


I am wondering is there a method to render a TemplateResponse or HttpResponse with other SimpleTemplateResponses embedded?


Say we have two DetailViews, 1 and 2. I want to combine them together. Suppose DetaiView1 will generate an html like:


<p> This is detail1.</p>

DetaiView2 will generate like:


<p> This is detail2.</p>

Is there a way that I can generate view to return the html:


<html>
<p> This is detail1.</p>
<p> This is detail2.</p>
</html>

?



As title suggest.


I am wondering is there a method to render a TemplateResponse or HttpResponse with other SimpleTemplateResponses embedded?


Say we have two DetailViews, 1 and 2. I want to combine them together. Suppose DetaiView1 will generate an html like:


<p> This is detail1.</p>

DetaiView2 will generate like:


<p> This is detail2.</p>

Is there a way that I can generate view to return the html:


<html>
<p> This is detail1.</p>
<p> This is detail2.</p>
</html>

?


0 commentaires:

Enregistrer un commentaire