views:

167

answers:

1

Hi guys, i have this error:

Truncated incorrect DOUBLE value: 'asinox'

this error come from my SEO url:

http://127.0.0.1:8000/user/asinox/2010/dec/30/1/este-pantalon-lo-compre-en-plaza-lama-una-aperidad/

"asinox" is the username (usuario), and routing the URL in this way:

(r'^(?P<usuario>[-\w]+)/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<pk>\d+)/(?P<slug>[-\w]+)/$', shared),

i dont know why the error, but here is my view:

def shared(request,usuario,year, month,day, pk, slug):
    import datetime, time
    date_stamp= time.strptime(year+month+day, "%Y%b%d")
    pub_date = datetime.date(*date_stamp[:3])
    shared = get_object_or_404(Show,usuario=usuario,
                               pub_date__year=pub_date.year,
                               pub_date__month=pub_date.month,
                               pub_date__day=pub_date.day,
                               pk=pk,
                               slug=slug)
    return render_to_response('site/account/shared.html',
                              {'shared': shared},
                              context_instance=RequestContext(request))

Please any idea about it?

thanks , and sorry with my English.

+1  A: 

That regex doesn't match the URL at all. Your URL starts with a literal string 'user', which isn't in the regex; and the regex is also expecting an integer PK value, which the URL doesn't have.

Daniel Roseman
my guess would be some kind of include from another url.py and the 1 is the pk.
Brandon H
This answer looks right. It's taking the literal "user" to be your username and then "asinox" is being passed to... actually asinox shouldn't be passed into year, because year only accepts digits. This doesn't look like it should match at all.
Mark