Appointments   A
last analyzed

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 1
Metric Value
c 5
b 0
f 1
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __str__() 0 2 1
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 AppointmentTypes(HatModel):
9
10
    """
11
        AppointmentTypes
12
    """
13
    class Meta:
14
        verbose_name = 'Appointment Types'
15
        verbose_name_plural = 'Appointment Types'
16
17
18
class Appointments(models.Model):
19
20
    """
21
        Appointments
22
    """
23
    user = models.ForeignKey(User, on_delete=models.CASCADE)
24
    appointment_types = models.ForeignKey(AppointmentTypes,
25
                                          on_delete=models.CASCADE)
26
    title = models.CharField(max_length=255)
27
    body = models.TextField()
28
    created = models.DateTimeField(auto_now_add=True)
29
    modified = models.DateTimeField(auto_now=True)
30
    date_appointments = models.DateField(null=True)
31
    hour_appointments = models.TimeField(null=True)
32
    recall_one_duration = models.IntegerField(null=True)
33
    recall_two_duration = models.IntegerField(null=True)
34
    recall_one_unit = models.IntegerField(null=True)
35
    recall_two_unit = models.IntegerField(null=True)
36
37
    class Meta:
38
        verbose_name = 'Appointments'
39
        verbose_name_plural = 'Appointments'
40
41
    def __str__(self):
42
        return "%s (date: %s)" % (self.title, self.date_appointments)
43