diff --git a/README.md b/README.md index 8e769d0..1834d4c 100644 --- a/README.md +++ b/README.md @@ -435,9 +435,9 @@ if __name__ == '__main__': {% endblock %} ``` - And ... *Voilá*. + And... we already have an unofficial search engine. - Y... *Voilá*. + Y... ya tenemos un buscador no oficial. ### Break (Descanso) - 10 min @@ -451,6 +451,8 @@ if __name__ == '__main__': #### 2.1 Models + With **Flask-alquemy** we will define the structure of our database. In this case we will have a single table called *Programdo* with the fields: *id*, *title* and *last_item*. To do this we will create a new file with the name **models.py**. +  Con **Flask-alquemy** vamos a definir la estructura de nuestra base de datos. En este caso tendremos una única tabla llamada *Programado* con los campos: *id*, *title* y *last_item*. Para ello crearemos un nuevo archivo con el nombre **models.py**. ```python3 @@ -468,6 +470,8 @@ class Programado(db.Model): last_item = db.Column(db.Integer) ``` + This clean way of working lacks several basic functionalities, such as migrations or the possibility of executing orders through the terminal. To do this, we'll add **Flask-Migrate** for automatic migrations and **Flask-Script** for managing them. +  Esta forma de trabajar tan limpia carece de varias funcionalidades básicas, como migraciones o la posibilidad de ejecutar ordenes por medio del terminal. Para ello le sumaremos **Flask-Migrate** para las migraciones automáticas y **Flask-Script** para su gestión. @@ -495,6 +499,8 @@ if __name__ == "__main__": manager.run() ``` + We opened our terminal and started the database, created the first migration and updated the database. +  Abrimos nuestro terminal e iniciamos la base de datos, creamos la primera migración y actualizamos la base de datos. ```bash @@ -503,6 +509,8 @@ python3 models.py db migrate python3 models.py db upgrade ``` + We found that everything went well. +  Comprobamos que todo ha ido bien. ```bash @@ -514,6 +522,9 @@ sqlite3 database.sqlite --- #### 2.2 Save item + + To save an element we need to modify our template **buscador.html**. We will send a *POST*. How simply a **