python - Django MongoEngine/REST Framework ListFields -
i need store list of numbers within mongo db field , present via rest framework.
so far (for other fields) working need figure out list there no direct option django orm.
serializes
class tyre(serializers.serializer): enabled = serializers.listfield() tyre_pressure = serializers.integerfield()
models
from mongoengine import * class tyre(embeddeddocument): enabled = listfield() <----- issue... tyre_pressure = intfield()
any ideas ?
the reason couldnt use feild version of rest 2.6. once upgraded 3.0 , used following. worked expected.
enabled = serializers.listfield( child=serializers.integerfield(min_value=0, max_value=4096) )
Comments
Post a Comment