def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    self.parent_project = self.context['parent']
    user = self.context['request'].user
    self.fields['child'].queryset = self.parent_project.get_subproject_candidates(user)
    self.fields['child'].error_messages['does_not_exist'] = _('Project with {slug_name}={value} is not valid as subproject')
def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    self.parent_project = self.context['parent']
    user = self.context['request'].user
    self.fields['child'].queryset = self.parent_project.get_subproject_candidates(user)
    self.fields['child'].error_messages['does_not_exist'] = _('Project with {slug_name}={value} is not valid as subproject')