Hi Aline,
You would need to create both the event and the related project and/or users within the same transaction, e.g:
ce=session.create('CalendarEvent',{'name':'TEST_PIPELINE','start': arrow.get('2021-08-25'),'end': arrow.get('2021-08-31')})
user=session.query('User where username is "aline3d"').first()
event = session.create('CalendarEventResource',{'calendar_event_id':ce['id'],'resource_id':user['id']})
session.commit()
Cheers
/Henrik
Recommended Posts
Posted by Henrik Norin,
1 reaction
Go to this post
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now