Dear All,
I am working on rest framework api and trying to get data from two models. 
like this
class UserAllNFTS(viewsets.ModelViewSet):
"""
Fetchig all nfts for home page data
"""
if(UserNFTDetails.objects.filter(nft_product_status=0).exists()):
nft_image = ''
minted_nfts = []
userData = UserNFTDetails.objects.filter(nft_product_status=0)
for nftdata in userData:
#### fetching product images 
userTotalInfo = UserNFTInfo.objects.get(product_id = nftdata.product_id)
product_image = userTotalInfo.product_image
#### fetching creator image & creator name
creatordata = UserRegister.objects.get(id = nftdata.user_id)
creator_name = creatordata.user_full_name
creator_image = creatordata.userimage
#### fetching total likes of products
if ProductTotalLikes.objects.filter(product_id = 
nftdata.product_id).exists():
pro_data = ProductTotalLikes.objects.get(product_id = nftdata.product_id)
product_total_likes = str(pro_data.total_likes)
else:
product_total_likes = 0
minted_nfts.append(
{
"nft_productID":nftdata.product_id,
"nft_title":nftdata.nft_title,
"nft_descriptions":nftdata.nft_descriptions,
"nft_collection":nftdata.nft_collection,
"nft_price":nftdata.nft_price,
"nft_royalties":nftdata.nft_royalties,
"nft_image":product_image,
"symbol": userTotalInfo.symbol,
"creator_name":creator_name,
"profile_image":'uploads/'+str(creator_image), 
"total_likes":product_total_likes
}
)
serializer_class = UserSerializer

and i got error 
 assert queryset is not None, '`basename` argument not specified, and could 
' \
AssertionError: `basename` argument not specified, and could not 
automatically determine the name from the viewset, as it does not have a 
`.queryset` attribute.

Please help me.

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/1b413aa9-ae28-4e76-bafe-b7c8f930f0fan%40googlegroups.com.

Reply via email to