Exemplo n.º 1
0
def init(self, url, comp, *args):
    # We do exactly the same action than when a user clicks on the 'complete
    # list of pages' link, line #125
    #
    # As the ``select_a_page()`` is doing a `comp.call()` call, we need to wrap it
    # into a `continuation.Continuation()` context.
    continuation.Continuation(self.select_a_page, comp)
Exemplo n.º 2
0
def init(self, url, comp, *args):
    # The URL received is the name of the photo
    photo_data = PhotoData.get_by(title=url[0])
    if not photo_data:
        # A photo with this name doesn't exist
        raise presentation.HTTPNotFound()

    # Get the photo data and make a ``Photo`` component
    photo = component.Component(Photo(photo_data.id))

    # Temporary change the Gallery (the ``comp``) with the photo
    continuation.Continuation(comp.call, photo)
Exemplo n.º 3
0
def init(self, url, comp, *args):
    continuation.Continuation(self.select_a_page, comp)
Exemplo n.º 4
0
def render_function(f, renderer, comp, *args):
    continuation.Continuation(f, comp)
    return comp.render(renderer.parent)