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

Organization API #627

Closed
2 tasks done
to-sta opened this issue Dec 26, 2023 · 9 comments
Closed
2 tasks done

Organization API #627

to-sta opened this issue Dec 26, 2023 · 9 comments
Assignees
Labels
-priority- High priority feature New feature or request 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
@andrewtavis andrewtavis added the -priority- High priority label Dec 26, 2023
@andrewtavis andrewtavis self-assigned this Dec 26, 2023
@andrewtavis
Copy link
Member

I'll take this one, @to-sta 😊 We can also make ones for organizations and FAQs as well to round out the main things from the start, and then maybe events. As you see fit :) :)

@to-sta
Copy link
Collaborator Author

to-sta commented Dec 26, 2023

hmm I was thinking about starting with the main tables:

  • resources
  • organizations
  • event
  • topic
  • task

What table/model represents the for example FAQ?

@bharath637462
Copy link
Contributor

@to-sta can i create api for
resources
organizations
event
topic
task
below tables?

@Jackblanket847
Copy link

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

@andrewtavis andrewtavis mentioned this issue Jan 28, 2024
2 tasks
@josueemartinezz
Copy link

Hi @andrewtavis, I know you're currently assigned to this issue, but I still wanted to see how progress has been going and see if I could come up with a fix to the issue for my learning.

From my understanding, 4 of the 6 specified HTTP methods have already been completed in /activist/backend/entities/views.py, so would some tasks involve refactoring the Organization app into its own sub-folder as commented in #671? If refactoring is preferred, what would models would encompass models.py since most, if not all, would be passed into their respective API sub-folders like /entitites/organizations and /entities/groups. Thanks!

@andrewtavis
Copy link
Member

Hey @josueemartinezz 👋 I think that @to-sta is mostly finalizing this at this point. We'll be doing a sync to finalize this this weekend, but there should be more backend issues after that! If you find another, please write in and we'll do our best to assign you :)

@josueemartinezz
Copy link

Hey @josueemartinezz 👋 I think that @to-sta is mostly finalizing this at this point. We'll be doing a sync to finalize this this weekend, but there should be more backend issues after that! If you find another, please write in and we'll do our best to assign you :)

Ah, I see, I'll keep an eye out for to-sta's pull request. Thanks for your response! Looking forward to contribute :)

@andrewtavis
Copy link
Member

Looking forward to your contribution! :)

@andrewtavis andrewtavis assigned to-sta and unassigned andrewtavis Mar 17, 2024
@andrewtavis andrewtavis moved this from Todo to In Progress in activist Board Mar 17, 2024
@andrewtavis
Copy link
Member

Closed via #629. Thank you, @to-sta! 🙏🙏

@github-project-automation github-project-automation bot moved this from In Progress to Done in activist Board Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-priority- High priority feature New feature or request python Pull requests that update Python code
Projects
Archived in project
Development

No branches or pull requests

5 participants