Custom designs are a main service.
My name is James Wayne. I live in ... the Netherlands
Below the CPO Maintenance application is presented (version 0.1).
CPO is an example of the architecture to connect Python / WxWindows screens to a Mysql database and to maintain the information in the database through screens by inserting, updating and deleting records.
CPO is presented via a short summary on a high level.
For the quick starters the commands to get them going are presented.
The body of the document presents information in piecemeal parts, including hyperlinks for extra information.
Customer Products Orders (CPO) is an example of an application, that can be used to maintain data in tables of a relational database model.
The example shows how an application written in the Python language can be used to connect to a database, retrieve records and put them in a grid. The data can be changed and saved back to the database.
The WxWindows extension of Python is used, because it makes it easier to create an application using window components. The Object model is relatively easy to use.
The usage of Mysql is an example of an Relational Database Management System (RDBMS), that is both easy to install and small with respect to disk usage.
The following one minute install guide gets your python / wxwindows maintenance application running against a mysql database in a few commands.
Unpack the file CPO_24_Nov_2005_01l.tar.gz
Copy the SQL-dir and Out-dir to /home/wijnenjl/Documents/cg_ceb_cva_menu3_419/DMAPP/
Create the tables starting from the directory containing INSTALL via: Sql/PRJ_NAME_PRJ_DB_NM_PRJ_DB_NR_Create_MySql_lx.sh, while entering the mysql root password.
Insert records in the tables starting from the directory containing INSTALL via: Sql/PRJ_NAME_PRJ_DB_NM_PRJ_DB_NR_Insert_MySql_lx.sh, while entering the mysql root password, once for each table.
Assuming the PYTHONPATH is OK, start the application from the directory containing INSTALL via: python Out/CPO_Menu_Wx_02a.py
Optional: The application assumes in the directory /home/wijnenjl/Documents/cg_ceb_cva_menu3_419/DMAPP/Out a background picture named Mountain_View.jpg; any pleasing file Mountain_View.jpg can be downloaded from the internet to this directory to create a background picture in the main screen.
Optional: When necessary Delete records from the tables starting from the directory containing INSTALL via: Sql/PRJ_NAME_PRJ_DB_NM_PRJ_DB_NR_Delete_MySql_lx.sh, while entering the mysql root password.
Optional: When necessary Drop the tables starting from the directory containing INSTALL via: Sql/PRJ_NAME_PRJ_DB_NM_PRJ_DB_NR_Drop_MySql_lx.sh, while entering the mysql root password.
Relational Databases (as formally defined in the first paragraph of Wikipedia - Relation database and in Wikipedia - database ) can be described in an informal way as below:
A database can be considered as a collection of tables.
Each table contains the data for an entity (see Wikipedia - Entity ).
A table contains rows and columns.
Each row contains the data for one instance of the information in the table. For example, a table of car data will contain in record 1 the data for the first car in the shop, the second record the data for the second car, etc..
The data are organized in columns. In each column the attributes or properties of the objects are laid down. In our example in each record the properties, car-number, car-type, milage, age, price, color could be stored.
The table from our example would look like this
| car-number | car-type | milage | age | price | color |
|---|---|---|---|---|---|
| 1 | Ford Focus | 10000 | 1 | 20000 | red |
| 2 | Opel Astra | 20000 | 2 | 10000 | yellow |
Structured Query Language (SQL) is a language that in fact has only a few functions:
Functions for creating and dropping tables, the so called Data Definition Lamguage (DDL)
Functions for inserting, updating, deleting and selecting records in tables, the so called Data Manipulation Lamguage (DML)
Functions for starting transactions and saving changes to the database using the commit or quiting to save the changes to the database using rollback
Functions for authorization that grant or revoke people privileges in the database, the so called Data Control Lamguage (DCL)
There are some minor differences between different rdms implementations Oracle and Mysql
Foreign Keys: In Mysql tables have to be created as innodb tables to get Foreign Keys checks on database level
Date functions: In Mysql date functions are different; one way of working with dates: dates can be treated as strings in mysql
Decode function: In Mysql a decode function has to be implemented as an IF function
Working with Python is working with python files.
Usually a python file describes a class and its methods.
To start a python file, type in python x-file, where x-file is the name of the python-file.
To use other classes, the respective python files are imported in the upper part of the python file.
Namespace in python can be seen as a categorization of native python classes. Namespaces imply the way that classes are denoted. There has been a major changes in python in combination with wxwindows, in which all python code had to be changed to denote objects.
Working with Python in a GUI environment is fairly easy, once you accept that everything is an object. To get screens going, you have to create instances of objects in a certain order. The examples of the wxwindows environment show how it has to be done.
The components of a python maintenance application always are mentioned in the Docs: Software Design Specification. When python and wxwindows are combined with mysql an extra mysql python component has to be installed on Linux.
Apart from the Operating system component (Linux) and the system software components (Mysql, Python, Wxwindows), all python maintenance applications contain different SQL components (to create and delete tables and to insert and delete records). The SQL components should be executed with care, because one should not run a drop table or a delete record SQL script on a running application already containing records that ar meant to be kept. Of course all python maintenance applications also contain python files, one python menu application and one python screen file for each table to be maintained.
An important service of the James Wayne Foundation is the ability to generate a new application for you, when you have a data model of your own, that has to be maintained.
If you like the header, it can be found here.
If you're using firefox, put your cursor over the logo. But for some reason IE doesn't like image rollover effects. Its not that big of a deal.
Google