esal = serializers.FloatField (обязательно = False) NameError: имя 'serializers' не определено
serializers.py:
from rest_framework import serializers
from restapp.models import employee
class EmployeeSerializer(serializers.ModelSerializer):
esal=serializers.FloatField(required=False)
class Meta:
model=employee
fields='__all__'
models.py:
class employee(models.Model):
eno = models.IntegerField()
ename = models.CharField(max_length=60)
esal = models.FloatField()
eaddr = models.CharField(max_length=100)