Sławomir Kwiatkowski

by: Sławomir Kwiatkowski

2024/09/26

Django - new user model & manager

Content description:
In this post I'll describe how to create your own user model in Django.
Then I'll test the model and manager I created.

First, I create a new application called users.

     
python manage.py startapp users

In the models.py file, I create a custom user that inherits from the AbstractUser class. I add a checkbox in the profile so that a user can be a client or a contractor. A client issues delivery orders to warehouses, and a contractor accepts them.

2024/09/09

Reportlab - creating PDF files

Content description:

Reportlab - generating a PDF on the server



Solved issue: How to generate a pdf file with order details and reservation barcode without saving the file to the server.

Car manager CRUD app - part IV

Content description:
This is the date picker class for the project.
You are free to use it in your projects (MIT license).


 

The date picker window is an instance of the tk.Toplevel class. I blocked the widgets in the parent window until the date picker window was closed (grab_set() function). The following lines describe the position of the date picker window relative to its parent window. Then an instance of the Calendar class is set up and dp_frame variable was set to hold an instance of the tk.Frame class. Finally, the create_cal_ui() method arranges the widgets in the window.