Hi,
I'm not sure I completely understand what you need but if I do,  I think
passing different contexts to the same template would help you achieve
that.

You could easily have something like :

def initial_view(request) :
       variableone = 'a'
       variabletwo = 'b'
       return response(yourtemplate, {'a':variableone, 'b' :variabletwo})

Then you can also have another view using the same template but with
different contexts.
Something like,

def final_view(request) :
       variableone = 'c'
       variabletwo = 'd'
       return response(yourtemplate, {'c':variableone, 'd' :variabletwo})

Also,  if you have a repetitive section in your template, you could just
write it once and use the {% include %} tag to use it in each of your other
templates.

I hope that helps.

Lekan.
Python is the "most powerful language you can still read".

On 2 Nov 2016 19:48, "Moreplavec" <stanislav.va...@gmail.com> wrote:

Greetings,

i'm creating template for simple table report. Data shown are for current
month. Than i realised i need same report for previous month. I can copy
created template and modify texts, but i don't like. Is it possible to use
same template for more views and only controll differences based on view,
which is template calling? For example, i need to show "Current month" or
"Previous month". I can put these texts into variable, but i hope there is
better way to controll directly in template.

Please, can you help me or point me to some good article? Thanks!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/a61a7a9d-06a2-4749-bf71-f6d2351396af%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/a61a7a9d-06a2-4749-bf71-f6d2351396af%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE6v7occppraFDC50RENzJ-tO3mBipDThG%2B8AkfTAU2PkVGGHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to