Django backend for WorkX project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.

18 regels
550 B

  1. from rest_framework import serializers
  2. from .models import Item, Invoice
  3. class ItemSerializer(serializers.ModelSerializer):
  4. class Meta:
  5. model = Item
  6. fields = ['id', 'name', 'amount', 'quantity', 'invoice', 'item_total']
  7. class InvoiceSerializer(serializers.ModelSerializer):
  8. items = ItemSerializer(many=True, read_only=True)
  9. class Meta:
  10. model = Invoice
  11. fields = ['id', 'title', 'project', 'invoice_id', 'raised_date', 'due_date', 'paid_date', 'is_archived',
  12. 'invoice_total', 'items']