Ross Crawford-d'Heureuse
2018-04-30 16:38:21 UTC
Hi there,
Successfully installed djangorestframework-3.8.2
```
class CustomerCardSerializer(serializers.Serializer):
customer_id = serializers.CharField(source='customerID')
customer_uid = serializers.CharField(source='CustomerUID')
email = serializers.EmailField(source='CustomerEmail')
card = serializers.CharField(source='KundenKarteNr')
```
```
from blah.apps.default.serializers import CustomerCardSerializer
cc=CustomerCardSerializer(data={'MobileDC': None, 'CustomerUID':
'88B6F5AA-3D7E-2EBE-B968-F73C3992083D', 'BasePoints': '10',
'KundenKarteNr': '20088400056241905', 'KundenKarteKennz': 'DC',
'CardStatus': '0', 'WebserviceOffline': 'false', 'CustomerEmail': None,
'TotalPoints': '10', 'MobileDCStatus': None, 'CardType': '1',
'UsableAccount': '296', 'CustomerScan': 'true', 'CurrentAccount': '296',
'WebserviceTransaktionsID': '000201721020171804301730',
'WebserviceErrorId': None, 'BlockedAccount': '0', 'customerID': '5261',
'ExtraPoints': '0.0', 'PreviousCardNr': None})
code=u'required')], 'customer_uid': [ErrorDetail(string=u'This field is
required.', code=u'required')], 'email': [ErrorDetail(string=u'This field
is required.', code=u'required')], 'card': [ErrorDetail(string=u'This field
is required.', code=u'required')]}
```
If I change the serializer fieldnames to the UGLY field names works fine...
but this is not what we want..
Has anyone been aware of new changes that may affect this in the 3.8.2
release?
Thanks in advance.
Successfully installed djangorestframework-3.8.2
```
class CustomerCardSerializer(serializers.Serializer):
customer_id = serializers.CharField(source='customerID')
customer_uid = serializers.CharField(source='CustomerUID')
email = serializers.EmailField(source='CustomerEmail')
card = serializers.CharField(source='KundenKarteNr')
```
```
from blah.apps.default.serializers import CustomerCardSerializer
cc=CustomerCardSerializer(data={'MobileDC': None, 'CustomerUID':
'88B6F5AA-3D7E-2EBE-B968-F73C3992083D', 'BasePoints': '10',
'KundenKarteNr': '20088400056241905', 'KundenKarteKennz': 'DC',
'CardStatus': '0', 'WebserviceOffline': 'false', 'CustomerEmail': None,
'TotalPoints': '10', 'MobileDCStatus': None, 'CardType': '1',
'UsableAccount': '296', 'CustomerScan': 'true', 'CurrentAccount': '296',
'WebserviceTransaktionsID': '000201721020171804301730',
'WebserviceErrorId': None, 'BlockedAccount': '0', 'customerID': '5261',
'ExtraPoints': '0.0', 'PreviousCardNr': None})
cc.is_valid()
Falsecc.errors
{'customer_id': [ErrorDetail(string=u'This field is required.',code=u'required')], 'customer_uid': [ErrorDetail(string=u'This field is
required.', code=u'required')], 'email': [ErrorDetail(string=u'This field
is required.', code=u'required')], 'card': [ErrorDetail(string=u'This field
is required.', code=u'required')]}
```
If I change the serializer fieldnames to the UGLY field names works fine...
but this is not what we want..
Has anyone been aware of new changes that may affect this in the 3.8.2
release?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.