Commit c1d6c5be authored by Jean-Baptiste's avatar Jean-Baptiste

update: remove unecessary

parent 25140792
Pipeline #2676 passed with stage
in 27 seconds
......@@ -34,6 +34,7 @@ class FreelanceInvoice(Model):
invoicingDate = models.DateField(
class Meta:
container_path = "freelance-invoices/"
permissions = (
('view_freelance_invoice', 'Read'),
('control_freelance_invoice', 'Control'),
......@@ -71,6 +72,10 @@ class CustomerInvoice(Model):
class Meta:
depth = 2
container_path = "customer-invoices/"
nested_fields = ["batches", "project", "customer"],
serializer_fields = ["@id", "identifier", "title", "state", "htAmount", "tvaRate", "invoicingDate",
"tvaAmount", "ttcAmount", "batches", "project", "customer"]
permissions = (
('view_invoice', 'Read'),
('control_invoice', 'Control'),
......@@ -88,6 +93,7 @@ class Batch(Model):
modificationDate = models.DateField(auto_now=True)
class Meta:
serializer_fields = ['@id', 'invoice', 'title', 'htAmount', 'tasks']
permissions = (
('view_batch', 'Read'),
from django.conf.urls import url, include
from django.conf import settings
from djangoldp.views import LDPViewSet
from .models import CustomerInvoice
from .models import FreelanceInvoice
from .models import Batch
from .models import Task
urlpatterns = [
url(r'^freelance-invoices/', LDPViewSet.urls(model=FreelanceInvoice)),
url(r'^customer-invoices/', LDPViewSet.urls(model=CustomerInvoice,
nested_fields=["batches", "project", "customer"],
fields=["@id", "identifier", "title", "state", "htAmount", "tvaRate", "invoicingDate",
"tvaAmount", "ttcAmount", "batches", "project", "customer"]
url(r'^batches/', LDPViewSet.urls(model=Batch,
fields=["@id", "title", "htAmount", "tasks"]
url(r'^tasks/', LDPViewSet.urls(model=Task)),
\ No newline at end of file
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