I have done some more reading of other tutorials, and Im slowly getting
further. I now understand that I can use django generic views instead
of writing my own view. (sorry Malcolm, I diden't get that before). I
have now made one url pattern for my project listing. It's listing all
of my project, regardless of the category their in, just the way I
want.

But I don't understand it good enough to write more url patterns. I
don't know how to write a pattern for listing projects inside a
spesific category. And I don't know how to make a pattern for the
detail page.

For my portfolio/models.py I use this code : http://phpfi.com/133790


I use this pattern now for listing all my projects:

info_dict = { 'queryset': Project.objects.all(), }

urlpatterns = patterns('',

        (r'^portfolio/$', 'django.views.generic.list_detail.object_list',
dict(info_dict, template_name="portfolio/projects_list.html")),
)

I have tried adding this line:

(r'^portfolio/(?P<category_slug>[-\w]+)/$',
'django.views.generic.date_based.object_detail', dict(info_dict,
slug_field='slug',
template_name="portfolio/category_spesific_list.html")),

But I get the error" object_detail() got an unexpected keyword argument
'category_slug' " when I try mydomain.com/portfolio/3d

Im not shure how that would line would work for only listing project in
the given category anyway.

I have made a static dummy site so you can see what I want. In django
Im able to do like the frontpage here, but the rest I can't do.

http://tomasjacobsen.com/django-dummy/

I hope someone can help me further!

Regars Tomas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to