Jul-03-2018, 10:12 AM
I have a table set up like so:
The columns test_temperature, test_humidity and test_pressure will always display the default value, not what is on the csv; and the columns minimum_value, maximum_value and recorded_ value will not display the default value, even if the cell is left empty on the csv. ( but do display filled in values.)
If anyone knows of a fix or can explain to me where i have gone wrong would be greatly appreciated.
class test_result(db.Model): ''' Create main_database table ''' __tablename__ = 'test_result' date_time = db.Column(db.DATETIME, primary_key=True) part_number = db.Column(db.String(30), nullable=False) serial_number = db.Column(db.String(30), nullable=False) result = db.Column(db.String(10), nullable=False) minimum_value = db.Column(db.String(10), nullable=False, default='N/A') maximum_value = db.Column(db.String(10), nullable=False, default='N/A') recorded_value = db.Column(db.String(10), nullable=False, default='N/A') test_equipment_set = db.Column(db.String(20), nullable=False, default='N/A') test_temperature = db.Column(db.String(15), nullable=False, default='N/A') test_humidity = db.Column(db.String(15), nullable=False, default='N/A') test_pressure = db.Column(db.String(15),nullable=False, default='Wohoo') addtional = db.Column(db.String(60),nullable=False, default='N/A') def __repr__(self): return '<test_result: {}>'.format(self.name)When i upload a CSV file to this table i get a weird 'bug?' occurring, or i have made a mistake somewhere, i believe i have narrowed it down to the table setup.
The columns test_temperature, test_humidity and test_pressure will always display the default value, not what is on the csv; and the columns minimum_value, maximum_value and recorded_ value will not display the default value, even if the cell is left empty on the csv. ( but do display filled in values.)
If anyone knows of a fix or can explain to me where i have gone wrong would be greatly appreciated.