def listOfTableField(self, method_list): ''' This method converts the JSON dictionary of SQL TABLE field properties into a list of model.TableFieldModel objects @param method_list: list of fields @type method_list: list @return: list ''' tableMethodList = [] for element in method_list: field = TableFieldModel() field.fieldName = element['field-name'] field.dataType = element['data-type'] field.length = element['length'] field.isPrimaryKey = element['is-primary-key'] field.autoIncrement = element['auto-increment'] field.isForeignKeyConstraint = element['is-foreign-key-constraint'] field.foreignKeyName = element['foreign-key-name'] field.foreignKeyTable = element['foreign-key-table'] tableMethodList.append(field) return tableMethodList
def listOfTableField(self, method_list=[]): ''' This method further decomposes the table fields into a list of model.TableFieldModel objects @param method_list: This is the list of fields from the model.TableModel.fieldsArray object @type method_list: list @return: list ''' tableMethodList = [] for element in method_list: field = TableFieldModel() field.fieldName = element['field-name'] field.dataType = element['data-type'] field.length = element['length'] field.isPrimaryKey = element['is-primary-key'] field.autoIncrement = element['auto-increment'] field.isForeignKeyConstraint = element['is-foreign-key-constraint'] field.foreignKeyName = element['foreign-key-name'] field.foreignKeyTable = element['foreign-key-table'] tableMethodList.append(field) return tableMethodList
def listOfTableField(self , method_list=[]): ''' This method further decomposes the table fields into a list of model.TableFieldModel objects @param method_list: This is the list of fields from the model.TableModel.fieldsArray object @type method_list: list @return: list ''' tableMethodList = [] for element in method_list: field = TableFieldModel() field.fieldName = element['field-name'] field.dataType = element['data-type'] field.length = element['length'] field.isPrimaryKey = element['is-primary-key'] field.autoIncrement = element['auto-increment'] field.isForeignKeyConstraint = element['is-foreign-key-constraint'] field.foreignKeyName = element['foreign-key-name'] field.foreignKeyTable = element['foreign-key-table'] tableMethodList.append(field) return tableMethodList