You could always do something like this in your layout.html:

{{if 'extra_css_files' in response:}}
  {{for file, media in response.extra_css_files:}}
    <link rel="stylesheet" type="text/css" href="{{=file}}" 
media="{{=media}}" />
  {{pass}}
{{pass}}

Then in your menu.py, you would want to put this in:

response.extra_css_files = {}

And anywhere you want to include your "print.css" or any other type of CSS 
media, you would simply do this:

response.extra_css_files[URL('static', 'css/print.css')] = 'print'

Hardcoding is the easiest method, but if you plan on dynamically loading CSS 
based on media, then this would probably be the way to go.

Reply via email to