File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,9 +56,34 @@ def get_rfc_number(doc):
5656 qs = doc .docalias_set .filter (name__startswith = 'rfc' )
5757 return qs [0 ].name [3 :] if qs else None
5858
59+ def augment_with_start_time (docs ):
60+ """Add a started_time attribute to each document with the time of
61+ the first revision."""
62+ docs = list (docs )
63+
64+ docs_dict = {}
65+ for d in docs :
66+ docs_dict [d .pk ] = d
67+ d .start_time = None
68+
69+ seen = set ()
70+
71+ for e in DocEvent .objects .filter (type = "new_revision" , doc__in = docs ).order_by ('time' ):
72+ if e .doc_id in seen :
73+ continue
74+
75+ print e .time , e .doc_id
76+
77+ docs_dict [e .doc_id ].start_time = e .time
78+ seen .add (e .doc_id )
79+
80+ return docs
81+
5982def augment_with_telechat_date (docs ):
6083 """Add a telechat_date attribute to each document with the
6184 scheduled telechat or None if it's not scheduled."""
85+ docs = list (docs )
86+
6287 docs_dict = {}
6388 for d in docs :
6489 docs_dict [d .pk ] = d
You can’t perform that action at this time.
0 commit comments