djangoindia / djangoindia.org

Official website of djangoindia community.
https://djangoindia.org
MIT License
63 stars 36 forks source link

[FEATURE] Add event volunteers details in the events response. #102

Open DevilsAutumn opened 3 weeks ago

DevilsAutumn commented 3 weeks ago

Summary

NA

Description

Use Case

No response

Alternatives

No response

Affected Area

Backend

PARTHIB-DEB commented 3 weeks ago

Can I work on this issue ?

DevilsAutumn commented 3 weeks ago

please go ahead @PARTHIB-DEB

PARTHIB-DEB commented 3 weeks ago

How much time is there for this issue ?

DevilsAutumn commented 3 weeks ago

In Opensource , there is no time limit as such because its a "contribution" but if there is anything that needs to be done priority then we assign it to our core team members and get it done faster.

PARTHIB-DEB commented 3 weeks ago

ok . I asked because of the marker to this issue.

btw regarding the 2nd (create functionality to add ..) and 4th (send those volunteers along..) points - do I have to write the serializers and views also ?

regarding the 4th point - I guess , I have to write the code to send emails , right ?

PARTHIB-DEB commented 3 weeks ago

Also I think the EventCreationForm is actually EventForm right ? which means this -

image
PARTHIB-DEB commented 3 weeks ago

This is the Draft PR for this repo. I have made it draft because only few tasks is done , and I will continue later. If you can assign the PR to this issue , it will be beneficial to track the changes.

PR - https://github.com/djangoindia/djangoindia.org/pull/110

Tasks Completed -

DevilsAutumn commented 3 weeks ago

btw regarding the 2nd (create functionality to add ..) and 4th (send those volunteers along..) points - do I have to write the serializers and views also ?

Not for the second one, for 4th one you'll have to modify the event serializers and add the information of volunteers, no need for more views.

regarding the 4th point - I guess , I have to write the code to send emails , right ?

nope, it says you have to send the details of volunteers with the event details API response, something like:

{
"title" : "Django India meetup",
....
...
"volunteers":[
      {
        "name":"Bhuvnesh",
        ...
        ...
        ...
      },
      {
        "name":"Bhuvnesh",
        ...
        ...
        ...
      }
  ],
}
DevilsAutumn commented 3 weeks ago

If you can assign the PR to this issue , it will be beneficial to track the changes.

While creating the PR when you mention the issue no in the description after "closes" (like closes #102) , it automatically links that PR to the mentioned issue.

PARTHIB-DEB commented 3 weeks ago

If you can assign the PR to this issue , it will be beneficial to track the changes.

While creating the PR when you mention the issue no in the description after "closes" (like closes #102) , it automatically links that PR to the mentioned issue.

Ok , Got it . Actually I have never done so much of OS contribution so I am gaining here :)

DevilsAutumn commented 3 weeks ago

No worries, I am here to help. Feel free to ask anything.

PARTHIB-DEB commented 3 weeks ago

Hey , I am a little busy regarding my campus drive in college from yesterday. But I will definitely resume from 28th august :)

PARTHIB-DEB commented 2 weeks ago

but I have one question how are you utilising django-forms (eventform , emailform) in a cross-site django application ? Thats new to me

PARTHIB-DEB commented 2 weeks ago

btw I think you should have one api for volunteers also , maybe api/profile/ where you can differ volunteerprofileview and AttendeeProfileView based on emails or something unique field - just a suggestion :)

PARTHIB-DEB commented 2 weeks ago

Here You have mentioned if request = POST then data will be serialized by EventRegistrationSerializer , otherwise for other request methods like PUT , PATCH , EventSerializer will be used. Then do I have to mention Volunteer Details in both serializers ?

image
DevilsAutumn commented 2 weeks ago

but I have one question how are you utilising django-forms (eventform , emailform) in a cross-site django application ? Thats new to me

these forms are being used in django admin panel which are running at a particular url, see https://github.com/djangoindia/djangoindia.org/blob/main/backend/djangoindia/urls.py#L28 Other urls are endpoints for rest apis.

DevilsAutumn commented 2 weeks ago

btw I think you should have one api for volunteers also , maybe api/profile/ where you can differ volunteerprofileview and AttendeeProfileView based on emails or something unique field - just a suggestion :)

This is a big feature which is going to take quite a time, at this point our aim to quickly complete basic/easy functionalities related to events so that we can start conducting events asap.

PARTHIB-DEB commented 2 weeks ago

btw I think you should have one api for volunteers also , maybe api/profile/ where you can differ volunteerprofileview and AttendeeProfileView based on emails or something unique field - just a suggestion :)

This is a big feature which is going to take quite a time, at this point our aim to quickly complete basic/easy functionalities related to events so that we can start conducting events asap.

Okk , sounds cool . Maybe I can help here also :)

DevilsAutumn commented 2 weeks ago

Here You have mentioned if request = POST then data will be serialized by EventRegistrationSerializer , otherwise for other request methods like PUT , PATCH , EventSerializer will be used. Then do I have to mention Volunteer Details in both serializers ?

image

No changes are required here(Except some in queryset). You'll have to do something similar done in #111 , just create a new volunteer serializer and add that in event serializer.

PARTHIB-DEB commented 2 weeks ago

In EventAPIView to get details about a single event , one should give a pk which of uuid type. But in event model there is no such field although in EventSerializer there is an id field of uuid type . But how will you query the database if that field is not saved in it. (I know UUID is randomly generated , so maybe without giving uuid as pk , you can give event-name as pk in the url)

image
DevilsAutumn commented 2 weeks ago

In EventAPIView to get details about a single event , one should give a pk which of uuid type. But in event model there is no such field although in EventSerializer there is an id field of uuid type . But how will you query the database if that field is not saved in it. (I know UUID is randomly generated , so maybe without giving uuid as pk , you can give event-name as pk in the url)

The concepts we are using here are abstraction and inheritance. See if you can find out where and how.

PARTHIB-DEB commented 2 weeks ago

Oh again I missed. Yeah The basemodel :)

PARTHIB-DEB commented 2 weeks ago

I think pretty much every target is completed . Although I am not getting the 2nd one actually .

DevilsAutumn commented 2 weeks ago

you can still refer the above mentioned pr, in that we are creating sponsorship from the events form.

PARTHIB-DEB commented 2 weeks ago

Okk lemme see . Till then , please tell me if there is something wrong in my code :)

PARTHIB-DEB commented 2 weeks ago

You can now see all mergable updates of this issue at #118 PR

PARTHIB-DEB commented 2 weeks ago

I think you have started some part of the 2nd task :) image

PARTHIB-DEB commented 2 weeks ago

btw the eventform is not having any volunteer related fields , it is following event model. rather I think I should create a new form for eventvolunteer model and do the rest like same in admin.py

DevilsAutumn commented 2 weeks ago

I think you have started some part of the 2nd task :)

Do you really think that if someone is working on a feature, everyone else waits before his code gets merged? Its not done like that.

PARTHIB-DEB commented 2 weeks ago

Yeah ! I also know that but actually I was busy due to my campus drive , so didn't finished , but yeah now I am doing the rest part. :)

PARTHIB-DEB commented 2 weeks ago

Solved the 2nd task - Use EventCreationForm to add volunteer details in django-admin. Have a look and tell me if I have done anything wrong.

Note : The form and the admin class is built seperately because event model has no field of volunteer details so I thought it would be a better approach.