Django: correct way to specify model (list of tuples)
<p>I'm not happy with my current model and wanted to ask if there is a better/preferred way to achieve the same result.</p>

<p><em>What do I want?</em></p>

<ul>
<li>An object A that contains a number of lists. Each list contains tuples, the first entry being a date object, the second one is either a float or an integer.</li>
<li>If I delete A, B should also be deleted. If I delete B I want to just have an empty list.</li>
</ul>

<p><em>How I tried to accomplish it:</em></p>

<pre><code>class TimeValueIntSequence(models.Model):
    pass

class TimeValueFloatSequence(models.Model):
    pass

class TimeValueInt(models.Model):
    time = models.DateField()
    value = models.IntegerField()
    sequence = models.ForeignKey(TimeValueIntSequence, models.CASCADE, blank=False, null=False)

class TimeValueFloat(models.Model):
    time = models.DateField()
    value = models.FloatField()
    sequence = models.ForeignKey(TimeValueFloatSequence, models.CASCADE, blank=False, null=False)

class A(models.Model):
    field1 = models.OneToOneField(TimeValueIntSequence, models.SET_NULL, blank=True, null=True, related_name='field1')
    field2 = models.OneToOneField(TimeValueIntSequence, models.SET_NULL, blank=True, null=True, related_name='field2')
    field3 = models.OneToOneField(TimeValueFloatSequence, models.SET_NULL, blank=True, null=True, related_name='field3')
</code></pre>

<p><em>What is wrong?</em></p>

<ul>
<li>Approach seems inefficient. </li>
<li>If I delete an object of type A the sequences do not get deleted.</li>
</ul>

<p>Do you have any feedback?
Thank you!</p>