Re: Template variables not showing up in web-page

2015-10-24 Thread CTA2052
Thank you for the very speedy reply. I really apprceciate that. Actually I had tried the page/file name in place of the path as well and it still would not work. What it turned out to be is, on the back end of a reboot (because I took a break to up the memory on my macbook pro,) I rebooted and

Re: Template variables not showing up in web-page

2015-10-23 Thread Dheerendra Rathor
signature for request is render(request, template_name, context, **kwargs) So it should be like render(request, 'response_page.html', context=context) On Sat, 24 Oct 2015 at 01:21 CTA2052 wrote: > Hello All, > > This may be the most basic question to ask and believe me it does not come > withou

Re: Template variables in translation blocks

2013-08-26 Thread Some Developer
On 24/08/13 14:56, Ariel Calzada wrote: you have to append strings first http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates and then call trans 2013/8/24 Some Developer mailto:someukdevelo...@gmail.com>> I have a title and a header block which norm

Re: Template variables in translation blocks

2013-08-24 Thread Some Developer
On 24/08/13 14:56, Ariel Calzada wrote: you have to append strings first http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates and then call trans 2013/8/24 Some Developer mailto:someukdevelo...@gmail.com>> I have a title and a header block which norm

Re: Template variables in translation blocks

2013-08-24 Thread Ariel Calzada
you have to append strings first http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates and then call trans 2013/8/24 Some Developer > I have a title and a header block which normally contain static text but > for some pages I need to display some dynamic i

Re: Template variables and tags confusion... (regarding concatenation)

2009-11-21 Thread chefsmart
Exactly. Thanks. On Nov 21, 4:45 pm, Tim Chase wrote: > > When I do in a template I get > id="item_1"> in the rendered html as expected. > > > Now I want to do {% cycle '' ' > class="odd" id="item_{{ product.id }}">' %}, but the desired > > concatenation does not happen. > > > How do I achieve

Re: Template variables and tags confusion... (regarding concatenation)

2009-11-21 Thread Tim Chase
> When I do in a template I get id="item_1"> in the rendered html as expected. > > Now I want to do {% cycle '' ' class="odd" id="item_{{ product.id }}">' %}, but the desired > concatenation does not happen. > > How do I achieve what I want? sounds like you want something like -tim

Re: Template Variables as Indexes

2009-04-24 Thread Doug B
Might not be the easiest way, but you could use a custom filter: def formsbyfield(forms,field): """ Given a list of similar forms, and a field name, return a list of formfields, one from each form. """ return [form.fields.get(field,'') for form in forms] register.filter('forms

Re: template variables

2007-10-26 Thread fisher
On Oct 13, 8:09 am, Goon <[EMAIL PROTECTED]> wrote: > can you use variables in django's templates? > > so like {% for x in y %} > > and then something like > > {% int x =3; x++ %} Recently I found some handy django snippet which can be usefull for you. http://www.djangosnippets.org/snippets/9/

Re: template variables

2007-10-13 Thread SmileyChris
On Oct 13, 8:35 pm, "Nikola Stjelja" <[EMAIL PROTECTED]> wrote: > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} > > What's the problem. You just send the template 'y':range(1,6). It's very > simple. I don't think the template syste

Re: template variables

2007-10-13 Thread Jeff Forcier
On Oct 13, 3:41 am, Goon <[EMAIL PROTECTED]> wrote: > Ok, but let's say I have a template like {{for x in y}}, and I would > like the x's seperated by commas, but I don't want a comma after the > last one? or better yet cut off after the first 100 characters with a > "..." The key here is that

Re: template variables

2007-10-13 Thread Nikola Stjelja
On 10/13/07, beck917 <[EMAIL PROTECTED]> wrote: > > Maybe use the custom template filters is a nice way~ > > http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters > Yep. The point is: less programming in html, the better. That's the reason most experienced p

Re: template variables

2007-10-13 Thread beck917
Maybe use the custom template filters is a nice way~ http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters 2007/10/13, Nikola Stjelja <[EMAIL PROTECTED]>: > > > > On 10/13/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > > > > On 10/13/07, Goon <[EMAIL PR

Re: template variables

2007-10-13 Thread Goon
On Oct 13, 3:26 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} > > Perhaps the documentation will make you happy: Ok, but let's say I have a template like {{for x in y}}, and I

Re: template variables

2007-10-13 Thread Nikola Stjelja
On 10/13/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} What's the problem. You just send the template 'y':range(1,6). It's very simple. I don't think the template system should be

Re: template variables

2007-10-13 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} Perhaps the documentation will make you happy: http://www.djangoproject.com/documentation/templates/#slice -- "Bureaucrat Conrad, you are technically correct -- the best kind of corre

Re: template variables

2007-10-13 Thread Goon
fair enough, I'm not happy that I can't get {{for x in y[1:5]}} dammit! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To un

Re: template variables

2007-10-12 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > can you use variables in django's templates? Yes. > and then something like > {% int x =3; x++ %} No. Django's template language is not Python or any other programming language. Its sole purpose is presentational logic. -- "Bureaucrat Conrad,

Re: template variables

2007-10-12 Thread Ramdas S
Simple answer is no. But you can may be try porting mako to to django On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > > > can you use variables in django's templates? > > so like {% for x in y %} > > and then something like > > {% int x =3; x++ %} > > or something like that, would be mighty helpful

Re: Template variables

2006-06-20 Thread Wilson Miner
Hi Patrick, You might find some helpful responses in this thread: http://groups.google.com/group/django-users/browse_frm/thread/50ee1c147854769/a79890af3059229d?q=menu&rnum=3#a79890af3059229d On 6/20/06, Patrick <[EMAIL PROTECTED]> wrote: > > Hi i'm newbie and i want to publish my Django websit

Re: template variables and looping with attributes

2006-01-22 Thread akaihola
You could define a filter "lookup": from django.core.template import resolve_variable, Library register = Library() def lookup(value, arg): return resolve_variable(arg, value) register.filter(lookup) and use it in your code like this: {%for r in object_list %} {%for c in field_lis