소스 검색

Updated decimal places and max digits for the decimal fields

master
kj1352 3 년 전
부모
커밋
4b5318862e
5개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. +1
    -1
      client/models.py
  2. +1
    -1
      employee/models.py
  3. +1
    -1
      invoice/models.py
  4. +1
    -1
      project/models.py
  5. +4
    -0
      requirements.txt

+ 1
- 1
client/models.py 파일 보기

@@ -3,7 +3,7 @@ from django.db import models

class TaxType(models.Model):
name = models.CharField(max_length=15)
percentage = models.DecimalField()
percentage = models.DecimalField(max_digits=3, decimal_places=2)

def __str__(self):
return self.name


+ 1
- 1
employee/models.py 파일 보기

@@ -8,7 +8,7 @@ class Employee(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
employee_id = models.CharField(max_length=15)
phone = PhoneNumberField()
salary = models.DecimalField()
salary = models.DecimalField(max_digits=10, decimal_places=2)
start_date = models.DateField()
end_date = models.DateField(null=True, blank=True)
projects = models.ManyToManyField(Project)


+ 1
- 1
invoice/models.py 파일 보기

@@ -16,7 +16,7 @@ class Invoice(models.Model):

class Item(models.Model):
name = models.TextField(blank=False, null=False)
amount = models.DecimalField()
amount = models.DecimalField(max_digits=15, decimal_places=2)
quantity = models.IntegerField()
invoice = models.ForeignKey(Invoice, on_delete=models.CASCADE)



+ 1
- 1
project/models.py 파일 보기

@@ -6,7 +6,7 @@ class Project(models.Model):
name = models.CharField(max_length=30)
project_image = models.ImageField(upload_to='project_images', null=True, blank=True)
client = models.ForeignKey(Client, on_delete=models.CASCADE)
total_compensation = models.DecimalField()
total_compensation = models.DecimalField(max_digits=15, decimal_places=2)
start_date = models.DateField()
end_date = models.DateField()



+ 4
- 0
requirements.txt 파일 보기

@@ -6,6 +6,8 @@ coreschema==0.0.4
Django==4.0.6
django-cors-headers==3.13.0
django-filter==22.1
django-phonenumber-field==6.3.0
django-phonenumbers==1.0.1
django-sendgrid-v5==1.2.0
djangorestframework==3.13.1
drf-yasg==1.20.0
@@ -17,6 +19,8 @@ Jinja2==3.1.2
Markdown==3.3.7
MarkupSafe==2.1.1
packaging==21.3
phonenumbers==8.12.51
Pillow==9.2.0
pyparsing==3.0.9
python-http-client==3.3.7
pytz==2022.1