Jump to content

Query Calendar events


laura.c

Recommended Posts

Hi Laura,

Sure, they are exposed through the API as CalendarEvent and CalendarEventResource entities.

Here is an example query to look if someone is booked on a particular project during an interval (in server time/UTC).

session.query(
    'CalendarEventResource '
    'where calendar_event.project.name is "test" '
    'and resource[User].username is "lucas.correia" '
    'and calendar_event.start <= "2017-11-09T23:59:59" '
    'and calendar_event.end >= "2017-11-09T00:00:00" '
).first()

Regards,
Lucas

Link to comment
Share on other sites

Hi,

There is currently no list available. We plan to create a page where you can explore API entities and attributes, but haven't gotten around to it yet.

In the meantime, you can use the following code to print all entities and attributes:

for name, entity_type in sorted(session.types.items()):
    print name
    for attribute in sorted(entity_type.attributes.keys()):
        print '\t {} ({})'.format(
            attribute,
            entity_type.attributes.get(attribute).__class__.__name__
        )
    print ''

Read more in the tutorial here.

Regards,
Lucas

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...