Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IUFC-758 #567

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

IUFC-758 #567

wants to merge 10 commits into from

Conversation

verpoorten
Copy link
Contributor

No description provided.

@verpoorten verpoorten self-assigned this Apr 28, 2022
}
return xls_build.generate_xls(
list_parameters=xls_build.prepare_xls_parameters_list(working_sheets_data, parameters),
filters=_get_filter(prospect_filter_form)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

la méthode _get_filter n'est plus vraiment privée si elle est utilisée dans un autre contexte, tu peux la renommer en get_filter

@@ -152,5 +174,12 @@ <h2>{% trans 'Prospects' %}</h2>
$("#prospects_form").attr("action", url);
$("#prospects_form").submit();
});

$("#btn_produce_prospects_xls").click(function(e) {
console.log('iii');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log

if search_form.is_valid():
prospects_list = search_form.get_propects_with_filter()
else:
prospects_list = Prospect.objects.none()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ne faut-il pas afficher un message d'erreur si le formulaire est non valide ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathieuzen En fait dans le cadre des prospects, je pense que rien ne peut être invalide ....Donc je vois pas trop ce que je pourrais afficher???

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search_form est toujours valide ? Si oui alors pas besoin de faire le else j'imagine...

forms/search.py Outdated
person_trainings = ContinuingEducationTrainingManager.objects.filter(
person=user.person
).values_list('training', flat=True)
return Prospect.objects.filter(formation_id__in=person_trainings)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return Prospect.objects.filter(
   formation__person=user.person
).select_related(
   'formation__education_group'
).prefetch_related(
   'formation__education_group__educationgroupyear_set'
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenJneB QQ ch cloche dans la suggestion ici

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peut-être plutot ceci alors :

return Prospect.objects.filter(
   formation__continuingeducationtrainingmanager__person=user.person
).select_related(
   'formation__education_group'
).prefetch_related(
   'formation__education_group__educationgroupyear_set',
   'formation__continuingeducationtrainingmanager_set'
)

forms/search.py Outdated Show resolved Hide resolved
forms/search.py Outdated Show resolved Hide resolved
forms/search.py Outdated Show resolved Hide resolved
Leïla Verpoorten added 3 commits May 2, 2022 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants