Export all the events by username

Hi,
I need to export all the events having a username as createor, manager, or any other role she/he has in the event. Is it possible to do it using the API? Do you know how to do it?
Regards
Alberto Nardella

There’s nothing built-in and no API for it, but I doing it via indico shell would not be too hard - the user model has relationships for the various things:

In [1]: u = User.get(6)

In [2]: u
Out[2]: <User(6, test@cern.ch): "Guinea Pig">

In [3]: u.in_event_acls.first()
Out[3]: <EventPrincipal(853600, event_id=455970, <User(6, test@cern.ch): "Guinea Pig">, full_access=True)>

In [4]: u.in_event_acls.first().event
Out[4]: <Event(455970, 2015-10-18 06:00:00+00:00, 2015-10-18 16:00:00+00:00): "test">

In [5]: u.created_events.first()
Out[5]: <Event(455970, 2015-10-18 06:00:00+00:00, 2015-10-18 16:00:00+00:00): "test">

In [6]: u.event_persons.first()
Out[6]: <EventPerson(1440067): "Guinea Pig">

In [7]: u.event_persons.first().event
Out[7]: <Event(472111, 2016-12-17 07:00:00+00:00, 2016-12-17 17:00:00+00:00): "My test event">

PS: We plan to add a way for users to get such a dump (in JSON format most likely) themselves as part of the privacy features in v3.3.