Answer the question
In order to leave comments, you need to log in
How to set arguments for data types fields in models.py?
There is Flask+SQLAlchemy+MtSQL
How to set arguments for MySQL Data Types in models.py?
It is necessary to set (8,4) for Float
Or set the parameter for SMALLINT (3)
Tried:
vgap = db.Column(db.FLOAT(precision=10, scale=2), nullable=False)
class DieCut(db.Model):
__tablename__ = 'diecut'
cut_name = db.Column(db.String(length=40), primary_key=True, nullable=False)
zub_num = db.Column(db.SMALLINT, db.ForeignKey('zub.zub_num'))
vsheet = db.Column(db.Integer, nullable=False)
hcountitem = db.Column(db.Integer, nullable=False)
vcountitem = db.Column(db.Integer, nullable=False)
hgap = db.Column(db.FLOAT, nullable=False)
vgap = db.Column(db.Float(precision=10, scale=2), nullable=False)
cut_id = db.Column(db.Integer, autoincrement=True)
slug = db.Column(db.String(50))
cut_file = db.Column(db.String(200))
def __init__(self, *args, **kwargs):
super(DieCut, self).__init__(*args, **kwargs)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question