from flask import Flask
from flask_mongoalchemy import MongoAlchemy

app = Flask(__name__)
app.config['MONGOALCHEMY_DATABASE'] = 'gallery_db'
app.config['MONGOALCHEMY_SERVER'] = 'localhost'
app.config['MONGOALCHEMY_PORT'] = 27017

gallery_db = MongoAlchemy(app)


class Paintings(gallery_db.Document):
    _id = gallery_db.IntField()
    title = gallery_db.StringField()
    artist = gallery_db.StringField()
    material = gallery_db.StringField()
    size = gallery_db.StringField()
    price = gallery_db.FloatField()
    img_url = gallery_db.StringField()
    in_stock = gallery_db.BoolField(default=True)
    limited_edition = gallery_db.BoolField(default=False)
    # in_stock = gallery_db.BinaryField(default=True)
    # limited_edition = gallery_db.BinaryField(default=0)


painting = Paintings(_id=1, title='Anamnesis-3', artist='<NAME>',
                     size='30 x 45  cm', material='Pigment print on archival paper (100% cotton)',
                     price=100, img_url='https://artvorota.org/tproduct/1-785469201151-anamnesis-3',
                     in_stock=True, limited_edition=True)
if __name__ == "__main__":
    app.run(debug=True)

from flask import Flask
from flask_mongoalchemy import MongoAlchemy

app = Flask(__name__)
app.config['MONGOALCHEMY_DATABASE'] = 'gallery_db'
app.config['MONGOALCHEMY_SERVER'] = 'localhost'
app.config['MONGOALCHEMY_PORT'] = 27017

gallery_db = MongoAlchemy(app)


class Paintings(gallery_db.Document):
    _id = gallery_db.IntField()
    title = gallery_db.StringField()
    artist = gallery_db.StringField()
    material = gallery_db.StringField()
    size = gallery_db.StringField()
    price = gallery_db.FloatField()
    img_url = gallery_db.StringField()
    in_stock = gallery_db.BoolField(default=True)
    limited_edition = gallery_db.BoolField(default=False)
    # in_stock = gallery_db.BinaryField(default=True)
    # limited_edition = gallery_db.BinaryField(default=0)


painting = Paintings(_id=1, title='Anamnesis-3', artist='<NAME>',
                     size='30 x 45  cm', material='Pigment print on archival paper (100% cotton)',
                     price=100, img_url='https://artvorota.org/tproduct/1-785469201151-anamnesis-3',
                     in_stock=True, limited_edition=True)
if __name__ == "__main__":
    app.run(debug=True)

# in_stock = gallery_db.BinaryField(default=True) # limited_edition = gallery_db.BinaryField(default=0)