> Is there an easy way to just drop the 'category_slug' the detail_view,
> or is it another/better way to do this?
I missed a 'in' there:" just drop the 'category_slug' in* the
detail_view "
Anyways, it seems like you got the idea.
Im trying to modify the view you wrote for me for the category view.
def detail_view(request, project_slug, category_slug = None):
queryset = Project.objects.filter(project_slug = project_slug ,
category__slug = category_slug)
context = {'project_slug': project_slug , 'category_slug':
category_slug}
return object_detail(request, queryset, extra_context =
context)
(Mind I don't have a clue what Im doing here, just trying things out,
that seems logic to me)
Then I get the error:
AttributeError at /portfolio/web/web_project/
Generic detail view must be called with either an object_id or a
slug/slug_field.
If I change the return object_detail to return object_list
I get this error:
TypeError at /portfolio/web/web_project/
Cannot resolve keyword 'project_slug' into field
I have this in the top of the view.py
from django.views.generic.list_detail import object_list
from django.views.generic.list_detail import object_detail
from myproject.portfolio.models import Project
from myproject.portfolio.models import Category
Is the view so wrong I think it is, or am I just importing the wrong
genric view?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---