Title: [Python] is this stupid? Author: waterapple Pastebin link: http://pastebin.com/eiXV7JmM First Edit: Sunday 15th of February 2015 11:57:51 PM CDT Last Edit: Sunday 15th of February 2015 11:57:51 PM CDT def find_newest_version(story_id):     # Find highest in each table     tables_and_id_fields = {     "story_metadata":"id",     "chapter_metadata":"parent_story_id",     "chapter_texts":"parent_story_id",     "full_texts":"parent_story_id",     "story_categories":"parent_story_id",     }     for table_name in tables_and_id_fields:         id_field = tables_and_id_fields[table_name]         query = ("SELECT version FROM "+table_name+          "WHERE "+id_field+" == %s")         cursor.execute(query, (story_id))     # Return highest seen     return latest_version_number