Typo :) It should be `table_name = model._meta.db_table`