- Removed TradingGraph component from frontend/src/components/trading. - Updated home page to import Services component and TradingGraph from new path. - Modified PortfolioPage to return null instead of PortfolioGrid. - Added initial migrations for account, advertisement, commerce, configuration, downloader, gopay, stripe, trading212, and zasilkovna apps in the backend. - Created Services component with subcomponents for Kinematografie, Drone Service, and Website Service. - Implemented TradingGraph component with dynamic data generation and canvas rendering. - Updated DonationShop component to display donation tiers with icons and descriptions.
58 lines
1.0 KiB
Python
58 lines
1.0 KiB
Python
from rest_framework import serializers
|
|
|
|
from .models import ZasilkovnaPacket, ZasilkovnaShipment
|
|
|
|
|
|
class ZasilkovnaPacketSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = ZasilkovnaPacket
|
|
fields = [
|
|
"id",
|
|
"created_at",
|
|
"packet_id",
|
|
"barcode",
|
|
"state",
|
|
"weight",
|
|
"return_routing",
|
|
]
|
|
read_only_fields = [
|
|
"id",
|
|
"created_at",
|
|
"barcode",
|
|
"state",
|
|
"weight",
|
|
"return_routing",
|
|
]
|
|
|
|
|
|
#Just for tracking URL of packet
|
|
class TrackingURLSerializer(serializers.Serializer):
|
|
barcode = serializers.CharField(read_only=True)
|
|
tracking_url = serializers.URLField(read_only=True)
|
|
|
|
|
|
|
|
# -- SHIPMENT --
|
|
|
|
class ZasilkovnaShipmentSerializer(serializers.ModelSerializer):
|
|
packets = serializers.PrimaryKeyRelatedField(
|
|
many=True,
|
|
queryset=ZasilkovnaPacket.objects.all()
|
|
)
|
|
|
|
class Meta:
|
|
model = ZasilkovnaShipment
|
|
fields = [
|
|
"id",
|
|
"created_at",
|
|
"shipment_id",
|
|
"barcode",
|
|
"packets",
|
|
]
|
|
read_only_fields = [
|
|
"id",
|
|
"created_at",
|
|
"shipment_id",
|
|
"barcode",
|
|
]
|