Is there anything wrong with doing this inside default.py controller?:

def search():
    def showsearch():
        search =
db(db.listing.title==request.args(0)).select(db.listing.ALL)
        items = []
        for person in search:
            items.append(DIV(A(person.first_name, _href=URL('listing',
args=person.id))))

        return TAG[''](*items)
    return dict(showsearch=showsearch())

That is, nesting functions inside functions, I'm not getting an error,
it's working as intended but is this a horrible practice to get into?
Is there an ideal way?

Reply via email to