Although I never marked our live Bio Application as published, actually at the current state it shouldn't be treated as a production quality application. The main reason is simple : up until now, our database will always be recreated when application started, discarding any data already entered by our users. We do this to allow us focusing our work on perfecting application features than to manage our own database migration script.
Today we are going to have a look on how exactly a database migration technique is implemented. It will allow our application to be stamped as Production Quality application, as it will allow users to registered safely into our application. Whatever development changes we introduce, our users data will not just get thrown to the void. The database schema will be upgraded and existing data will be merged to the new schema.
In our beloved Python world there are plenty of database migration tools available. But as we use SQLAlchemy, well, don't you think that the author of SQLAlchemy should be the the legitimate author to write its database migration tool? Well then, introducing Alembic!
Figure IX-1 Portofolio grid in Bio Page complete with action buttons
Before we going further on our journey of making a fully functional Bio Application, lets return to our early concept of this application : product portfolio show case. And guess what we missed. Correct. We missed the required application model for a product portfolio. If you rethink our application models until this state, we know we haven't add a portfolio model/table. This part of article series will guide you on how exactly it's done by adding
Portfolio model using SQLAlchemy
relationship field in our existing
Welcome to the sixth instalment of this Bio Application Development Tutorial. I constructed this tutorial, in such a way that even a newcomer in Python will be able to grasp its content and follow it easily. Thanks to Python intuitive coding environment, my job is not that hard. But it is you who really decide whether my goals are met or I still have to refine how I presented ideas, instructions and concepts.
Previously, our Bio Application having its first data access capability by using a great ORM tool, SQLAlchemy. It able to construct Users tables, populate data and query those data. But it still lack an important feature : a visitor still unable to register him/herself into our application. In this article, we are going to show you how exactly it is done.
In this fifth article we are going to liven up our bio application with real data coming from the database. From our previous post, we already have a nice visual representation of our bio application. Now it is time to supply its content with user very own data. It will make your application feels so nice. Alive.
We are going to utilize SQLAlchemy to do :
A sharp eyed reader may notice, "How do you populate those data? I don't see any user signup action there!". Correct! We are going o skip those important feature for now. Here, I am going to concentrate you on the SQLAlchemy part. I think my next article will going to talk about those Signup form.
Copyright(c) 2014 - PythonBlogs.com
All rights reserved