Flask Flashcards

1
Q

What does an API allow different software applications to do?

A

Communicate with each other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the HTTP methods used in RESTful Routing, and what CRUD operations do they correspond to?

A

GET (Read), POST (Create), PUT (Update), DELETE (Delete)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why do we use serialization in web development?

A

To convert objects into a format that can be easily stored or transmitted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does ORM stand for, and which one is commonly used in Flask?

A

Object-Relational Mapping, SQLAlchemy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command is used to create migration files, and which one is used to apply them?

A

flask db migrate, flask db upgrade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What method do you call to save changes to the database in SQLAlchemy?

A

db.session.commit()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which library is commonly used with Formik for form validations?

A

Yup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are two types of backend validations, and where are they defined?

A

Constraints and Validates decorator, in the models

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you define a one-to-many relationship in SQLAlchemy?

A

Using db.relationship and db.ForeignKey

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the main difference between a GET request and a POST request in terms of what they do?

A

GET requests retrieve data; POST requests send data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly