Thanks Todd. That's what I needed. Thought it might be that simple.
On Dec 9, 7:01 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote:
> s = Student.objects.get(pk=student_id)
> if user in s.parents.all():
> // the user is legit
> else:
> // user is not s's guardian
>
> On Dec 9, 2007 6:11 PM
> I want to check if the currently logged in user has permission to edit
> a particular student.
>
> s = Student.objects.get(pk=student_id)
> parents = s.parents.all()
>
> And then check if logged in user.id matches against any of the parent
> ids.
Looks like you're interested in something like
s = Student.objects.get(pk=student_id)
if user in s.parents.all():
// the user is legit
else:
// user is not s's guardian
On Dec 9, 2007 6:11 PM, radioflyer <[EMAIL PROTECTED]> wrote:
>
> I have a m2m relationship between users (guardians) and students.
>
> I want to check if the curren
I have a m2m relationship between users (guardians) and students.
I want to check if the currently logged in user has permission to edit
a particular student.
s = Student.objects.get(pk=student_id)
parents = s.parents.all()
And then check if logged in user.id matches against any of the parent
i
4 matches
Mail list logo