| 1234567891011121314151617181920212223 |
- from django.contrib.auth.models import User
- from django.db import models
- class Indicator(models.Model):
- """ Модель (сущность) - Измерение """
- id = models.AutoField(primary_key=True)
- type = models.ForeignKey('indicatortype.IndicatorType', on_delete=models.CASCADE)
- value1 = models.DecimalField(max_digits=8, decimal_places=3)
- value2 = models.DecimalField(max_digits=8, decimal_places=3, blank=True, null=True)
- value_added = models.DateTimeField()
- patient = models.ForeignKey('patient.Patient', on_delete=models.CASCADE)
- last_modified = models.DateTimeField(auto_now=True)
- comments = models.CharField(max_length=150, blank=True, null=True)
- observing = models.ForeignKey(User, on_delete=models.CASCADE)
- created_date = models.DateTimeField(auto_now_add=True)
- def __str__(self):
- return "Измерение № %s - %s" % (self.id, self.value1,)
- class Meta:
- verbose_name = "Измерение"
- verbose_name_plural = "Измерения"
|