What is the best way to format Django urls for two parameters, either of which are optional?

Posted by Parker on Stack Overflow See other posts from Stack Overflow or by Parker
Published on 2010-04-05T03:03:10Z Indexed on 2010/04/05 3:13 UTC
Read the original article Hit count: 279

Filed under:

I'm designing a gallery application for viewing vehicle pictures and there are two parameters:

  1. Manufacturer
  2. Vehicle type

Right now you can view either, but not both. Urls go like so:

  1. /manufacturer/#
  2. /type/#

Where # is an ID number. How/can I format my URLs so it can accept both? My current solution is to do: /both/#/# but this requires some retooling since the application doesn't know when you want to filter by both. Any insight would be appreciated.

© Stack Overflow or respective owner

What is the best way to format Django urls for two parameters, either of which are optional?

Posted by Parker on Stack Overflow See other posts from Stack Overflow or by Parker
Published on 2010-04-05T02:42:25Z Indexed on 2010/04/05 2:43 UTC
Read the original article Hit count: 279

Filed under:

I'm designing a gallery application and

© Stack Overflow or respective owner

Related posts about django