开发者

How to access HttpRequest from urls.py in Django 1.2

开发者 https://www.devze.com 2023-04-01 02:56 出处:网络
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

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

精彩评论

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