Skip to content

Instantly share code, notes, and snippets.

@SamsadSajid
Created October 19, 2017 05:10
Show Gist options
  • Save SamsadSajid/2ee0b872a948081f8c1ef7678f2da230 to your computer and use it in GitHub Desktop.
Save SamsadSajid/2ee0b872a948081f8c1ef7678f2da230 to your computer and use it in GitHub Desktop.
TO: sikkhanobish
"""
I want to do something like this:
"""
class Meta:
permissions = (
('view_task', 'View task'),
)
group = Group.objects.create(name='employees')
assign_perm('change_task', group, task)
user.groups.add(group)
user.has_perm('change_task', task)
"""
But in which directory shoul I use it? In views.py??
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment