Renaming legislative terms vocabulary
This commit is contained in:
parent
2ab3048b4e
commit
f80581f331
|
@ -25,7 +25,7 @@ from themis.fields.interfaces import IRadioChoice
|
|||
from themis.fields.interfaces import ISubjects, ILegisSession, IList
|
||||
|
||||
from themis.fields.vocabs import SubjectsSource
|
||||
from themis.fields.vocabs import LegislativeTermsSource
|
||||
from themis.fields.vocabs import LegislativeSessionsSource
|
||||
|
||||
|
||||
class Commission(Field):
|
||||
|
@ -201,7 +201,7 @@ class LegisSession(Field):
|
|||
|
||||
def __init__(self, **kw):
|
||||
self.required = False
|
||||
self.vocabulary = LegislativeTermsSource()
|
||||
self.vocabulary = LegislativeSessionsSource()
|
||||
for attr in ('vocabulary', 'vocabularyName'):
|
||||
if attr in kw: del kw[attr]
|
||||
super(LegisSession, self).__init__(**kw)
|
||||
|
@ -211,7 +211,7 @@ class LegisSession(Field):
|
|||
def bind(self, object):
|
||||
"""See zope.schema._bootstrapinterfaces.IField."""
|
||||
clone = super(LegisSession, self).bind(object)
|
||||
clone.vocabulary = LegislativeTermsSource()(object)
|
||||
clone.vocabulary = LegislativeSessionsSource()(object)
|
||||
return clone
|
||||
|
||||
def _validate(self, value):
|
||||
|
|
|
@ -200,7 +200,7 @@ class SubjectsSource(object):
|
|||
yield u'DO NOT TOUCH'
|
||||
|
||||
|
||||
class LegislativeTermsSource(object): # Legislatures
|
||||
class LegislativeSessionsSource(object): # Legislative sessions
|
||||
implements(IContextSourceBinder)
|
||||
|
||||
def __init__(self):
|
||||
|
|
Reference in New Issue