davebridges / mousedb

Django Based Database System for Experimental Subjects
http://davebridges.github.com/mousedb
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Write a Data Entry View for A Cohort #41

Open davebridges opened 11 years ago

davebridges commented 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.

davebridges commented 11 years ago

For implementation of a formset, since FormSetView is not yet implemented, see http://haineault.com/blog/155/