def convert_event(self, html_event): event = Event() event.id = self.extract_id(html_event) event.title = self.extract_title(html_event) event.date = self.extract_date(html_event) event.enrollment_date = self.extract_enrollment_date(html_event) return event
def hour_click(self, calendar_hour, *args): if not calendar_hour.is_blocked: event = Event() event.date = calendar_hour.date event.start_hour = calendar_hour.hour event.start_minute = 0 event.end_hour = calendar_hour.hour + 1 event.end_minute = 0 EventEditor(event, calendar_hour)
def get_events(self): event = Event() event.id = 'unique' event.title = 'Øl øl øl!' event.notification_sent = False event.date = datetime.now() + timedelta(days=1) event.enrollment_date = datetime.now() + timedelta(minutes=10) time.sleep(5) return [event]
def to_event(cls, row): event = Event() if row['id']: event.id = row['id'] if row['title']: event.title = row['title'] if row['notification_sent']: event.notification_sent = row['notification_sent'] if row['date']: event.date = row['date'] if row['enrollment_date']: event.enrollment_date = row['enrollment_date'] return event
def date_click(self, calendar_day, *args): ''' Open an Event edit window for a CalendarDay :param calendar_day: The CalendarDay :type calendar_day: CalendarDay ''' if not calendar_day.is_blocked: event = Event() event.date = calendar_day.date now = datetime.now() event.start_hour = now.hour event.end_hour = now.hour + 1 event.start_minute = 0 event.end_minute = 0 EventEditor(event, calendar_day)
def create(self, aName, aDate, aVacancies): newEvent = Event(parent=event.eventKey()) newEvent.name = aName newEvent.date = aDate newEvent.vacancies = aVacancies newEvent.put()
def test_date(self): event = Event() now = datetime.now() event.date = now assert Mapper.to_row(event)['date'] == now