Using Constraints in Flask-SQLAlchemy

Поділитися
Вставка
  • Опубліковано 16 жов 2024
  • This video demonstrates how to use database constraints in Flask-SQLAlchemy to ensure data integrity.
    WORK WITH ME👇🏼
    ✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
    prettyprinted....
    Join my free course on the basics of Flask-SQLAlchemy: prettyprinted....
    To get the cheat sheet, go to: prettyprinted....

КОМЕНТАРІ • 13

  • @prettyprinted
    @prettyprinted  4 роки тому +1

    Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql

  • @vijeandran
    @vijeandran 2 роки тому

    HI, Instead of printing all the columns in GET request, How could I get only specific columns from the table?

  • @mayankrawat7423
    @mayankrawat7423 3 роки тому

    Hi,
    Really appreciate your work.
    I wanted to know if we can change the constraints from flask after we have created the tables with some initial constraints. for ex - if i create a table with 'id' as the primary key then how can i change the constraints of 'id' and give any other column the primary key constraint.

  • @voilin
    @voilin 7 років тому

    Great content! Btw no flask-security video? And how can i secure flask-admin /admin route

    • @prettyprinted
      @prettyprinted  7 років тому

      Flask-Security is in the plans. I also plan on securing Flask-Admin, but here are the docs for now: flask-admin.readthedocs.io/en/latest/introduction/#authorization-permissions

  • @viniciusbarbosa3174
    @viniciusbarbosa3174 7 років тому +1

    could you make a tutorial using foreign keys?

    • @prettyprinted
      @prettyprinted  7 років тому +2

      Check out my Flask-SQLAlchemy playlist: ua-cam.com/play/PLXmMXHVSvS-BlLA5beNJojJLlpE0PJgCW.html
      You can also view my Flask-SQLAlchemy Basics course on prettyprinted.com

    • @viniciusbarbosa3174
      @viniciusbarbosa3174 7 років тому

      thanks man. love your work.

  • @ktorres9626
    @ktorres9626 7 років тому

    do you have a flask/react js tutorial ?

    • @prettyprinted
      @prettyprinted  7 років тому

      Not yet, but I'll make one in the future.

  • @cmanna285
    @cmanna285 4 роки тому

    what about using something like
    __table_args__ = (UniqueConstraint("something", "somethingelse", name="giberish"),)

  • @slinbody
    @slinbody 7 років тому

    "Note that some databases do not actively support check constraints such as MySQL."
    I don't know it until I see this video.

    • @prettyprinted
      @prettyprinted  7 років тому +1

      You would think it would. If you want to do it, you'll have to write your own check before the data gets added to the database.