Message from discussion
Reverse error with news_archive_year in cmsplugin_news`
X-BeenThere: django-cms@googlegroups.com
Received: by 10.101.156.5 with SMTP id i5ls1484193ano.3.p; Sat, 30 Jan 2010
06:09:23 -0800 (PST)
Received: by 10.101.87.13 with SMTP id p13mr2017689anl.23.1264860563486;
Sat, 30 Jan 2010 06:09:23 -0800 (PST)
Received: by 10.101.87.13 with SMTP id p13mr2017683anl.23.1264860562944;
Sat, 30 Jan 2010 06:09:22 -0800 (PST)
Return-Path: <simon...@gmail.com>
Received: from mail-yx0-f146.google.com (mail-yx0-f146.google.com [209.85.210.146])
by gmr-mx.google.com with ESMTP id 11si372949gxk.13.2010.01.30.06.09.22;
Sat, 30 Jan 2010 06:09:22 -0800 (PST)
Received-SPF: pass (google.com: domain of simon...@gmail.com designates 209.85.210.146 as permitted sender) client-ip=209.85.210.146;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of simon...@gmail.com designates 209.85.210.146 as permitted sender) smtp.mail=simon...@gmail.com
Received: by yxe10 with SMTP id 10so6287404yxe.12
for <django-cms@googlegroups.com>; Sat, 30 Jan 2010 06:09:22 -0800 (PST)
MIME-Version: 1.0
Received: by 10.101.128.31 with SMTP id f31mr140075ann.53.1264860562884; Sat,
30 Jan 2010 06:09:22 -0800 (PST)
Date: Sat, 30 Jan 2010 06:09:22 -0800 (PST)
In-Reply-To: <972318.99518.qm@web63503.mail.re1.yahoo.com>
X-IP: 90.209.70.178
References: <972318.99518.qm@web63503.mail.re1.yahoo.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5,gzip(gfe),gzip(gfe)
Message-ID: <52c3565f-4f67-4489-accc-568300f1172c@l19g2000yqb.googlegroups.com>
Subject: Re: Reverse error with news_archive_year in cmsplugin_news`
From: simon <simon...@gmail.com>
To: django-cms <django-cms@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi
I was getting the reverse error when I updated django-cms, I made the
changes suggested above to include the language "en" hardcoded in as I
am only using english so it looks like this:
{% url "en":news_archive_month 'today'|getnextmonth:"y" 'today'|
getnextmonth:"m" %}
This gives me the error:
Caught an exception while rendering: u'en' is not a registered
namespace
I've included ulrichs patch and added CMS_LANGUAGE_CONF to my settings
so it looks like this:
CMS_LANGUAGE_CONF =3D {
'en':['en'],
}
I'm running this on windows vista although that shouldn't affect
anything.
Any suggestions anyone?
Thanks
Simon
On Jan 20, 5:49=A0am, fink <djsnick...@yahoo.com> wrote:
> thanks for your work. have you tried it with the example project?
>
> when using your patch with the example project:
> clicking a link in the language_chooser for 'en' while the page is publis=
hed in 'fr' gives the followingerror:
>
> django/core/urlresolvers.py", line 347, inreverseraise NoReverseMatch("%s=
is not a registered namespace" % key) NoReverseMatch: 'en' is not a regist=
ered namespace
>
> ---
>
> i also have had issues with the new language namespaces. the monkeypatch =
helps, and stops/swallows the throwing of exceptions, but 'fails' silently.
> for example, calling a model's get_absolute_url() when multilingual middl=
eware is enabled is broken:
>
> >>> Photo.objects.get(id=3D1).get_absolute_url()
> >>> ''
>
> which also broke all links in all templates, and anything else that relie=
s onreverse() or get_absolute_url().
>
> in case this helps anyone else: adding defining CMS_LANGUAGE_CONF in sett=
ings.py fixes this issue when the Request includes a language, i.e.: in tem=
plates.
>
> --- On Mon, 1/18/10, Ulrich Petri <u...@ulo.pe> wrote:
>
>
>
> > From: Ulrich Petri <u...@ulo.pe>
> > Subject: Re:Reverseerrorwith news_archive_year in cmsplugin_news`
> > To: "django-cms" <django-cms@googlegroups.com>
> > Date: Monday, January 18, 2010, 3:59 PM
> > Hi,
>
> > On Jan 8, 3:08 pm, Patrick Lauber <patrick.lau...@divio.ch>
> > wrote:
> > >reverse() gets now monkeypatched instead of
> > overwriting the url tag. This should make all apps
> > compatible
>
> > Unfortunately the monkeypatch still breaks anything that
> > relies on a
> > NoReverseMatch exception being raised (since it swallows
> > the exception
> > and simply returns "" in no-match situations).
> > For example:
>
> > >>> from django.shortcuts import redirect
> > >>> response =3D redirect("http://example.com/")
> > >>> response['location']
> > ""
>
> > This is Bad (TM) ;)
>
> > I've fixed the problem for my case here:
> >http://github.com/ulope/django-cms-2.0/commit/3da28d73fa0d94838fd2ef0...
>
> > The patch doesn't seem to adversely affect other parts of
> > django-cms
> > but I didn't test it very thoroughly.
>
> > Bye
> > Ulrich
> > --
> > You received this message because you are subscribed to the
> > Google Groups "django-cms" group.
> > To post to this group, send email to django-cms@googlegroups.com.
> > To unsubscribe from this group, send email to django-cms+unsubscribe@go=
oglegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/dja=
ngo-cms?hl=3Den.