Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events API #628

Open
2 tasks done
to-sta opened this issue Dec 26, 2023 · 13 comments
Open
2 tasks done

Events API #628

to-sta opened this issue Dec 26, 2023 · 13 comments
Assignees
Labels
python Pull requests that update Python code

Comments

@to-sta
Copy link
Collaborator

to-sta commented Dec 26, 2023

Terms

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.

@to-sta to-sta added feature New feature or request python Pull requests that update Python code labels Dec 26, 2023
@to-sta
Copy link
Collaborator Author

to-sta commented Dec 26, 2023

Do you want to work on this issue @bharath637462 ?

@andrewtavis
Copy link
Member

Yes @bharath637462, let's keep it to one API for now :)

@andrewtavis
Copy link
Member

We can work on others as soon as some are finished.

@bharath637462
Copy link
Contributor

yes @to-sta

@andrewtavis
Copy link
Member

Let's please finish the work for the current frontend issue before starting on this one as well, @bharath637462.

@to-sta to-sta added the blocked Another issue is blocking label Dec 26, 2023
@bharath637462
Copy link
Contributor

@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

@andrewtavis
Copy link
Member

@bharath637462, this is the PR for resources. That would roughly be what we're looking for :)

@UnknownSean8
Copy link
Contributor

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.

@andrewtavis
Copy link
Member

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 :)

@UnknownSean8
Copy link
Contributor

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

@andrewtavis
Copy link
Member

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?

@josueemartinezz
Copy link

Hi @andrewtavis, are we still holding off on this issue?

@andrewtavis
Copy link
Member

I think it'd be alright for you to give this a go, @josueemartinezz :) Let us know if you need any help here!

@andrewtavis andrewtavis removed the blocked Another issue is blocking label Mar 3, 2024
@andrewtavis andrewtavis moved this from Todo to In Progress in activist Board Mar 3, 2024
@josueemartinezz josueemartinezz mentioned this issue Mar 13, 2024
1 task
@andrewtavis andrewtavis removed the feature New feature or request label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
Status: In Progress
Development

No branches or pull requests

5 participants