How do I get Django Admin to delete files when I remove an object from the database/model?

You can receive the pre_delete or post_delete signal (see @toto_tico’s comment below) and call the delete() method on the FileField object, thus (in models.py): class MyModel(models.Model): file = models.FileField() … # Receive the pre_delete signal and delete the file associated with the model instance. from django.db.models.signals import pre_delete from django.dispatch.dispatcher import receiver @receiver(pre_delete, sender=MyModel) def … Read more

How much storage would be required to store a human genome?

If you trust such things, here is what Wikipedia claims (from http://en.wikipedia.org/wiki/Human_genome#Information_content): The 2.9 billion base pairs of the haploid human genome correspond to a maximum of about 725 megabytes of data, since every base pair can be coded by 2 bits. Since individual genomes vary by less than 1% from each other, they can … Read more

IOPS versus Throughput

IOPS measures the number of read and write operations per second, while throughput measures the number of bits read or written per second. Although they measure different things, they generally follow each other as IO operations have about the same size. If you have large files, you simply need more IO operations to read the … Read more

What are Transient and Volatile Modifiers?

The volatile and transient modifiers can be applied to fields of classes1 irrespective of field type. Apart from that, they are unrelated. The transient modifier tells the Java object serialization subsystem to exclude the field when serializing an instance of the class. When the object is then deserialized, the field will be initialized to the … Read more

What is the difference between persistent volume (PV) and persistent volume claim (PVC) in simple terms?

From the docs PVs are resources in the cluster. PVCs are requests for those resources and also act as claim checks to the resource. So a persistent volume (PV) is the “physical” volume on the host machine that stores your persistent data. A persistent volume claim (PVC) is a request for the platform to create … Read more

How to Get True Size of MySQL Database?

From S. Prakash, found at the MySQL forum: SELECT table_schema “database name”, sum( data_length + index_length ) / 1024 / 1024 “database size in MB”, sum( data_free )/ 1024 / 1024 “free space in MB” FROM information_schema.TABLES GROUP BY table_schema; Or in a single line for easier copy-pasting: SELECT table_schema “database name”, sum( data_length + … Read more

Best way to synchronize local HTML5 DB (WebSQL Storage, SQLite) with a server (2 way sync) [closed]

I created a small JS lib named WebSqlSync to synchronize a local WebSql DB with a server (client <-> server). Very easy to use and to integrate in your code : https://github.com/orbitaloop/WebSqlSync The open source project QuickConnect contains a JS library to synchronize the local HTML5 SQLite DB to a server DB (MySQL or other) … Read more