Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

src/p/o/portfoliyo-HEAD/portfoliyo/view/village/views.py   portfoliyo(Download)
    else:
        group = get_object_or_404(
            model.Group.objects.filter(owner=request.user.profile),
            id=group_id,
            )
def invite_teacher_to_group(request, group_id):
    """Invite teacher to a group."""
    group = get_object_or_404(
        model.Group.objects.filter(owner=request.user.profile), id=group_id)
 
    else:
        group = get_object_or_404(
            model.Group.objects.filter(owner=request.user.profile),
            id=group_id,
            )
    elif group_id is not None:
        group = get_object_or_404(
            model.Group.objects.filter(owner=request.user.profile), pk=group_id)
        target = group
        redirect_url = reverse('group', kwargs={'group_id': group_id})
        if group_id is not None:
            group = get_object_or_404(model.Group.objects.filter(
                    owner=request.user.profile), pk=group_id)
        else:
            group = model.AllStudentsGroup(request.user.profile)

src/p/o/portfoliyo-HEAD/portfoliyo/view/village/forms.py   portfoliyo(Download)
        super(InviteTeacherForm, self).__init__(*args, **kwargs)
        self.fields['groups'].queryset = model.Group.objects.filter(
            owner=self.inviter)
        self.fields['students'].queryset = model.Profile.objects.filter(
            relationships_to__from_profile=self.inviter)
        super(StudentForm, self).__init__(*args, **kwargs)
        self.fields['groups'].queryset = model.Group.objects.filter(
            owner=self.elder)
        elder_conditions = Q(school=self.elder.school)
        # explicitly allow already-related elders when editing