> > As I was developing the app, I realized that I was writing basically the > same code over and over and over, just with slight differences, e.g. the > table name, the criteria, the fields I wanted to return and their display > order... > so a couple of dictionaries to define (1) the tableviews criteria and (2) > ordered list of fields to return and the core becomes a small > parameterization of basically the same db query - 10s of lines of code. >
Sounds like something you could handle by abstracting everything into a special function and maybe using Python argument unpacking: db(db.table).select(*list_of_fields, **dictonary_of_named_arguments) Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.