Commit 4a306b42 authored by Matthieu Fesselier's avatar Matthieu Fesselier

bugfix: use ldp models

parent 78ebbbfd
Pipeline #2560 passed with stage
in 27 seconds
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import models
from djangoldp.models import Model
from djangoldp_project.models import Customer
from djangoldp_project.models import Project
from django.db.models import Sum
import datetime
from decimal import Decimal
class FreelanceInvoice(models.Model):
class FreelanceInvoice(Model):
# customer = models.ForeignKey(User, on_delete=models.CASCADE)
# provider = models.ForeignKey(User, on_delete=models.CASCADE)
STATES = (
......@@ -41,7 +42,7 @@ class FreelanceInvoice(models.Model):
class CustomerInvoice(models.Model):
class CustomerInvoice(Model):
customer = models.ForeignKey(Customer, on_delete=models.DO_NOTHING, null=True)
project = models.ForeignKey(Project, on_delete=models.DO_NOTHING, null=True)
STATES = (
......@@ -77,7 +78,7 @@ class CustomerInvoice(models.Model):
return '{} - {} ({})'.format(self.identifier, self.title, self.htAmount())
# Lot =========================================================
class Batch(models.Model):
class Batch(Model):
invoice = models.ForeignKey(CustomerInvoice, on_delete=models.CASCADE, related_name='batches')
title = models.CharField(max_length=255)
creationDate = models.DateField(auto_now_add=True)
......@@ -100,7 +101,7 @@ class Batch(models.Model):
Batch._meta.serializer_fields = ['@id', 'invoice', 'title', 'htAmount', 'tasks']
class Task(models.Model):
class Task(Model):
batch = models.ForeignKey(Batch, on_delete=models.CASCADE, related_name='tasks')
title = models.CharField(max_length=255)
htAmount = models.DecimalField(max_digits=11, decimal_places=2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment