示例#1
0
def alliance_links():
    return dict(alliance_links=alliance_links_list)


character_listing = dict(model=Character,
                         title="Characters",
                         url="/characters",
                         sorts=Character.getHumanReadableSortableProperties())
house_listing = dict(model=House,
                     title="Houses",
                     url="/houses",
                     sorts=House.getHumanReadableSortableProperties())
book_listing = dict(model=Book,
                    title="Books",
                    url="/books",
                    sorts=Book.getHumanReadableSortableProperties())
alliance_listing = dict(model=Alliance,
                        title="Alliances",
                        url="/alliances",
                        sorts=Alliance.getHumanReadableSortableProperties())


# Build a base "context" dictionary for passing to any given template
def create_context(nav_highlight=-1, **kwargs):
    # nav_highlight tells which navigation item to highlight
    # nocache provides a way to stop the browser from caching our scripts and css files
    # kwargs provides a way to add additional info to the context, per-page
    return dict(navigation=navigation,
                nav_highlight=nav_highlight,
                nocache=randint(1, 1000000),
                **kwargs)