@@ -161,12 +161,6 @@ def add_app_file(self, app_data):
161161 def add_table_file (self , table , fields ):
162162 table_ident = table ['singleRecordName' ]
163163 file_name = make_var_name (table_ident )
164- if len (self .table_ids ) and not any (
165- x in self .table_ids for x in [table_ident , file_name , table ['id' ]]
166- ):
167- # if table_ids have been specified, and this table's ID, single record name, or var name
168- # is not in the list, skip it
169- return
170164 if file_name in self .pkg_writer .modules :
171165 table_ident = table ['alias' ].replace ('_DBID_' , '' )
172166 file_name = make_var_name (table_ident )
@@ -196,8 +190,15 @@ def run(self):
196190 tables = api .get_tables_for_app (self .app_id )
197191 for table in tables .json ():
198192 table_id = table ['id' ]
199- fields = api .get_fields_for_table (table_id )
200- self .add_table_file (table , fields .json ())
193+ table_ident = table ['singleRecordName' ]
194+ table_var = make_var_name (table_ident )
195+ if not len (self .table_ids ) or any (
196+ x in self .table_ids for x in [table_var , table_ident , table_id ]
197+ ):
198+ # if not table_ids have been specified, or they have but this table's ID,
199+ # single record name, or var name are in the list, generate it
200+ fields = api .get_fields_for_table (table_id )
201+ self .add_table_file (table , fields .json ())
201202
202203 self .pkg_writer .write ()
203204 return True
0 commit comments