(table,keys="*",conddicts=None)
| 40 | return sql |
| 41 | |
| 42 | def gen_select(table,keys="*",conddicts=None): |
| 43 | if isinstance(keys, (tuple,list)): |
| 44 | keys=','.join(map(str,keys)) |
| 45 | sql = 'select %s '%keys |
| 46 | sql += ' from %s '%table |
| 47 | if conddicts: |
| 48 | sql += ' where %s '%Dict2Str(conddicts,'and') |
| 49 | #print sql |
| 50 | return sql |
| 51 | # Next , I will confirm , |
| 52 | # whether the datetime is valid |
| 53 | from datetime import datetime |