Django year month day

33 views
Skip to first unread message

hito koto

unread,
May 13, 2014, 11:19:06 PM5/13/14
to django...@googlegroups.com
Hello, 

this time i have this the erroes: Please help me;

Exception Type: NoReverseMatch
Exception Value:
Reverse for 'article.views.month year month 'prev'' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []



this is my the urls.py;

url(r"^month/(?P<year>\d+)/(?P<month>\d+)/(prev|next)/$", "article.views.month"),
url(r"^month/(?P<year>\d+)/(?P<month>\d+)/$", "article.views.month"),
url(r"^month/$", "article.views.month"),

and this is my the template html:

<a href= "{% url "article.views.month year month 'prev'" %}">&lt;&lt; Prev</a>
<a href= "{% url "article.views.month year month 'next'" %}">Next &gt;&gt;</a>

<h4>{{ mname }} {{ year }}</h4>

<div class="month">
    <table>

    <tr>
        <td class="empty">Mon</td>
        <td class="empty">Tue</td>
        <td class="empty">Wed</td>
        <td class="empty">Thu</td>
        <td class="empty">Fri</td>
        <td class="empty">Sat</td>
        <td class="empty">Sun</td>
    </tr>

    {% for week in month_days %}
        <tr>
        {% for day, entries, current in week %}

            <!-- TD style: empty | day | current; onClick handler and highlight  -->
            <td class= {% if day == 0 %}"empty"{% endif %}
            {% if day != 0 and not current %}"day"{% endif %}
            {% if day != 0 and current %}"current"{% endif %}
            {% if day != 0 %}
                onClick="parent.location='{% url cal.views.day year month day %}'"
                onMouseOver="this.bgColor='#eeeeee';"
                onMouseOut="this.bgColor='white';"
            {% endif %} >

            <!-- Day number and entry snippets -->
            {% if day != 0 %}
                {{ day }}
                {% for entry in entries %}
                    <br />
                    <b>{{ entry.creator }}</b>: {{ entry.short|safe }}
                {% endfor %}
            {% endif %}
            </td>
        {% endfor %}
        </tr>
    {% endfor %}
    </table>

    <div class="clear"></div>
</div>

hito koto

unread,
May 13, 2014, 11:26:49 PM5/13/14
to django...@googlegroups.com
I'm also have the erroes

Exception Type: NoReverseMatch
Exception Value:
u'article.views.main year|add' is not a registered namespace



2014年5月14日水曜日 12時19分06秒 UTC+9 hito koto:

Mario Gudelj

unread,
May 14, 2014, 12:32:11 AM5/14/14
to django...@googlegroups.com
Try <a href= "{% url "article.views.month" year month 'prev' %}"> instead.


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/eb79a5c7-81b4-4ec7-8b61-16f3a62202f7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

hito koto

unread,
May 14, 2014, 1:32:04 AM5/14/14
to django...@googlegroups.com
Ok now working, thank you!





2014年5月14日水曜日 13時32分11秒 UTC+9 somecallitblues:
Reply all
Reply to author
Forward
0 new messages