I have two controllers which differ only a database table title. For
example:

default/persons/index
    persons = db(db.person).select()
    return dict(persons=persons)


default/trips/index
    trips = db(db.trip).select()
    return dict(trips=trips)

How implement DRY conception in this case? I think I need create an
additional class and pass a table name to this class. All work must to
be done in this class and a result should return to the corresponding
method. But it only my opinion. How to do it right?

Reply via email to