Wednesday, November 25, 2009

Re: View assistance

On Wed, Nov 25, 2009 at 9:43 AM, Jamie Pittock <jamie@erskinedesign.com> wrote:
> This is working as expected.  However, the view is checking that the
> project_slug is found, and also that the task_id is found, but it's
> not checking that the found task is related to the found project.

def task_detail(request, project_slug, task_id):
project = get_object_or_404(Project, slug=project_slug)
return object_detail(
request,
queryset=project.task_set,
object_id=task_id,
template_object_name="task",
extra_context = { 'project': project }
)


--
Javier

--

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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate