Guest User

Untitled

a guest
Aug 23rd, 2018
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. >>> from app.models import *
  2. >>> from app.serializers import *
  3. >>> FoodCuisine.objects.get(id=2)
  4. <FoodCuisine: Indian>
  5. >>> x=FoodCuisine.objects.get(id=2)
  6. >>> y = FoodCuisineSerializer(x)
  7. >>> y
  8. FoodCuisineSerializer(<FoodCuisine: Indian>):
  9. cuisine = CharField(max_length=64)
  10. cuisine_type = CuisineTypesSerializer(many=True, read_only=True):
  11. cuisine_types = CharField(max_length=64)
  12. foods = FoodSerializer(many=True, read_only=True):
  13. name = CharField(max_length=192)
  14. veg = BooleanField(required=False)
  15. >>> y.data
  16. {'cuisine': 'Indian'}
  17. >>>
Add Comment
Please, Sign In to add comment