hmpf / easydmp

MIT License
7 stars 2 forks source link

Refactor generated plans #179

Closed hmpf closed 3 years ago

hmpf commented 3 years ago

Move the context-buildup and rendering out of the view so it can be reused elsewhere.

Fixes #178

codecov[bot] commented 3 years ago

Codecov Report

Merging #179 (5052815) into master (a5d159b) will increase coverage by 0.04%. The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #179      +/-   ##
==========================================
+ Coverage   55.39%   55.43%   +0.04%     
==========================================
  Files         108      108              
  Lines        5972     5978       +6     
==========================================
+ Hits         3308     3314       +6     
  Misses       2664     2664              
Impacted Files Coverage Δ
src/easydmp/plan/views/__init__.py 32.90% <86.36%> (+0.65%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a5d159b...5052815. Read the comment docs.

hmpf commented 3 years ago

The actual function could maybe be moved elsewhere: easydmp.plan.utils, say. I'd rather not put it on the model, though we could have the context-builder on the model.

hmpf commented 3 years ago

We could also have fixed functions per format so that sending around the template name becomes unnecessary. Much is possible!

Anyway, the important point is disconnecting the rendering from the response, The CLI need no response since it can spit out a file directly, and the API has its own response class.