aditbiswas1 / ie-site

2 stars 2 forks source link

SIG specific Module #3

Open aditbiswas1 opened 10 years ago

aditbiswas1 commented 10 years ago

step 1

SIG's should have content page for themselves, which can be maintained by respective SIG heads, representitives and members. To do this we will make a seperate django-app for SIG, introduce an SIG model with basic attributes:

add the SIG module to admin page, figure out a way to give group specific permissions admin - can add, edit and delete SIG, sig_head can edit only

create a view for the SIG page, simple no styling required atm.. keep url slug as /sig/:sig_name

aditbiswas1 commented 10 years ago

stage 2:

make a model for ie club members, for now take basic details only Name: batch: description : optional sig: many-to-many foreign key with sigs,

the members will need to be automatically assigned permissions based on SIG's opted for, such as group_member or code sig SIG heads and coordinators need to be assigned from admin itself

aditbiswas1 commented 10 years ago

stage 3

create a model for project, article and events we'll discuss the models in future after first 2 are done

rohitvarkey commented 10 years ago

On the permissions front, there's this package called django-guardian. While django only lets us set permission's on a model wise basis, this lets us create permissions on an instance level.

So what I was thinking of doing to give the only the SIG head permission was to define a custom permission(say "edit_sig_content") inside the SIGroup model and then, assigning it to only the SIG head along with the instance of his/her SIG. So they can edit only their respective SIG's.

For automatically assigning permissions based on SIG, I wrote an event handler looking for changes in the ManyToManyField between SIG's and ClubMembers and used that to revoke and assign permissions.

Also be wary of screwing up the south migrations installing guardian. I did and it's been a pain to work with after that.