Coverage for control/cust/contrib_details.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from config import Names as N
2from control.details import Details
3from control.html import HtmlElements as H
4from control.utils import pick as G
7class ContribD(Details):
8 """Logic for detail records of contribs.
10 The main point of departure from the standard behaviour is that
11 we *only* want the `assessment` detail records, not the `review` detail
12 records.
14 The reason is that we show assessments in a special way and that reviews are
15 shown inside the assessments.
17 That way, we can present the assessment entries side by side with the reviewer
18 entries.
20 !!! hint
21 If the `contrib` record is not part of the workflow, the behaviour
22 of this class falls back to the base class `control.details.Details`.
23 """
25 def __init__(self, recordObj):
26 super().__init__(recordObj)
28 def wrap(self, *args, **kwargs):
29 wfitem = self.wfitem
30 if not wfitem:
31 return super().wrap(*args, **kwargs)
33 self.fetchDetails(
34 N.assessment, sortKey=lambda r: G(r, N.dateCreated, default=0),
35 )
37 statusRep = wfitem.status(N.contrib)
38 showEid = self.mustShow(N.assessment, kwargs)
40 return H.div([statusRep, self.wrapDetail(N.assessment, showEid=showEid)])