![]() To visualize the changes we can use SQLiteBrowser, a free tool to open the SQLite database: SQLite - DB Inspect. In the same way we can add more information: > feb = Stats(id=2, month='Feb', sold_units=480) Now we can use the helper to save the object using a single line: > # Define the new object commit()" we can code a helper inside the model class: # Contents of `app/models.py` To speed up the process and combine "session. > db.mit() # Save changes in the database > db.session.add(ian) # Add the new object to the DB Session Let's create new records using the CLI: > from app.models import Stats Obviously, we have an empty list - no rows defined so far.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |