You're right Jonathan, that was it. Don't know why I left it there in
the first place (no reason to match one or more char's for the slash
`/?$` anyway).
I hadn't noticed it since I was using the get_absolute_url in the
templates.
Thanks.
On Mar 31, 2:51 pm, "Jonathan Buchanan" <[EMAIL PROTECT
On Mon, Mar 31, 2008 at 12:35 PM, Panos Laganakos
<[EMAIL PROTECTED]> wrote:
>
> I've switched my code from:
> def get_absolute_url(self):
> return '/store/products/%s' % self.slug
>
> to:
> @models.permalink
> def get_absolute_url(self):
>
I've switched my code from:
def get_absolute_url(self):
return '/store/products/%s' % self.slug
to:
@models.permalink
def get_absolute_url(self):
return ('django.views.generic.list_detail.object_detail', (), {
'slug':
On Fri, 2007-12-21 at 01:56 -0800, Julian wrote:
> hi,
>
> i have a name url pattern:
>
> url( r'^login/', 'login', {'template_name': "config/templates/
> login.html"},name="config-login"),
>
> this works perfectly in the template for
>
> {% url config_login %}
>
> but wouldn't it hurt the d
hi,
i have a name url pattern:
url( r'^login/', 'login', {'template_name': "config/templates/
login.html"},name="config-login"),
this works perfectly in the template for
{% url config_login %}
but wouldn't it hurt the dry principle to write the login-url in the
settings.py? right, so i want t
On 16 Lip, 11:51, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> Although you give the traceback, you don't say what exception is raised.
> So it's hard to guess.
>
> A first step to debug this would be to try it at the interactive prompt
> ("manage.py shell") and see what happens when you call
>
On Mon, 2007-07-16 at 09:41 +, Robert wrote:
> Hello,
>
> I would like to use the permalink decorator for get_absolute_url
> method.
>
> Here's the code:
>
> There's a 'Post' model with 'created' -> models.DateTimeField()
> fi
Hello,
I would like to use the permalink decorator for get_absolute_url
method.
Here's the code:
There's a 'Post' model with 'created' -> models.DateTimeField()
field.. (and others)
@models.permalink
get_absolute_url(sefl):
return (post_
> I *think* that so long as you don't have multiple URLs pointing at the
> same generic view you'll be OK, but otherwise there could be issues --
> we're working on it.
Thanks for the reply. This is exactly the problem. I want to use
object_detail and object_list for multiple URLs, so I'll be int
On 3/12/07, dchandek <[EMAIL PROTECTED]> wrote:
> Am I missing something?
It's not that 'permalink' doesn't work with generic views -- it can.
As I understand it, the problem is a URLConf like this:
urlpatterns = patterns('django.views.generic.list_detail',
(r'^foo/(?P\d+)/$', 'object_detail
I posted previously about how it seemed to me that, while the
permalink decorator is useful in decoupling the get_absolute_url()
methods of an application's models from the site/project, it more or
less forces you to create dummy custom views where you would normally
simply use generic
On Thu, 2007-03-08 at 08:57 -0800, dchandek wrote:
> I was happy to find the addition of the permalink decorator in the
> development version as a help in removing hardcoded paths from
> get_absolute_url() methods.
>
> Unfortunately, using it requires that you define a custom view
> Any suggestion as to how we could differentiate amongst them?
>
> At thepermalinkdecoratorfinds the first match given the view and the
> parameters. If there are multiple matches, we have to make a choice
> somehow, right?
Sadly, I don't have a suggestion. My point was merely that, while
permal
I was happy to find the addition of the permalink decorator in the
development version as a help in removing hardcoded paths from
get_absolute_url() methods.
Unfortunately, using it requires that you define a custom view (even
if the custom view simply returns a generic view). Interestingly, you
> I have a feeling somebody pointed this out in a ticket just recently,
> too. We're treating something as a sequence when we shouldn't
> necessarily be. I'll track it down this evening and either fix the docs
> or the code.
>
> As an intermediate fix, pass in [str(self.id)] or (str(self.id),) and
On Sun, 2007-02-25 at 20:55 +0100, Lawrence Oluyede wrote:
> I tried to use the new permalink decorator to decouple the model from
> the urlconf structure but it doesn't work correctly. Here's an
> example:
>
> def get_absolute_url(self):
> return "/
I tried to use the new permalink decorator to decouple the model from
the urlconf structure but it doesn't work correctly. Here's an
example:
def get_absolute_url(self):
return "/foo/%d" % self.id
changed to:
def get_absolute_url(self):
return ('
17 matches
Mail list logo