Skip to content

Issue 633 - Remove dependency of portal_calendar tool#653

Open
rodfersou wants to merge 8 commits intomasterfrom
issue_633
Open

Issue 633 - Remove dependency of portal_calendar tool#653
rodfersou wants to merge 8 commits intomasterfrom
issue_633

Conversation

@rodfersou
Copy link
Member

closes #633

def getEventTypes(self):
types = self.calendar.getCalendarTypes()
return ''.join(map(lambda x: 'Type={0}&'.format(self.url_quote_plus(x)), types))
return 'Type=Event&'
Copy link
Member

@hvelarde hvelarde Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou do not hard-code this neither; create a getCalendarTypes() method for both cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hvelarde I didn't finish the changes. My first step is to remove portal_calendar, after I'll refactor the code and these methods will be removed.

@rodfersou rodfersou force-pushed the issue_633 branch 8 times, most recently from ade5431 to 00741ca Compare August 19, 2016 14:17
start = DateTime(self.year, self.month, day['day'])
end = start + 1
query = dict(
portal_type='Event', review_state='published',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou as mentioned before, this can't be hard coded: the query must search for all contenty types providing the IEvent interface.

day['eventstring'] = '\n'.join(localized_date + [
' {0}'.format(self.getEventString(e)) for e in day['eventslist']])
day['date_string'] = '{0}-{1}-{2}'.format(year, month, daynumber)
def addEvents(self, day):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou please add a doc string.

states = ['published']
return ''.join(map(lambda x: 'review_state={0}&'.format(self.url_quote_plus(x)), states))

def getEventTypes(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodfersou this method must be memoized now.

@rodfersou rodfersou force-pushed the issue_633 branch 2 times, most recently from dff29f0 to 93fd065 Compare August 22, 2016 12:58
rodfersou and others added 4 commits August 22, 2016 09:58
Code simplification by using the calendar portlet as a helper view; we need to generalize this approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar tile does not work under Plone 5

2 participants