Create custom Json

44 views
Skip to first unread message

Neha001

unread,
Apr 28, 2023, 9:43:08 PM4/28/23
to django-res...@googlegroups.com
Hi 

I have a model app_interfacewhich has a foreign key to applicationsmodel and two many to many relation to NodesModel through model provider and another many to many relation to NodesModel through model consumer. 
NodesModel has foreign key to appfunc, tiertype, place.. 

Sample class
Class app_interface(model.model) :
app=model.ForeignKey(Applications) 
providersdata= model. Manytomany(NodesModel, through=provider, related_name=provider_data) 
consumersdata= model. Manytomany(NodesModel, through=consumer) related_name=consumer_data

Class NodeModel(model.model) :

Appfunc=models.ForeignKey(AppFuncModel) 
tiertype=models.ForeignKey(Tiertypemodel) 
Place=models.ForeignKey(placemodel)


I need to use app_interface model in my app to get all the data in my serializers. Many to many data like appfunc data, tiertype etc using appinterface to create json. 


Thanks 
Neha
Reply all
Reply to author
Forward
0 new messages