template syntax error

2018-03-04 Thread harsh sharma
i created a model in which i have an image filed but when ever i am trying to get an uploaded image on the in my model.py image = models.ImageField(upload_to='static/pictures',) setting.py STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static", "./static"), '/va

Re: Template syntax issues w dict

2015-05-02 Thread Bernardo Brik
just a small correction – lose the parens after items: {% for org, num in attendees_per_org.items %} On Friday, May 1, 2015 at 4:48:25 AM UTC-3, ADEWALE ADISA wrote: > > If I can understand your code, of seems you want a table of : Institution > | Number of attendees > So if am right u can achive

Re: Template syntax issues w dict

2015-05-01 Thread Lachlan Musicman
.items Damn. Thanks On May 1, 2015 17:48, "ADEWALE ADISA" wrote: > If I can understand your code, of seems you want a table of : Institution > | Number of attendees > So if am right u can achive it this way : > > {% for org, num in attendees_per_org.items() %} > >

Re: Template syntax issues w dict

2015-05-01 Thread ADEWALE ADISA
If I can understand your code, of seems you want a table of : Institution | Number of attendees So if am right u can achive it this way : {% for org, num in attendees_per_org.items() %} {{ org }} {{ num }} {% endfor %} Since your dataset

Template syntax issues w dict

2015-05-01 Thread Lachlan Musicman
Hola, Django shell gives right results, template doesn't: code here http://dpaste.com/1NJEKD8 What am I doing wrong? L. -- 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

Re: Template Syntax Error

2013-09-25 Thread SHANTANU SRIVASTAVA
Thanks ! The urls.py can be viewed here : http://dpaste.com/hold/1394929/ On Tuesday, September 24, 2013 1:10:57 AM UTC+5:30, Alagappan Ramu wrote: > > Looks like the is an issue in Django being able to resolve URLs in your > application. Can you paste your urls.py for more info. > > > Regards,

Re: Template Syntax Error

2013-09-23 Thread Alagappan
Looks like the is an issue in Django being able to resolve URLs in your application. Can you paste your urls.py for more info. Regards, Alagappan R Twitter: @_alagappan Thanks & Regards, Alagappan Ramu +1 (716) 598 2730 Graduate Student in Computer Science

django-extra-views, NamedFormsetsMixin template syntax?

2013-07-21 Thread Lachlan Musicman
Hola, django-extra-views is a really good app for CBVs with FormSets (after I wasted hours on another solution). While reading the docs, I came across the NamedFormsetsMixin https://github.com/AndrewIngram/django-extra-views#other-bits-of-functionality which I thought looked nice, and implemente

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread donarb
Correction, the syntax has changed between 1.4 and 1.5. You are now required to quote the name in the url tag. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-user

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread donarb
Except, the Django documentation states that url names with dashes are acceptable and the examples show url tags using unquoted names. It even says you can use any character you want: *The string used for the URL name can contain any characters you like. You are not restricted to valid Python n

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Larry Martell
On Mon, Dec 3, 2012 at 7:31 AM, Loai Ghoraba wrote: > Hi > > I have this in my urls.py > > url(r'^accounts/login/$', login,name="accounts-login") > > and in a template base.html > login > > And when I try to open the site, this error is ra

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
okay I found it: it should be login with quotes. Thanks. On Mon, Dec 3, 2012 at 2:50 PM, Loai Ghoraba wrote: > not working, giving: Reverse for '' with arguments '()' and keyword > arguments '{}' not found. > > also I want to know about this dash (sorry for using the term score in the > previo

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
not working, giving: Reverse for '' with arguments '()' and keyword arguments '{}' not found. also I want to know about this dash (sorry for using the term score in the previous post ) thing On Mon, Dec 3, 2012 at 2:34 PM, Nikhil Verma wrote: > {% url auth_login %} -- You received this message

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Nikhil Verma
Try Sign in On Mon, Dec 3, 2012 at 6:01 PM, Loai Ghoraba wrote: > Hi > > I have this in my urls.py > > url(r'^accounts/login/$', login,name="accounts-login") > > and in a template base.html > login > > And when I try to open the site, th

Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
Hi I have this in my urls.py url(r'^accounts/login/$', login,name="accounts-login") and in a template base.html login And when I try to open the site, this error is raised: Template syntax error: Could not parse the remainder: '-login' from 'accounts-lo

Re: Vim Django template syntax checker

2012-11-27 Thread Tom Evans
On Mon, Nov 26, 2012 at 3:39 PM, Some Developer wrote: > I've been using Syntastic along with Vim for Django development for sometime > but I'd like to see if I could improve my Vim configuration. The problem > with Syntastic is that it does not work too well when checking partial HTML > documents

Vim Django template syntax checker

2012-11-26 Thread Some Developer
I've been using Syntastic along with Vim for Django development for sometime but I'd like to see if I could improve my Vim configuration. The problem with Syntastic is that it does not work too well when checking partial HTML documents (which is often the case with Django because of template in

Template syntax erro

2011-04-29 Thread Elton Pereira
When trying to upload or download files that contain non-ascii caracters raise a TemplateSyntaxError exception with the following contents: Django Version: 1.2.5 Exception Type: TemplateSyntaxError Exception Value: Caught UnicodeEncodeError while rendering: 'ascii' codec can't enc

Re: Problem with template syntax.

2011-03-22 Thread Malte Swart
On Tuesday, March 22, 2011 11:25:41 am dvdmchl wrote: > I'm getting error: Invalid block tag: 'endblock', expected 'endif' in > tempate: > > {% extends "base.html" %} > > {% block title %}{% endblock %} > > {% block header %} > Header > {% endblock %} > > {% block content

Re: Problem with template syntax.

2011-03-22 Thread Kenneth Gonsalves
On Tue, 2011-03-22 at 03:25 -0700, dvdmchl wrote: > {% endif% } {% endif %} -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Problem with template syntax.

2011-03-22 Thread dvdmchl
I'm getting error: Invalid block tag: 'endblock', expected 'endif' in tempate: {% extends "base.html" %} {% block title %}{% endblock %} {% block header %} Header {% endblock %} {% block content %} {% if wiwto_category_name|length > 1 %} {% for ca

Re: template syntax errors in production admin site (version problem?)

2010-09-30 Thread Karen Tracey
On Thu, Sep 30, 2010 at 12:39 PM, bobbymanuel wrote: > PROBLEM SOLVED: upgrade to Python 2.7 on server resolved issue. > Apparrently Django 1.2.3 is not fully compatible with Python 2.5 > I suspect it is your application code, not Django 1.2.3, that is not compatible with Python 2.5. The error y

Re: template syntax errors in production admin site (version problem?)

2010-09-30 Thread bobbymanuel
PROBLEM SOLVED: upgrade to Python 2.7 on server resolved issue. Apparrently Django 1.2.3 is not fully compatible with Python 2.5 On Sep 30, 11:28 am, bobbymanuel wrote: > interesting idea - but unfortunately, not it. > > i actually made a copy of admin.contrib.templates and fixed the syntax > th

Re: template syntax errors in production admin site (version problem?)

2010-09-30 Thread bobbymanuel
interesting idea - but unfortunately, not it. i actually made a copy of admin.contrib.templates and fixed the syntax that its complaining about, and it starts working. it doesn't like the following syntax : {% url name1 as name2 %} - found in 6 places in admin.contrib.templates it also doesn't l

Re: template syntax errors in production admin site (version problem?)

2010-09-30 Thread Steve Holden
On 9/30/2010 9:50 AM, bobbymanuel wrote: > Hi all - i've got a mysterious problem with my admin templates and I > think its a version problem but can't figure it out. > > The contrib.admin templates seem to be throwing some very crazy > TemplateSyntaxError(s) in many of the admin templates when i

template syntax errors in production admin site (version problem?)

2010-09-30 Thread bobbymanuel
Hi all - i've got a mysterious problem with my admin templates and I think its a version problem but can't figure it out. The contrib.admin templates seem to be throwing some very crazy TemplateSyntaxError(s) in many of the admin templates when i moved my app to my production environment. I'm thi

Re: Template syntax

2010-09-03 Thread Daniel Roseman
On Sep 3, 5:14 pm, Javier Guerra Giraldez wrote: > On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze > > wrote: > > -In my template I put {{ param1.0 }}, expecting to see the first list > > in the list of lists. > > Result: nothing was printed to the page. > > that zero becomes a string '0', not a

Re: Template syntax

2010-09-03 Thread Bradley Hintze
So is there a way to access/index lists within the template? On Fri, Sep 3, 2010 at 12:14 PM, Javier Guerra Giraldez wrote: > On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze > wrote: >> -In my template I put {{ param1.0 }}, expecting to see the first list >> in the list of lists. >> Result: noth

Re: Template syntax

2010-09-03 Thread Javier Guerra Giraldez
On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze wrote: > -In my template I put {{ param1.0 }}, expecting to see the first list > in the list of lists. > Result: nothing was printed to the page. that zero becomes a string '0', not a numeric 0. IOW, it's not param[0], it's (among other things) par

Re: Template syntax

2010-09-03 Thread Bradley Hintze
The dot does not work. As a test I did the following: -In my template I put {{ param1 }}, param1 is a list of lists. Result: param1, the lists of lists were printed to the page. -In my template I put {{ param1.0 }}, expecting to see the first list in the list of lists. Result: nothing was printed

Re: Template syntax

2010-09-02 Thread Bill Freeman
Don't use [] subscripting, use dot. The template engine tries using the thing after the dot in various ways, including as a dictionary key and as a list index. So, for example: {% ifequal param1_trunc.i "-" %} On Thu, Sep 2, 2010 at 5:11 PM, Bradley Hintze wrote: > Hi, > > Django says that t

Template syntax

2010-09-02 Thread Bradley Hintze
Hi, Django says that this is a TemplateSyntaxError. if param1_trunc[i][1] The i refers to an index of a for loop as shown: {% for i in pdb1_nums_len_dev6 %} {% ifequal param1_trunc[i] '-' %} {% else %} {% if param1_trunc[i][1] %} {% else %}

Re: Template Syntax Errors

2010-07-16 Thread Karen Tracey
On Fri, Jul 16, 2010 at 5:43 AM, Jx wrote: > 129. self._callback = get_callable(self._callback_str) > File "/usr/local/lib/python2.6/dist-packages/django/utils/ > functional.py" in wrapper > 124. result = func(*args) > File "/usr/local/lib/python2.6/dist-packages/django/core

Template Syntax Errors

2010-07-16 Thread Jx
Hi, i'm encountering some weird error in the template of my application. The error enountered was: Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) Fi

Re: Template Syntax Error: url config module not found

2009-11-09 Thread m3mitsuppe
x27;s > of course the interesting part where a photo portfolio is shown. > > When I click on that link, Django issues a Template Syntax Error > saying that the module "tina.urls" cannot be importet. That's kind of > strange, because it must have been imported this e

Template Syntax Error: url config module not found

2009-11-08 Thread m3mitsuppe
When I click on that link, Django issues a Template Syntax Error saying that the module "tina.urls" cannot be importet. That's kind of strange, because it must have been imported this exact module for rendering the home page and the other pages that do work. As this happens during temp

Re: template syntax

2009-08-19 Thread Daniel Roseman
On Aug 19, 8:55 am, elminio wrote: > You don't understand me. > WQhat I want to achieve is to use student.id as a key in dictionary > (Im talking abous template) > If I use: > > {% for student in students %} > > ... do sth ... > > {{dictionary.student.id }} > > {% endfor %} > > using dictionary

Re: template syntax

2009-08-19 Thread elminio
You don't understand me. WQhat I want to achieve is to use student.id as a key in dictionary (Im talking abous template) If I use: {% for student in students %} ... do sth ... {{dictionary.student.id }} {% endfor %} using dictionary.1 works using dictionary.student.id doesnt work because th

Re: template syntax

2009-08-18 Thread Margie
I would convert your dictionary to a list of tuples. IE, in your views.py code studentTuples = [(student, dictionary.student.id) for student in students] Now in your template, to print out lines containing: student name: student id you can do this: {% for studentTuple in studentTuples %} {

Re: template syntax

2009-08-18 Thread mettwoch
See this: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for There's an example of iterating over key, value pairs Marc On Aug 18, 5:48 pm, elminio wrote: > I iterate through all students and have distionary containing students > ids as key and for example grade as a value. I pa

Re: template syntax

2009-08-18 Thread elminio
sorry: I pass this dictionary to the TEMPLATE --~--~-~--~~~---~--~~ 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 unsubscribe from this group, se

Re: template syntax

2009-08-18 Thread elminio
I iterate through all students and have distionary containing students ids as key and for example grade as a value. I pass this dictionary to the view and then while iterating through all students I though that it would be simple to get appropriate value for current student. I dont know how I coul

Re: template syntax

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 11:16 AM, elminio wrote: > > Thanks for such a quick reply > > and what is i iterate through for example students > > {% for student in students %} > {{ dictionary.student.id }} > {% endfor %} > > I want to have student.id as a key and in the way I did it above it > doesn

Re: template syntax

2009-08-18 Thread elminio
Thanks for such a quick reply and what is i iterate through for example students {% for student in students %} {{ dictionary.student.id }} {% endfor %} I want to have student.id as a key and in the way I did it above it doesnt work because dicttionary wants student as a key :) thanks for hel

Re: template syntax

2009-08-18 Thread mettwoch
Use: {% name_of_your_dictionary.key_you_want_to_access %} Remember that templates use the '.' (dot) to access keys, attributes, indexes ... Kindly Yours Marc On Aug 18, 4:55 pm, elminio wrote: > Hi, > > Im passing to the template dictionary and I would like to get by key > to the value of tha

Re: template syntax

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 10:55 AM, elminio wrote: > > Hi, > > Im passing to the template dictionary and I would like to get by key > to the value of that dictionary and if the key doesnt exist in it > insert blank field into html > > thank You very much for help The template language is purpose

template syntax

2009-08-18 Thread elminio
Hi, Im passing to the template dictionary and I would like to get by key to the value of that dictionary and if the key doesnt exist in it insert blank field into html thank You very much for help --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Template syntax question

2008-10-30 Thread Robocop
I like the suggestions, Thanks! On Oct 28, 12:47 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Oct 27, 10:04 pm, Robocop <[EMAIL PROTECTED]> wrote: > > > So i'm looking to have an admin controlled news list, and one thing in > > particular i'd like them to be able to control is how many head

Re: Template syntax question

2008-10-28 Thread Daniel Roseman
On Oct 27, 10:04 pm, Robocop <[EMAIL PROTECTED]> wrote: > So i'm looking to have an admin controlled news list, and one thing in > particular i'd like them to be able to control is how many headlines > are shown on the front page, and my current code is not doing that. > > The line i care about is

Template syntax question

2008-10-27 Thread Robocop
So i'm looking to have an admin controlled news list, and one thing in particular i'd like them to be able to control is how many headlines are shown on the front page, and my current code is not doing that. The line i care about is: {% for New in news_list|slice:":{{limit}}"%} where li

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread laspal
t; next month and will be taking a hard look at both of them. > > Jinja (http://jinja.pocoo.org/) is, by design, very similar to > Django's template syntax. It compiles the templates to Python code for > speed. I particularly like its support for macros with arguments. > > T

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread Peter Rowell
n Power in your templates, you might consider using a different templating system. Note: I have not used either of these, but I am starting a new project next month and will be taking a hard look at both of them. Jinja (http://jinja.pocoo.org/) is, by design, very similar to Django's temp

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread laspal
Thanks a lot.. On Mar 27, 2:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Alternatively you can create a templatetag to accomplish this. > > On Mar 27, 3:14 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> > wrote: > > > On Thu, Mar 27, 2008 at 3:52 PM, django <[EMAIL PROTECTED]> wrote: >

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread [EMAIL PROTECTED]
Alternatively you can create a templatetag to accomplish this. On Mar 27, 3:14 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Thu, Mar 27, 2008 at 3:52 PM, django <[EMAIL PROTECTED]> wrote: > > > Hi, > > I want to use {[candidate.vote_set.filter(vote='TU').count()}} in my > > templa

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread Russell Keith-Magee
On Thu, Mar 27, 2008 at 3:52 PM, django <[EMAIL PROTECTED]> wrote: > > Hi, > I want to use {[candidate.vote_set.filter(vote='TU').count()}} in my > template but not able to do it. > > Its says Templatesyntaxerror... > I want to know how I can use the above exp in my template?? You can't. Dja

how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-26 Thread django
Hi, I want to use {[candidate.vote_set.filter(vote='TU').count()}} in my template but not able to do it. Its says Templatesyntaxerror... I want to know how I can use the above exp in my template?? Thanks.. --~--~-~--~~~---~--~~ You received this message because yo

Re: changed template syntax?

2007-03-10 Thread sean
Hi Malcolm, just tried the new revison and the problem is gone. Thanks a lot for the fast fix. Sean > I think this should be fixed now in [4693]. Turned out to be a simple > change, but finding the line to change took a few minutes. > > Please give it a run and feel free to point out any problem

Re: changed template syntax?

2007-03-09 Thread Malcolm Tredinnick
Hi Sean, On Fri, 2007-03-09 at 23:31 +1100, Malcolm Tredinnick wrote: > On Fri, 2007-03-09 at 04:14 -0800, sean wrote: > > I'm having a problem with changeset 4676, that breaks some of my > > forms. > > These are oldforms, since I haven't had the time to update the whole > > site to newforms. > >

Re: changed template syntax?

2007-03-09 Thread Malcolm Tredinnick
On Fri, 2007-03-09 at 04:36 -0800, sean wrote: > Thanks for the quick reply. I should really complete the move to > newforms ;-) Of course you should. :-) However, [4676] was meant to be transparent. The problem you've pointed out looks like it might be a pain. Breaking existing code is not cool,

Re: changed template syntax?

2007-03-09 Thread sean
Thanks for the quick reply. I should really complete the move to newforms ;-) On Mar 9, 1:31 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > If it stopped working in 4676, then it's a bug in that changeset. Not > much in the way of testing for oldforms, so that's why it wasn't caught. > > Sor

Re: changed template syntax?

2007-03-09 Thread Malcolm Tredinnick
On Fri, 2007-03-09 at 04:14 -0800, sean wrote: > I'm having a problem with changeset 4676, that breaks some of my > forms. > These are oldforms, since I haven't had the time to update the whole > site to newforms. > For a related inline editable field i used something like: > {{ form.modelname.0.f

changed template syntax?

2007-03-09 Thread sean
I'm having a problem with changeset 4676, that breaks some of my forms. These are oldforms, since I haven't had the time to update the whole site to newforms. For a related inline editable field i used something like: {{ form.modelname.0.fieldname }} but since changeset 4676 [1] this doesn't work

Re: Simple Template Syntax Question: ljust

2006-09-25 Thread Martin Glueck
> I've tried... > > {{product.title | ljust 40}} > > and other formats but can't get it to work... You can use the slice filter: {{product.title | slice:":40" }} or if you what the to truncate only at workbrakes, you can use the truncatewaords filter: {{product.title | truncate:"5" }} Marti

Re: Simple Template Syntax Question: ljust

2006-09-25 Thread Tim Shaffer
It should be {{ product.title|ljust:"40" }} --~--~-~--~~~---~--~~ 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 unsubscribe from this group, s

Simple Template Syntax Question: ljust

2006-09-25 Thread Tom Smith
Can someone show me how to get x number of chars from a variable in a template please... I've tried... {{product.title | ljust 40}} and other formats but can't get it to work... thanks --~--~-~--~~~---~--~~ You received this message because you are subs