-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: dev
Are you sure you want to change the base?
IUFC-758 #567
Conversation
business/xls/xls_prospect.py
Outdated
} | ||
return xls_build.generate_xls( | ||
list_parameters=xls_build.prepare_xls_parameters_list(working_sheets_data, parameters), | ||
filters=_get_filter(prospect_filter_form) |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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???
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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'
)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'
)
No description provided.