Django: AttributeError: class Meta has no attribute 'model' -


using django 1.7.2 , djangorestframework==3.0.2

getting error attributeerror: class meta has no attribute 'model'

class notificationcountserializer(serializers.serializer):    ------    ------      class meta:         fields = ('drivers_count', 'vehicles_count', 'maps_count') 

although same code working django==1.8 , djangorestframework==3.2.3

is issue django or djangorestframework version ?

the issue version of django.

from 1.8 changelog:


what’s new in django 1.8

model._meta api

django has formalized api model._meta, providing officially supported way retrieve fields , filter fields based on attributes.

the model._meta object has been part of django since days of pre-0.96 “magic removal” – wasn’t official, stable api. in recognition of this, we’ve endeavored maintain backwards-compatibility old api endpoint possible. however, api endpoints aren’t part of new official api have been deprecated , removed. guide migrating old api new api has been provided


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -