On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> > def get_absolute_url(self):
> > return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug
> >
> > But it seems like there'd be a cleaner way (ie. not having to call
> >
On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> def get_absolute_url(self):
> return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug
>
> But it seems like there'd be a cleaner way (ie. not having to call 'replace')
def get_absolute_url(self):
return "/articles/%s/%s" %
Maybe it's too hot, and my mind isn't working straight, but I can't
figure out the best way to write my 'get_absolute_url' for objects
that will live in date based URLs, ie.
class Article(models.Model):
title = models.CharField(...)
slug = models.SlugField(...)
pub_date = models.DateF
3 matches
Mail list logo