Open davebridges opened 11 years ago
Should be a formset, with rows for each member of the cohort and columns for all Measurement values. Need to filter the formset to show only animals in this cohort, something like this taken from http://stackoverflow.com/a/10159363/145318:
def get_context_data(self, **kwargs): context = super(AddPhotoToProject, self).get_context_data(**kwargs) context['photo'] = self.kwargs['pk'] context['form'].fields['project'].queryset = Project.objects.for_user(self.request.user) return context
also need to figure out how to use formsets in generic class based views.
For implementation of a formset, since FormSetView is not yet implemented, see http://haineault.com/blog/155/
Should be a formset, with rows for each member of the cohort and columns for all Measurement values. Need to filter the formset to show only animals in this cohort, something like this taken from http://stackoverflow.com/a/10159363/145318:
also need to figure out how to use formsets in generic class based views.