Changes between Initial Version and Version 1 of Ticket #34979


Ignore:
Timestamp:
Nov 19, 2023, 9:19:19 PM (13 months ago)
Author:
Evan Edward Hallein
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34979 – Description

    initial v1  
    77}}}
    88
     9this is my model (autogenerated from an existing database):
     10class TrtMeasurements(models.Model):
     11    observation = models.OneToOneField('TrtObservations', models.DO_NOTHING, primary_key=True)
     12    measurement_type = models.ForeignKey(TrtMeasurementTypes, models.DO_NOTHING, db_column='measurement_type')
     13    measurement_value = models.FloatField()
     14    comments = models.TextField(blank=True, null=True)
     15   
     16    class Meta:
     17        managed = False
     18        db_table = 'trt_measurements'
     19        unique_together = (('observation', 'measurement_type'),)
     20
    921While this makes sense for a single unique primary key, it is the wrong behavior for a composite primary key.
    1022
Back to Top