Python build object from json and back

Suppose you need to have bilateral conversion from json to object and vice versa. So, in this article you’ll find out how to: Build object from json Convert object to json If you need to rename some of the properties in the target json, you can make it this way: Here you go!

READ MORE

Safe database migrations in Django

The simple process of renaming a DB column becomes more complex when DB migrations in specific scenarios are applied before code updates by pipeline. It means that there may be a timeframe, when the “old” code will be running against the “new” database. Therefore, using the built-in Django rename functionality will lead to errors. “Old“ […]

READ MORE

Python mypy / isort type ignore for long import

Suppose you have mypy + black + isort tools, and long import line, which you need to mark as ignored for mypy. You’ll probably start doing smth like this: And after you run isort & black, you’ll end up in this situation: Which will break mypy’s type: ignore annotation. To make things work we need […]

READ MORE