I have a model, for example, A has a field xxx (ManyToManyField with B model). How can I query and return like:
{
'f1': 'xxx',
'f2': 'yyy',
photos: [{photo1}, {photo2},...]
}
Any help is appreciated. I'm django newbie :D
I have a model, for example, A has a field xxx (ManyToManyField with B model). How can I query and return like:
{
'f1': 'xxx',
'f2': 'yyy',
photos: [{photo1}, {photo2},...]
}
Any help is appreciated. I'm django newbie :D