开发者

Django, Truncated incorrect DOUBLE value:

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)
    ret开发者_运维百科urn render_to_response('site/account/shared.html',
                              {'shared': shared},
                              context_instance=RequestContext(request))

Please any idea about it?

thanks , and sorry with my English.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜