edina / nbexchange

External exchange for nbgrader
Other
6 stars 2 forks source link

rationalise how handlers interact with models #9

Closed perllaghu closed 3 years ago

perllaghu commented 4 years ago

Currently feedback handler queries models thus:

            assignment = (
                session.query(nbexchange.models.assignments.Assignment)
                .filter_by(assignment_code=assignment_id, course_id=course.id)
                .first()
            )

whilst the rest of the handlers do the same thing thus:

            assignment = nbexchange.models.assignments.Assignment.find_by_code(
                db=session,
                code=assignment_code,
                course_id=course.id,
                action=nbexchange.models.actions.AssignmentActions.released.value,
            )

I don't mind which way we go - but I'd like to see consistency.

perllaghu commented 3 years ago

Closed by PR 83 (https://github.com/edina/nbexchange/pull/83/files)