[Fixed]-Django get choices value in lazy query

1πŸ‘

βœ…

I don’t think you can do that without querying every objects.

I would suggest,

[(x.name, x.get_choices_display(), ) for x in Blog.objects.all()]

If you want to one shot it.

If you want to use this on a regular basis you could create a method in yout Blog model.

πŸ‘€v.thorey

Leave a comment