开发者

How to access HttpRequest from urls.py in Django 1.2

I need to do the same thing asked in How to access HttpRequest from urls.py in Django but using version 1.2. Sorry, is what I have. I don't want to clutter the urls.py, so the two solutions given are not valid fo开发者_如何学Pythonr me :)

Thank you very much for your time.


from django.views.generic.list_detail import object_list

url('^URL_HERE/(?P<object_id>\d+)$', lambda request, *a, **k: object_detail(request, *a,
                       queryset=MyModel.objects.filter(user=request.user),
                       template="myapp/mytmplate.html", **k) )
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜