Tag Archives: django

Adjust Thread for using in-memory sqlite in tests

If you are using in memory sqlite database for running tests, as Django does, you will find trouble covering Python code that uses threading and reads or writes into the database in the thread routine.

Can I create classes that inherit Model classes in Django?

Yes, you can, and that is the correct way to separate extra custom logic, while still having access to specific model methods like initializer, filters, getters and save().

Storing serialized object in a Django model field

This is a personal solution to the fore stated problem. I wanted to keep a syndicated data (dictionary) in a text column, no ordering or filtering operations needed, just bare storage. I am going to override both constructor and save() method to sync the record with an object property, holding the data. The code is […]