pyconca / 2013-web

a Django project for conference websites
https://2013.pycon.ca/
BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

Create a template auto-render view for our translated content pages #4

Closed eloraburns closed 11 years ago

eloraburns commented 11 years ago

According to @wolever:

# It's straight forward to make a route to do that kind of generic static rendering:
    url("sponsor/(.*)", views.some_function_to_lookup_and_render_the_template)

I suppose we might need something like that for each section ("sponsor", "speaker", "in the area", etc). Perhaps the lookup function can take some kwargs, more like:

    url("sponsor/(.*)", views.some_function_to_lookup_and_render_the_template, {
        {"template_directory": "sponsor/"}
    )
kayzhu commented 11 years ago

The tricky part with capturing all routes for some of these sections such as speaker and sponsor is that, it will override some of symposion's own routes, such as:

url(r"^$", direct_to_template, {"template": "sponsorship/list.html"}, name="sponsor_list"),
url(r"^apply/$", "sponsor_apply", name="sponsor_apply"),
url(r"^add/$", "sponsor_add", name="sponsor_add"),
url(r"^(?P<pk>\d+)/$", "sponsor_detail", name="sponsor_detail"),

for sponsorship. We are basically extending and overriding symposion's own routes at the same time.

eloraburns commented 11 years ago

Well, if we put our catch all route at the bottom, it shouldn't occlude the symposion routes. That would be exactly like the existing cms route, but with a static template backend instead of a db backend.

In this particular case, apply and add point to views that immediately return a 404 (I did that a week or so ago). I was trying to minimize diffs so we could continue to track upstream easily, but maybe that's not a useful goal.

taa /eof/

On 2013-04-10, at 5:41 AM, Kay Zhu notifications@github.com wrote:

The tricky part with capturing all routes for some of these sections such as speaker and sponsor is that, it will override some of symposion's own routes, such as:

url(r"^$", direct_to_template, {"template": "sponsorship/list.html"}, name="sponsor_list"), url(r"^apply/$", "sponsor_apply", name="sponsor_apply"), url(r"^add/$", "sponsor_add", name="sponsor_add"), url(r"^(?P\d+)/$", "sponsor_detail", name="sponsor_detail"), for sponsorship. We are basically extending and overriding symposion's own routes at the same time.

— Reply to this email directly or view it on GitHub.

eloraburns commented 11 years ago

Whatever it is we have in the code now works well enough; this ticket is closed. :)