Sławomir Kwiatkowski

by: Sławomir Kwiatkowski

2024/07/09

Car manager CRUD app - part III

Content description:
In the current post I am adding search box methods (for focus-in, focus-out and to handle text entered into the search box).
I define methods that display windows for creating a new car and for displaying repairs.


 

The methods for handling the search field are: on_entry_in(), on_entry_out() and on_entry_return().

2024/07/07

Car manager CRUD app - part II

Content description:
In the current post, I create a GUI .
I define the main program window along with the menu bar, toolbar and search box.
I create methods to display all vehicles using a Treeview element, to remove a vehicle and to mark a car as sold.


 

The car_manager.py file contains the CarManager class. This is a class that inherits from the Frame class from the Tkinter library

When you create an instance of the CarManager class, an instance of the Helper class is created. Then the window name and application icon are set. A shortcut key for exiting the application has been set (Ctrl+x triggers the close_app() method).

2024/07/05

Car manager CRUD app - part I

Content description:
In the current post, I create a Car class that describes the user's vehicles. The class method allows you to easily create instances using a list.
Additionally, I create a file containing SQL code that creates tables in the database and CRUD methods.


 

In this post, I will describe a simple Python GUI application for recording car repair notes.

No ORM, just simple Python classes with a Tkinter GUI and a bit of SQL (SQLite).

You can download the project code from my Github repository

First, I create a car.py file containing a class describing vehicles.

2024/07/03

Abstract classes in Python

Abstract classes are intended to abstract functionality that will then be implemented in classes that inherit from the abstract class.

The following classes will inherit from the abstract Person class: Intern and Employee

Attempting to create an instance from the abstract Person class will result in a TypeError exception being thrown.

Additionally, not implementing all abstract methods in a child class causes a TypeError exception.

2024/07/02

Property decorator

The concept of object-oriented programming is related to the concept of encapsulation, i.e. hiding class fields and making only public methods (public API) available to read or change the values of these fields.

Python does not support access modifiers. Using private variables like: _variable is just a matter of convention.
However, you can check the validity of the data using the property decorator.

Based on the Employee class code, let's assume that we want to verify the entered telephone number. We would like to check whether it has the appropriate number of digits and does not contain characters that are not digits.