Fixes: 1) Resolve annotations compatibility with mypy `type: ignore` adjustments; 2) Correct `resolve_price_with_currency` method to ensure proper float returns; 3) Handle scenarios for empty or null queryset in vendor methods. Extra: 1) Refactor utility functions for better type annotations and robustness; 2) Minor formatting corrections and removal of redundant mypy strict setting; 3) Improve method return types for consistency.
13 lines
424 B
Python
13 lines
424 B
Python
from rest_framework.fields import CharField, DictField, ListField
|
|
from rest_framework.serializers import Serializer
|
|
|
|
|
|
class SeoSnapshotSerializer(Serializer):
|
|
title = CharField()
|
|
description = CharField()
|
|
canonical = CharField()
|
|
robots = CharField()
|
|
hreflang = ListField(child=DictField(), required=False)
|
|
open_graph = DictField()
|
|
twitter = DictField()
|
|
json_ld = ListField(child=DictField())
|