From 4bf757788fd66577384398f1923156fdf01d1c8e Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Tue, 6 Mar 2018 09:07:42 +0100
Subject: [PATCH] [experiments][models][block_input] Added dependencies to
 BlockInput natural_key

This allows Django to serialize the database content in the correct
order.
---
 beat/web/experiments/models/block_input.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/beat/web/experiments/models/block_input.py b/beat/web/experiments/models/block_input.py
index 96d4f0dd6..e48adb4a2 100755
--- a/beat/web/experiments/models/block_input.py
+++ b/beat/web/experiments/models/block_input.py
@@ -81,3 +81,6 @@ class BlockInput(models.Model):
         cache_hash = self.cache and self.cache.hash
         database_natural_key = self.database and self.database.natural_key()
         return (block_natural_key, cache_hash, database_natural_key)
+    natural_key.dependencies = ['experiments.block',
+                                'experiments.cachedfile',
+                                'databases.databasesetoutput']
-- 
GitLab