On Dec 23, 2007 1:50 PM, Rex Eastbourne <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Is there any solution to the below described problem? I still haven't
> been able to get it to work.
>
> Best,
> Rex
>

Somehow it seems you have gotten recent templates from SVN mixed in with
code from 0.96.  Details below.


> On Dec 20, 3:11 am, Rex Eastbourne <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I'm going through the Django tutorial for Django 0.9.6 on Windows
> > Vista. Everything is going smoothly, and I'm following the tutorial to
> > a T; except when I'm in my admin site (step 2 of the tutorial),
> > clicking any of the links (Groups/Users/Sites/Polls), I get a
> > TemplateSyntaxError, appended below. Any ideas on how to fix this? The
> > only thing I did outside of the tutorial instructions was to follow
> > the fix described here because of an apparent flaw with
> 0.96.:http://forums.devshed.com/showpost.php?p=1856484&postcount=2
> >
>

I'd guess following these instructions is how you somehow got current SVN
templates mixed in with 0.96 code.


>
> > Thanks!
> >
> > Rex
> >
> > ===============================
> > TemplateSyntaxError at /admin/polls/poll/
> > Invalid arguments to 'cycle': ['cycle', "'row1'", "'row2'"]
> > Request Method:         GET
> > Request URL:    http://127.0.0.1:8000/admin/polls/poll/
> > Exception Type:         TemplateSyntaxError
> > Exception Value:        Invalid arguments to 'cycle': ['cycle',
> "'row1'",
> > "'row2'"]
> > Exception Location:     C:\Python25\lib\site-packages\django\template
> > \defaulttags.py in cycle, line 434
> > Template error
> >
>

This error appears to be coming from 0.96 code, it matches this line:

http://code.djangoproject.com/browser/django/tags/releases/0.96/django/template/defaulttags.py#L434


> > In template C:\Python25\lib\site-packages\django\contrib\admin
> > \templates\admin/change_list_results.html, error at line 13
> > Invalid arguments to 'cycle': ['cycle', "'row1'", "'row2'"]
> > 3       <thead>
> > 4       <tr>
> > 5       {% for header in result_headers %}<th{{ header.class_attrib }}>
> > 6       {% if header.sortable %}<a href="{{ header.url }}">{% endif %}
> > 7       {{ header.text|capfirst }}
> > 8       {% if header.sortable %}</a>{% endif %}</th>{% endfor %}
> > 9       </tr>
> > 10      </thead>
> > 11      <tbody>
> > 12      {% for result in results %}
> > 13      <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}
>

But this is not what was in the 0.96 version of this template file.  Rather
it was:

<tr class="{% cycle row1,row2 %}">{% for item in result %}{{ item }}{%
endfor %}</tr>

(see
http://code.djangoproject.com/browser/django/tags/releases/0.96/django/contrib/admin/templates/admin/change_list_results.html#L13
)

What you have here seems to be the current SVN contents of this template:

http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templates/admin/change_list_results.html#L13

>From the revision history you can tell that changeset 6153 went in on
9/13/07 and substantially changed the way the cycle tag was processed.


> [snip the rest]
>

You need to get either all the proper 0.96 versions of the templates, or use
the code that goes with your post-0.96 version of the template files.

Karen

--~--~---------~--~----~------------~-------~--~----~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to