Setting up a database
- Create local database and role (ie. PostgreSQL)
- Set database credentials in settings.py
- Migrate the database
# Special Character Remover - removes special characters in an alphanumeric text | |
import string | |
ALPHANUMERIC = string.digits + string.ascii_letters | |
text = 'JI000 00-2391M/xxxx---------90234' | |
# output 'JI000002391Mxxxx90234' | |
print(''.join([char for char in text if char in ALPHANUMERIC])) |
# Applying a sort feature in a QTableView | |
import sys | |
from PyQt5.QtCore import (Qt, | |
QModelIndex, | |
QAbstractTableModel, | |
QSortFilterProxyModel) | |
from PyQt5.QtWidgets import (QApplication, | |
QTableView) |