hello,
-- i have three pages(views,urls,templates) one with artist list with all posts one with artist details from the main list.
first and second pages work fine,but i have problem on the third page i want from the artists details to go the third
page and i take more details for the director where is a foreign key on the artist.
but not work and dont show me error if i click on the director then go me on the top from my artist details
if i written on my browser 127/...../dir/1 then go me on the third page but i cant go from the second page template tag..
that my code
my model
class artist(models.Model):
................
director = models.ForeignKey('Director')
..................
class Director(models.Model):
Name = models.CharField(max_length=100,blank=True)
..............................
my view
def view_dir(request, pk):
post = get_object_or_404(Director, pk=pk)
return render_to_response('blog/director_details.html', {
'post': post
})my urlsurl(r'^view/(?P<slug>[^\.]+)/$', views.view_post, name='view_post'), #artists detailsurl(r'^dir/(?P<pk>\d+)/$', views.view_dir, name='view_dir'),template tag in the artist details<p><a href="/dir/{{ director.id }}">{{post.director}}</a></p> #artists details
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c9bd9980-a2ab-4bea-9c28-a1fff2d1ca1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment