I would sugest that you look at named urls and the {% url %} template
tag. That way you can generate urls with the use of args for year,
month, date.

On 20 Feb., 21:30, JoeG <[email protected]> wrote:
> I've tried to find this on Google but I don't know the terminology so
> I don't know what to search for.  It's more of an html question than a
> Django one but since I'm trying to learn Django, I thought I'd give
> this group a try.
>
> I'm developing a fiscal calendar application.  The URL will 
> behttp://host/calendar_id/fiscal_year/fiscal_month/day
>
> The URL starts with just the year and appends the period and day as
> you drill into the calendar.  Here's and example to illustrate;
>
>    http://localhost:8000/calview/1/2009          - Show the 2009
> fiscal year for calendar 1
>    http://localhost:8000/calview/1/2009/02     - Show the second
> period for FY 2009, calendar 1
>    http://localhost:8000/calview/1/2009/02/20 - Show the 20th day of
> the second period for the above
>
> I'm having trouble figuring out how to do the href.  On the first page
> above that shows the entire year, When I try to add on the period with
> and href "<a href="02">02</a>", the url becomes "http://localhost:8000/
> calview/1/02" instead of "http://localhost:8000/calview/1/2009/02";.
>
> If I end the top URL with a slash, it works correctly but without that
> slash on the end, it replaces the year portion with the period instead
> of appending the period to the end.
>
> I realize that I could put in the full URL but that seems like it
> would be less flexible. I could also try and force the URL to always
> end in a slash but I'm not sure how to go about that.  Is there any
> way to build a relative URL that appends onto the end of the URL in
> the address bar without needing to have a backslash as the last
> character?
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to