(self, _name, *anons, **query)
Build an URL by filling the wildcards in a rule.
Build an URL by filling the wildcards in a rule.
Build an URL by filling the wildcards in a rule .
def build(self, _name, *anons, **query):
        ''' Build an URL by filling the wildcards in a rule. '''
        builder = self.builder.get(_name)
        if not builder: raise RouteBuildError("No route with that name.", _name)
        try:
            for i, value in enumerate(anons): query['anon%d'%i] = value
            url = ''.join([f(query.pop(n)) if n else f for (n,f) in builder])
            return url if not query else url+'?'+urlencode(query)
        except KeyError:
            raise RouteBuildError('Missing URL argument: %r' % _e().args[0])
def build ( self , _name , * anons , * * query ) : builder = self . builder . get ( _name ) if not builder : raise RouteBuildError ( "No route with that name." , _name ) try : for i , value in enumerate ( anons ) : query [ 'anon%d' % i ] = value url = '' . join ( [ f ( query . pop ( n ) ) if n else f for ( n , f ) in builder ] ) return url if not query else url + '?' + urlencode ( query ) except KeyError : raise RouteBuildError ( 'Missing URL argument: %r' % _e ( ) . args [ 0 ] )