These are chat archives for django/django

10th
Jan 2016
cs89gr
@cs89gr
Jan 10 2016 10:58

0
down vote
favorite
i want to create django project with two templates main list and details from the main list using genetic views List view and details views. the main list work but not work details list. this my code can somebody to help me ?

urls.py

urlpatterns = [
url(r'^$', ListView.as_view(
model = Test,
queryset = Test.objects.all(),
context_object_name = "test_list",
template_name='blog\test_list.html')),

url((r'^(?P<pk>\d+)-(?P<slug>[-\w]+)/$', DetailView.as_view(
context_object_name="test_list1",
model=Test,
template_name='blog\Test_details.html'
), name="test"),

]
html code test_list

{% for test in test_list %}

<h2> <a href="{{test.id}}">{{test.Title}}</a></h2>
{% endfor %}
html code test_details

<h2>{{ test.Title }}</h2>
.......................

Muhammad Taqi Hassan
@muhammadtaqi
Jan 10 2016 16:53
Need a Good Article/Tutorial for Working in Backbone.js in Django?
cs89gr
@cs89gr
Jan 10 2016 17:00
i find it
Muhammad Taqi Hassan
@muhammadtaqi
Jan 10 2016 17:01
What?
cs89gr
@cs89gr
Jan 10 2016 17:01
for my ask before
Muhammad Taqi Hassan
@muhammadtaqi
Jan 10 2016 17:02
Good, you are solving the issues yourself. that's a good habit and will help you alot.
cs89gr
@cs89gr
Jan 10 2016 19:13
yes i try for lern it