These are chat archives for fossasia/open-event-server

3rd
Jun 2017
Aseem Shrey
@LuD1161
Jun 03 2017 06:11
Anybody had this error ?
SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead
Aseem Shrey
@LuD1161
Jun 03 2017 06:25

I modified the code a bit to save the data as datetime objects ( yesterday it was string type )

    def before_create_object(self, data, view_kwargs):
        starts_at = data['starts_at']
        ends_at = data['ends_at']
        zone = data['timezone']
        local = timezone(zone)
        start_time = local.localize(starts_at)
        end_time = local.localize(ends_at)
        data['starts_at'] = start_time
        data['ends_at'] = end_time
        print ("starts_at :"+str(starts_at)+"\n"+
               "ends_at :"+str(ends_at)+"\n"+
               "start_time :" + str(data['starts_at'])+"\n"+
               "end_time :" +str(data['ends_at'])+str(type(data['ends_at'])))

but still it isn't being saved.
The final output is :

starts_at :2017-07-06 11:22:33
ends_at :2017-07-16 11:22:33
start_time :2017-07-06 11:22:33+05:30
end_time :2017-07-16 11:22:33+05:30<type 'datetime.datetime'>
/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'collection append' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
alchemy.py : in try line 44

The alchemy.py : in try line 44 is from a print statement I put in the flask-rest-jsonapi function create_object as suggested by @poush .
@shubham-padia since I haven't learnt how to use pycharm's debugger ( and just putting a breakpoint at a line on the left side isn't working in pycharm )

Aseem Shrey
@LuD1161
Jun 03 2017 06:37
However one thing I tried now i.e. data['topic'] = 'new topic'
and it did change the topic . See the output :
"attributes": {
      "event_url": null,
      "pay_by_bank": false,
      "schedule_published_on": null,
      "pay_by_cheque": false,
      "topic": "new topic",
      "pay_by_stripe": false,
      "timezone": "Asia/Kolkata",
Afroz Ahamad
@enigmaeth
Jun 03 2017 08:43
@shubham-padia Please check my comment in #3704
Shubham Padia
@shubham-padia
Jun 03 2017 08:48
@poush Replied there
Q11qqq111q
Afroz Ahamad
@enigmaeth
Jun 03 2017 08:49
:confused: :stuck_out_tongue:
Shubham Padia
@shubham-padia
Jun 03 2017 08:52
:stuck_out_tongue_closed_eyes:
Afroz Ahamad
@enigmaeth
Jun 03 2017 11:04
@shubham-padia can you please check #3704 now?
Shubham Padia
@shubham-padia
Jun 03 2017 12:16
@enigmaeth Left a comment
Afroz Ahamad
@enigmaeth
Jun 03 2017 12:21
@shubham-padia Made the changes. Review it please.
Shubham Padia
@shubham-padia
Jun 03 2017 12:23
@enigmaeth Leave the comment on issue itself or if it's urgent DM me. Disturbing the channel does not seem like a good idea :')
Afroz Ahamad
@enigmaeth
Jun 03 2017 12:26
DIdn't mean to. The issue had remained open for quite long now, just want it to get closed soon so to work on other ones. Also I'll keep this in mind.
:smile:
Shubham Padia
@shubham-padia
Jun 03 2017 12:28
:smile: