Proxy state help page

- Legacy-Id: 3101
This commit is contained in:
Ole Laursen 2011-05-06 17:04:16 +00:00
parent 7343ba8f28
commit 5422874e3e
3 changed files with 115 additions and 20 deletions

View file

@ -1090,11 +1090,12 @@ if settings.USE_DB_REDESIGN_PROXY_CLASSES:
InternetDraftOld = InternetDraft
IDInternalOld = IDInternal
BallotInfoOld = BallotInfo
IDStateOld = IDState
IDSubStateOld = IDSubState
AreaOld = Area
AcronymOld = Acronym
from redesign.doc.proxy import InternetDraft, IDInternal, BallotInfo
from redesign.group.proxy import Area
from redesign.group.proxy import Acronym
from redesign.doc.proxy import InternetDraft, IDInternal, BallotInfo, IDState, IDSubState
from redesign.group.proxy import Area, Acronym
# changes done by convert-096.py:changed maxlength to max_length

View file

@ -324,18 +324,17 @@ class InternetDraft(Document):
#cur_state = models.ForeignKey(IDState, db_column='cur_state', related_name='docs')
@property
def cur_state(self):
return self.iesg_state
return IDState().from_old_object(self.iesg_state)
@property
def cur_state_id(self):
# FIXME: results in wrong sort order
return abs(hash(self.iesg_state.slug))
return self.iesg_state.order if self.iesg_state else None
#prev_state = models.ForeignKey(IDState, db_column='prev_state', related_name='docs_prev')
@property
def prev_state(self):
ds = self.dochistory_set.exclude(iesg_state=self.iesg_state).order_by('-time')[:1]
return ds[0].iesg_state if ds else None
return IDState().from_old_object(ds[0].iesg_state) if ds else None
#assigned_to = models.CharField(blank=True, max_length=25) # unused
@ -373,20 +372,22 @@ class InternetDraft(Document):
@property
def cur_sub_state(self):
s = self.tags.filter(slug__in=['extpty', 'need-rev', 'ad-f-up', 'point'])
return s[0] if s else None
return IDSubState().from_old_object(s[0]) if s else None
@property
def cur_sub_state_id(self):
s = self.cur_sub_state
return 1 if s else 0 # need to return something numeric
return s.order if s else None
#prev_sub_state = BrokenForeignKey(IDSubState, related_name='docs_prev', null=True, blank=True, null_values=(0, -1))
@property
def prev_sub_state(self):
ds = self.dochistory_set.all().order_by('-time')[:1]
return "|".join(ds[0].tags.all()) if ds else None
substates = ds[0].tags.filter(slug__in=['extpty', 'need-rev', 'ad-f-up', 'point']) if ds else None
return IDSubState().from_old_object(substates[0]) if substates else None
@property
def prev_sub_state_id(self):
return 0
s = self.prev_sub_state
return s.order if s else None
#returning_item = models.IntegerField(null=True, blank=True)
@property
@ -545,7 +546,7 @@ class InternetDraft(Document):
res = []
def add(ad, pos):
from person.proxy import IESGLogin as IESGLoginProxy
res.append(dict(ad=IESGLoginProxy(ad), pos=Position(pos) if pos else None))
res.append(dict(ad=IESGLoginProxy(ad), pos=Position().from_old_object(pos) if pos else None))
found = set()
for pos in BallotPositionEvent.objects.filter(doc=self, type="changed_ballot_position", ad__in=active_ads).select_related('ad').order_by("-time", "-id"):
@ -754,10 +755,11 @@ class DocumentComment(Event):
class Position(BallotPositionEvent):
def __init__(self, base):
def from_old_object(self, base):
for f in base._meta.fields:
if not f.name in ('discuss',): # don't overwrite properties
setattr(self, f.name, getattr(base, f.name))
return self
#ballot = models.ForeignKey(BallotInfo, related_name='positions')
@property
@ -779,9 +781,12 @@ class Position(BallotPositionEvent):
return self.pos_id == "abstain"
#approve = models.IntegerField(default=0) # unused
#discuss = models.IntegerField()
@property
def discuss(self):
# needs special treatment because of clash with attribute on base class
def get_discuss(self):
return self.pos_id == "discuss"
def set_discuss(self, x):
pass
discuss = property(get_discuss, set_discuss)
#recuse = models.IntegerField()
@property
def recuse(self):
@ -797,3 +802,92 @@ class Position(BallotPositionEvent):
return ' '
class Meta:
proxy = True
class IDState(IesgDocStateName):
PUBLICATION_REQUESTED = 10
LAST_CALL_REQUESTED = 15
IN_LAST_CALL = 16
WAITING_FOR_WRITEUP = 18
WAITING_FOR_AD_GO_AHEAD = 19
IESG_EVALUATION = 20
IESG_EVALUATION_DEFER = 21
APPROVED_ANNOUNCEMENT_SENT = 30
AD_WATCHING = 42
DEAD = 99
DO_NOT_PUBLISH_STATES = (33, 34)
def from_old_object(self, base):
for f in base._meta.fields:
setattr(self, f.name, getattr(base, f.name))
return self
#document_state_id = models.AutoField(primary_key=True)
@property
def document_state_id(self):
return self.order
#state = models.CharField(max_length=50, db_column='document_state_val')
@property
def state(self):
return self.name
#equiv_group_flag = models.IntegerField(null=True, blank=True) # unused
#description = models.TextField(blank=True, db_column='document_desc')
@property
def description(self):
return self.desc
@property
def nextstate(self):
# simulate related queryset
from name.models import get_next_iesg_states
return IDState.objects.filter(pk__in=[x.pk for x in get_next_iesg_states(self)])
@property
def next_state(self):
# simulate IDNextState
return self
def __str__(self):
return self.state
@staticmethod
def choices():
return [(state.slug, state.name) for state in IDState.objects.all()]
class Meta:
proxy = True
class IDSubStateManager(models.Manager):
def all(self):
return self.filter(slug__in=['extpty', 'need-rev', 'ad-f-up', 'point'])
class IDSubState(DocInfoTagName):
objects = IDSubStateManager()
def from_old_object(self, base):
for f in base._meta.fields:
setattr(self, f.name, getattr(base, f.name))
return self
#sub_state_id = models.AutoField(primary_key=True)
@property
def sub_state_id(self):
return self.order
#sub_state = models.CharField(max_length=55, db_column='sub_state_val')
@property
def sub_state(self):
return self.name
#description = models.TextField(blank=True, db_column='sub_state_desc')
@property
def description(self):
return self.desc
def __str__(self):
return self.sub_state
class Meta:
proxy = True

View file

@ -94,7 +94,7 @@ iesg_state_mapping = {
'AD is watching': name(IesgDocStateName, "watching", "AD is watching", 'An AD is aware of the document and has chosen to place the document in a separate state in order to keep a closer eye on it (for whatever reason). Documents in this state are still not being actively tracked in the sense that no formal request has been made to publish or advance the document. The sole difference between this state and "I-D Exists" is that an AD has chosen to put it in a separate state, to make it easier to keep track of (for the AD\'s own reasons).', order=42),
'IESG Evaluation': name(IesgDocStateName, "iesg-eva", "IESG Evaluation", 'The document is now (finally!) being formally reviewed by the entire IESG. Documents are discussed in email or during a bi-weekly IESG telechat. In this phase, each AD reviews the document and airs any issues they may have. Unresolvable issues are documented as "discuss" comments that can be forwarded to the authors/WG. See the description of substates for additional details about the current state of the IESG discussion.', order=20),
'AD Evaluation': name(IesgDocStateName, "ad-eval", "AD Evaluation", 'A specific AD (e.g., the Area Advisor for the WG) has begun reviewing the document to verify that it is ready for advancement. The shepherding AD is responsible for doing any necessary review before starting an IETF Last Call or sending the document directly to the IESG as a whole.', order=11),
'Last Call Requested': name(IesgDocStateName, "lc-req", "Last Call requested", 'The AD has requested that the Secretariat start an IETF Last Call, but the the actual Last Call message has not been sent yet.', order=15),
'Last Call Requested': name(IesgDocStateName, "lc-req", "Last Call Requested", 'The AD has requested that the Secretariat start an IETF Last Call, but the the actual Last Call message has not been sent yet.', order=15),
'In Last Call': name(IesgDocStateName, "lc", "In Last Call", 'The document is currently waiting for IETF Last Call to complete. Last Calls for WG documents typically last 2 weeks, those for individual submissions last 4 weeks.', order=16),
'Publication Requested': name(IesgDocStateName, "pub-req", "Publication Requested", 'A formal request has been made to advance/publish the document, following the procedures in Section 7.5 of RFC 2418. The request could be from a WG chair, from an individual through the RFC Editor, etc. (The Secretariat (iesg-secretary@ietf.org) is copied on these requests to ensure that the request makes it into the ID tracker.) A document in this state has not (yet) been reviewed by an AD nor has any official action been taken on it yet (other than to note that its publication has been requested.', order=10),
'RFC Ed Queue': name(IesgDocStateName, "rfcqueue", "RFC Ed Queue", 'The document is in the RFC editor Queue (as confirmed by http://www.rfc-editor.org/queue.html).', order=31),
@ -124,16 +124,16 @@ ballot_position_mapping[None] = ballot_position_mapping["No Record"]
ballot_position_mapping["Undefined"] = ballot_position_mapping["No Record"]
substate_mapping = {
"External Party": name(DocInfoTagName, 'extpty', "External Party", 'The document is awaiting review or input from an external party (i.e, someone other than the shepherding AD, the authors, or the WG). See the "note" field for more details on who has the action.'),
"Revised ID Needed": name(DocInfoTagName, 'need-rev', "Revised ID Needed", 'An updated ID is needed to address the issues that have been raised.'),
"External Party": name(DocInfoTagName, 'extpty', "External Party", 'The document is awaiting review or input from an external party (i.e, someone other than the shepherding AD, the authors, or the WG). See the "note" field for more details on who has the action.', 3),
"Revised ID Needed": name(DocInfoTagName, 'need-rev', "Revised ID Needed", 'An updated ID is needed to address the issues that have been raised.', 5),
"AD Followup": name(DocInfoTagName, 'ad-f-up', "AD Followup", """A generic substate indicating that the shepherding AD has the action item to determine appropriate next steps. In particular, the appropriate steps (and the corresponding next state or substate) depend entirely on the nature of the issues that were raised and can only be decided with active involvement of the shepherding AD. Examples include:
- if another AD raises an issue, the shepherding AD may first iterate with the other AD to get a better understanding of the exact issue. Or, the shepherding AD may attempt to argue that the issue is not serious enough to bring to the attention of the authors/WG.
- if a documented issue is forwarded to a WG, some further iteration may be needed before it can be determined whether a new revision is needed or whether the WG response to an issue clarifies the issue sufficiently.
- when a new revision appears, the shepherding AD will first look at the changes to determine whether they believe all outstanding issues have been raised satisfactorily, prior to asking the ADs who raised the original issues to verify the changes."""),
"Point Raised - writeup needed": name(DocInfoTagName, 'point', "Point Raised - writeup needed", 'IESG discussions on the document have raised some issues that need to be brought to the attention of the authors/WG, but those issues have not been written down yet. (It is common for discussions during a telechat to result in such situations. An AD may raise a possible issue during a telechat and only decide as a result of that discussion whether the issue is worth formally writing up and bringing to the attention of the authors/WG). A document stays in the "Point Raised - Writeup Needed" state until *ALL* IESG comments that have been raised have been documented.')
- when a new revision appears, the shepherding AD will first look at the changes to determine whether they believe all outstanding issues have been raised satisfactorily, prior to asking the ADs who raised the original issues to verify the changes.""", 2),
"Point Raised - writeup needed": name(DocInfoTagName, 'point', "Point Raised - writeup needed", 'IESG discussions on the document have raised some issues that need to be brought to the attention of the authors/WG, but those issues have not been written down yet. (It is common for discussions during a telechat to result in such situations. An AD may raise a possible issue during a telechat and only decide as a result of that discussion whether the issue is worth formally writing up and bringing to the attention of the authors/WG). A document stays in the "Point Raised - Writeup Needed" state until *ALL* IESG comments that have been raised have been documented.', 1)
}
tag_review_by_rfc_editor = name(DocInfoTagName, 'rfc-rev', "Review by RFC Editor")