# views.py
import schedule_update.send_the_result
class UpdatedTypeViewSet(viewsets.ModelViewSet):
queryset = Updated_Type.objects.all()
serializer_class = UpdatedTypeSerializer
# Is it correct to code here, if I would like to call function when post request succeed, and how?
# send_to_redmine.py
def Send_The_Result():
# get the data from request and send it to redmine.
if __name__ == '__main__':
Send_The_Result()
Here's my source code and there're 2 questions that I stuck in Modelviewset.
- Is it possible to call Send_The_Result when post request succeed in Modelviewset?
- When the post request sent, how do I bring the data into Send_The_Result?
Please let me know, if any further information is needed, thank you.