1
|
|
|
# coding: utf-8 |
2
|
|
|
from dj_diabetes.models import HatModel |
3
|
|
|
|
4
|
|
|
from django.contrib.auth.models import User |
5
|
|
|
from django.db import models |
6
|
|
|
|
7
|
|
|
|
8
|
|
|
class ExaminationTypes(HatModel): |
9
|
|
|
|
10
|
|
|
""" |
11
|
|
|
ExaminationTypes |
12
|
|
|
""" |
13
|
|
|
class Meta: |
14
|
|
|
verbose_name = 'Examination Types' |
15
|
|
|
verbose_name_plural = 'Examination Types' |
16
|
|
|
|
17
|
|
|
|
18
|
|
View Code Duplication |
class Examinations(models.Model): |
|
|
|
|
19
|
|
|
|
20
|
|
|
""" |
21
|
|
|
Examinations |
22
|
|
|
""" |
23
|
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE) |
24
|
|
|
examination_types = models.ForeignKey(ExaminationTypes, |
25
|
|
|
on_delete=models.CASCADE) |
26
|
|
|
comments = models.TextField() |
27
|
|
|
date_examinations = models.DateField() |
28
|
|
|
hour_examinations = models.TimeField(null=True) |
29
|
|
|
created = models.DateTimeField(auto_now_add=True) |
30
|
|
|
modified = models.DateTimeField(auto_now=True) |
31
|
|
|
|
32
|
|
|
class Meta: |
33
|
|
|
verbose_name = 'Examinations' |
34
|
|
|
verbose_name_plural = 'Examinations' |
35
|
|
|
|
36
|
|
|
def __str__(self): |
37
|
|
|
return "%s (date %s) (comment: %s)" % ( |
38
|
|
|
self.examination_types, |
39
|
|
|
self.date_examinations, |
40
|
|
|
self.comments) |
41
|
|
|
|
42
|
|
|
|
43
|
|
View Code Duplication |
class ExaminationDetails(models.Model): |
|
|
|
|
44
|
|
|
|
45
|
|
|
""" |
46
|
|
|
ExaminationDetails |
47
|
|
|
""" |
48
|
|
|
examination = models.ForeignKey(Examinations, on_delete=models.CASCADE) |
49
|
|
|
title = models.CharField(max_length=255) |
50
|
|
|
value = models.DecimalField(max_digits=15, decimal_places=5) |
51
|
|
|
created = models.DateTimeField(auto_now_add=True) |
52
|
|
|
modified = models.DateTimeField(auto_now=True) |
53
|
|
|
|
54
|
|
|
class Meta: |
55
|
|
|
verbose_name = 'Examination Details' |
56
|
|
|
verbose_name_plural = 'Examination Details' |
57
|
|
|
|
58
|
|
|
def __str__(self): |
59
|
|
|
return "%s" % self.title |
60
|
|
|
|