Spaces:
Sleeping
Sleeping
Download api/serializers/orders.py from Dayozoe/harvestconnect-api: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/serializers/orders.py
- Command line
-
hf download hf://spaces/Dayozoe/harvestconnect-api/api/serializers/orders.py
-
curl -L -o orders.py https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/serializers/orders.py
503 Bytes
| from rest_framework import serializers | |
| from ..models import Order | |
| from .common import UserSerializer | |
| class OrderSerializer(serializers.ModelSerializer): | |
| buyer = UserSerializer(read_only=True) | |
| class Meta: | |
| model = Order | |
| fields = [ | |
| 'id', 'order_id', 'buyer', 'products', 'total_amount', | |
| 'status', 'shipping_address', 'payment_method', 'notes', 'created_at', 'updated_at' | |
| ] | |
| read_only_fields = ['id', 'order_id', 'created_at', 'updated_at'] | |