-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove restapi #106
Remove restapi #106
Conversation
f2410ca
to
8f6f29e
Compare
Why? |
Don't forget do document this motivation in the final commit of this PR. |
e3d3b60
to
2f17bd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need an upgrade step to cook static resources.
now = datetime.now() | ||
tzname = datetime.now(tzlocal()).tzname() | ||
selected = datetime.strptime(self.date, AGENDADIARIAFMT) | ||
days = [selected + timedelta(days=i) for i in range(-3, 4)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
range
is inefficient in Python 2.
"""Visao padrao da agenda.""" | ||
|
||
def setup(self): | ||
self._ts = getToolByName(self.context, 'translation_service') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the API: api.portal.get_tool()
setup.py
Outdated
@@ -43,6 +43,7 @@ | |||
'Acquisition', | |||
'collective.cover', | |||
'collective.portlet.calendar', | |||
'cssselect', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a test dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in this case.. the exception raised when start the instance in my tests.
current_language = portal_state.language() | ||
portal_state = getMultiAdapter((self, self.REQUEST), | ||
name=u'plone_portal_state') | ||
current_language = portal_state.language() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the API: api.portal.get_current_language()
|
||
def publishTraverse(self, request, date): | ||
"""Pega a data da agenda diaria.""" | ||
self.date = date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to check here that date
is a valid date.
e03e1e3
to
68821e0
Compare
@@ -7,6 +7,7 @@ extends = | |||
package-name = brasil.gov.agenda | |||
package-extras = [test] | |||
eggs += | |||
cssselect # XXX: needed by plone.protect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tem uma explicação melhor sobre isso? Na branch 1.x os testes passam, mas se eu dou checkout para fazer um teste exploratório, não consigo salvar uma agenda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agora estamos usando uma versão de lxml
maior e eles removeram o cssselect
de ai.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sim, o traceback começa no lxml, só achei engraçado os testes passarem. Vou adicionar essa dependência na branch 1.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
na verdade acho que a dependência tem que ser adicionada no plone.protect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ver #106 (comment). Sem essa dependência dá erro no plone.protect devido à versão mais nova de lxml.
No description provided.