=== Ionic is now known as Guest28488 | ||
=== ePierre__ is now known as ePierre | ||
=== Guest28488 is now known as Ionic | ||
handsome_feng | Hi, could someone here handle my request? Thanks! https://answers.launchpad.net/launchpad/+question/670540 | 03:13 |
---|---|---|
wgrant | handsome_feng: Done. | 03:48 |
handsome_feng | wgrant: Thank you very much! | 03:49 |
=== mIk3_09 is now known as mIk3_08 | ||
Laney | what's the right invocation to change the owner of a git_repository from the API? | 14:44 |
Laney | I tried setting 'owner' and calling lp_save() on all the things but it didn't get updated | 14:45 |
cjwatson | That ought to work. Do you have a transcript? | 14:47 |
Laney | I'll run it again. | 14:48 |
cjwatson | You should just need to call lp_save on the repository | 14:48 |
Laney | https://paste.ubuntu.com/p/m4ZGPBFjNC/ | 14:49 |
cjwatson | gits[0].lp_refresh() | 14:51 |
cjwatson | Wait, what is gits in this case? | 14:52 |
cjwatson | Can I have a more complete transcript? :P | 14:52 |
cjwatson | I bet gits is a collection | 14:52 |
Laney | It is, it's from getBranches() or something | 14:52 |
cjwatson | Listify it first, or assign gits[0] to a variable | 14:53 |
cjwatson | Otherwise the __getitem__ inside gits[0] does a separate fetch from the webservice each time and so forgets your changes | 14:53 |
cjwatson | Bit of a gotcha with collections | 14:53 |
Laney | Ahh, this is a peculiarity with LP programming that I'm not aware of | 14:53 |
Laney | That works, thanks! | 14:53 |
cjwatson | np, it's not at all obvious when you haven't encountered it before | 14:54 |
Laney | Oh, but I've got to fix the subscribers too | 14:54 |
cjwatson | You can call methods without this trick - it's only property assignments that are problematic | 14:55 |
cjwatson | Though it may be a good idea anyway to avoid excessive webservice calls | 14:55 |
cjwatson | https://help.launchpad.net/API/launchpadlib#Three_things_to_make_your_client_faster has a little trick to see what webservice calls are happening | 14:56 |
Laney | That'll be useful, cheers | 15:00 |
Laney | Good semantic use of HTTP error codes (409 in this case) | 15:01 |
cjwatson | Yeah, the LP webservice is sort of what you get if you go all-out on REST design and kinda forget the performance bit | 15:02 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!