These are chat archives for django/django

Nov 2016
Mark Heppner
Nov 19 2016 01:19
@fridiculous i use get_or_create() quite a bit. personally i dont like your shortcut names though...why not save_or_create() or upsert() or something a bit more intuitive?
Simon Frid
Nov 19 2016 04:23
@mheppner good q - do you think obj.save_or_create() is inuititive? To expand, right now the obj has a unique hash field, which I'd like to reinforce on the database. Having said that, if a newly instantiated obj already has that hash in the database, I'd return that obj. But if the newly instantiated object has other fields that are dirty or conflict with the database record, how would you like the conflict to be resolved?