activist
activist copied to clipboard
Events API
Terms
- [X] I have searched open and closed feature requests
- [X] I agree to follow activist's Code of Conduct
Description
We are starting with creating the API's that will be used by the frontend in production soon 😃.
We are using django-rest-framework in the backend to create our API's. ViewSets in particular the ModelViewSet are used for creating the different HTTP methods. Another benefit of using the ModelViewSet is that we are getting some validation from the model itself and only need to extend that in the serializer if necessary.
Have look at the scheme and the models.py file.
Task is to implement all these methods for the OrganizationViewSet that represent the different HTTP methods:
def list(self, request):
pass
def create(self, request):
pass
def retrieve(self, request, pk=None):
pass
def update(self, request, pk=None):
pass
def partial_update(self, request, pk=None):
pass
def destroy(self, request, pk=None):
pass
The API generally is a combiniation of:
- views.py
- serializer.py
- models.py
Also feel free to suggest changes to the model, in case it is necessary for the logic. They are not set in stone 😃. In terms of testing, you can use Swagger UI for manuall testing (backend endpoint: /v1/schema/swagger-ui/).
[!NOTE] Please use an appropiate http status code for your responses.
Contribution
I am happy to help with this issue.
Do you want to work on this issue @bharath637462 ?
Yes @bharath637462, let's keep it to one API for now :)
We can work on others as soon as some are finished.
yes @to-sta
Let's please finish the work for the current frontend issue before starting on this one as well, @bharath637462.
@to-sta but event has already api written on it class EventViewSet(viewsets.ModelViewSet[Event]): queryset = Event.objects.all() serializer_class = EventSerializer pagination_class = CustomPagination throttle_classes = [AnonRateThrottle, UserRateThrottle]
at backend/events/views.py
what shold i do could you please explain breifly
@bharath637462, this is the PR for resources. That would roughly be what we're looking for :)
Hi @andrewtavis, was wondering if this issue is still open and what is needed to be done. I am looking at another issue #621 as well. Do let me know which issue you would like me to work on.
Hey @UnknownSean8 👋 We're holding off on this issue for now. If you had thoughts on #621 then by all means write in there as we definitely need to think about how locations will be modeled on the platform. Your input would be invaluable! Also let me know on #527 as I mentioned most in the close of the other one you worked on :)
Ah okay, no problem, I am happy to work on #527. I saw that it's referencing #597 as well. Perhaps you could highlight the features/fixes that you would like me to work on so that I can better implement what you had in mind and assign me to it as well?
Thanks :D
Thank you, @UnknownSean8! Do you want to write in there so I can assign and we can go from there with me outlining it more?
Hi @andrewtavis, are we still holding off on this issue?
I think it'd be alright for you to give this a go, @josueemartinezz :) Let us know if you need any help here!