*** tpb has joined #melange | 00:00 | |
*** madrazr has joined #melange | 00:07 | |
*** madrazr has left #melange | 00:27 | |
ajaksu | jamtoday: sorry, I was away... I'm pushing my cache-related changes and will test your code tomorrow, thanks for looking for the problem :) | 00:30 |
---|---|---|
*** solydzajs has joined #melange | 00:42 | |
*** ChanServ sets mode: +o solydzajs | 00:42 | |
*** dmitrig01_ has quit IRC | 00:57 | |
*** dmitrig01|afk has joined #melange | 00:57 | |
*** ChanServ sets mode: +v dmitrig01|afk | 00:57 | |
*** dbentley-lapto1 has joined #melange | 01:27 | |
*** penyaskito has quit IRC | 01:27 | |
*** dbentley-laptop has quit IRC | 01:45 | |
*** forever has quit IRC | 01:57 | |
*** dbentley-lapto1 has left #melange | 01:59 | |
*** dmitrig01|afk has quit IRC | 02:16 | |
*** madrazr has joined #melange | 02:50 | |
*** madrazr has quit IRC | 03:07 | |
*** forever has joined #melange | 04:16 | |
*** mithro has quit IRC | 05:00 | |
*** MatthewWilkes has joined #melange | 05:44 | |
*** scorche has quit IRC | 06:00 | |
*** scorche has joined #melange | 06:00 | |
*** SRabbelier has joined #melange | 06:16 | |
*** ChanServ sets mode: +o SRabbelier | 06:16 | |
*** dhans has joined #melange | 06:51 | |
*** SRabbelier has quit IRC | 07:09 | |
*** SRabbelier has joined #melange | 07:10 | |
*** ChanServ sets mode: +o SRabbelier | 07:10 | |
*** SRabbelier has quit IRC | 07:11 | |
*** SRabbelier has joined #melange | 07:12 | |
*** ChanServ sets mode: +o SRabbelier | 07:12 | |
SRabbelier | ajaksu: ping | 07:35 |
*** dhans has quit IRC | 07:42 | |
*** solydzajs has quit IRC | 08:15 | |
*** florinciu has joined #melange | 08:28 | |
*** dhans has joined #melange | 08:30 | |
*** madrazr has joined #melange | 08:56 | |
*** dr__house has joined #melange | 09:26 | |
*** forever has quit IRC | 10:09 | |
ajaksu | SRabbelier: 3½ hours late pong | 10:57 |
SRabbelier | ajaksu: nice :) | 10:58 |
SRabbelier | ajaksu: can you rebase your branch on Jame's latest? | 10:58 |
*** penyaskito has joined #melange | 10:58 | |
ajaksu | SRabbelier: yep, I'll try that in about 15 minutes | 11:00 |
SRabbelier | ajaksu: win | 11:00 |
ajaksu | hopefully I'm going to code a lot today :) | 11:00 |
SRabbelier | ajaksu: I hopez I hopez I hoepz? :D | 11:01 |
*** solydzajs has joined #melange | 11:05 | |
*** ChanServ sets mode: +o solydzajs | 11:05 | |
ajaksu | SRabbelier: am I going to lose all the style changes if I rebase on jamtoday's latest? I can sync/pull from you and merge his changes if so... | 11:10 |
ajaksu | bah, lemme try, otherwise I'll never learn this stuff :) | 11:10 |
SRabbelier | ajaksu: you should be able to rebase your work, which means that you will not lose any code | 11:11 |
Erant | Hg? | 11:16 |
SRabbelier | Erant: yes | 11:26 |
SRabbelier | Erant: but James has his code on github | 11:27 |
SRabbelier | Erant: I think ajaksu is using hg-git | 11:27 |
ajaksu | only git for github, but I'm using hg for my local work :) | 11:27 |
Erant | How's Hg compared to Git? I've only worked with Git so far | 11:29 |
SRabbelier | Erant: Hg is like git, only it won't give you the damn shotgun | 11:29 |
SRabbelier | Erant: it's like "nono, here, try this watergun instead" | 11:29 |
SRabbelier | Erant: sure, it's funny for a while, but it gets damn frustrating if you know what you're doing | 11:29 |
SRabbelier | Erant: (and as such don't want/need handholding) | 11:30 |
ajaksu | Erant: hg is very comfy if you're a bit unsure about what you're doing, so it's really great for me :) | 11:30 |
Erant | lol | 11:32 |
ajaksu | btw, I might've picked the wrong way to rebase: pull --rebase is download a lot of stuff, but I just found out the issue with my git rebase command was a missing /master or something like that :) | 11:32 |
Erant | SRabbelier: It's like C vs. Java. Java gives you just enough rope to tie a knot. C gives you enough rope to hang yourself, and your family. | 11:32 |
SRabbelier | Erant: exactly ^_^ | 11:32 |
*** florinciu has quit IRC | 11:33 | |
ajaksu | I think bzr is java (without the performance), hg is closer to python :) | 11:33 |
ajaksu | ouch, multistep rebase, gross | 11:35 |
SRabbelier | multistep? | 11:36 |
madrazr | ajaksu: no bzr is Python too | 11:38 |
madrazr | thats exactly what delayed Python's switch to Hg(Guido was confused to which one to choose? ;-) ) | 11:38 |
ajaksu | split commit actually... while in real life, we use patches without history all the time :) | 11:38 |
ajaksu | madrazr: I meant in the 'git is to hg as C is to Java' sense :) | 11:39 |
madrazr | ajaksu: he he Ok | 11:40 |
SRabbelier | git is awesome like hg is not? :P | 11:42 |
* SRabbelier runs | 11:42 | |
ajaksu | LOL, my git pull --rebase downloaded 23MB just to tell me "I don't know the branch you want me to merge to, try again" :) | 11:42 |
ajaksu | SRabbelier: I guess that's it, I don't want awesomeness, I want local cvs with some smarts that allow me to work with others :) | 11:43 |
SRabbelier | ajaksu: you need those 23MB | 11:43 |
SRabbelier | ajaksu: that's the new commits | 11:43 |
SRabbelier | ajaksu: and you won't have to downlod them again | 11:43 |
SRabbelier | ajaksu: do you want me to do the rebase for you? | 11:44 |
ajaksu | SRabbelier: git rebase jamslevy/master now? | 11:44 |
SRabbelier | ajaksu: it'll give you lots of conflicts, because I think you're based of an wrong conversion (which did not respect file modes) | 11:44 |
ajaksu | SRabbelier: your initial github repo was wrong? james's? mine? | 11:46 |
SRabbelier | ajaksu: mine was wrong | 11:46 |
SRabbelier | ajaksu: but, what you can do | 11:46 |
SRabbelier | ajaksu: is 'git checkout -t jamslevy/master | 11:47 |
SRabbelier | ajaksu: which will put you on a branch tracking james | 11:47 |
SRabbelier | ajaksu: and then you can 'cherry-pick' your changes | 11:47 |
ajaksu | SRabbelier: that means cherrypicking... diffstat: 8 files changed, 520 insertions(+), 579 deletions(-) | 11:49 |
ajaksu | tons of tabs to spaces | 11:49 |
SRabbelier | ajaksu: ok | 11:51 |
SRabbelier | ajaksu: whitespace fixes? | 11:51 |
*** penyaskito has quit IRC | 11:51 | |
ajaksu | SRabbelier: and general style http://github.com/ajaksu/Melange/commit/f604675b773b12eff41a965f083a6dded902e507 | 11:52 |
tpb | <http://ln-s.net/3DZh> (at github.com) | 11:52 |
SRabbelier | ajaksu: ok, do you know how to cherry-pick? | 11:53 |
ajaksu | SRabbelier: no, but now I realize that was a single git commit (spanned many in hg), so I think I should just clobber my git repo with james's and merge things again? | 11:55 |
SRabbelier | ajaksu: wait, am I right that you have only one commit that you want to apply? | 11:57 |
SRabbelier | ajaksu: do 'git checkout master && git reset --hard jamslevy/master && git cherry-pick f604675b773b12eff41a965f083a6dded902e507' | 11:57 |
*** Merio has joined #melange | 11:58 | |
ajaksu | SRabbelier: ah, that's simple, how come I didn't think of it? :D got a small conflict, lemme see how that leaves me... | 12:00 |
SRabbelier | ajaksu: because you don't think git :P | 12:00 |
SRabbelier | ajaksu: not to worry, this should be the last time you need to do this :P | 12:01 |
SRabbelier | ajaksu: after you're done, you can do 'git push -f' to update your github | 12:02 |
ajaksu | aha, the small conflict isn't so small... let me think hg, then... I have a hg branch that is up-to-date with upstream and only missing one commit from james, so I should just add that commit to hg, throw my git repo away, fork again and apply a diff from my hg branch... how does that sound? :) | 12:04 |
SRabbelier | ajaksu: worth a shot, make sure your hg repo is indeed up to date :) | 12:11 |
* SRabbelier is off for dinner | 12:20 | |
* SRabbelier is back | 12:46 | |
*** SRabbelier has quit IRC | 12:48 | |
*** madrazr has left #melange | 13:00 | |
*** SRabbelier has joined #melange | 13:06 | |
*** ChanServ sets mode: +o SRabbelier | 13:06 | |
*** Merio has quit IRC | 13:20 | |
ajaksu | SRabbelier: my hg is up-to-date, but your repo isn't, so should I merge pawel's last commit or keep it out of my git push? | 13:22 |
SRabbelier | ajaksu: I wiill update my repo, one sec | 13:23 |
SRabbelier | ajaksu: please do base your changes off my branch, I'll try to make sure it's always up to date :) | 13:23 |
SRabbelier | ajaksu: if there's some change in Melange.hg that's not in Melange.git that you need, feel free to poke me :) | 13:24 |
*** Merio has joined #melange | 13:25 | |
ajaksu | SRabbelier: I usually work with hg, github is just a way to coordinate with james... but man, is it complex, three full checkouts already :) | 13:25 |
SRabbelier | ajaksu: why do you have more than one checkout/ | 13:25 |
SRabbelier | ? | 13:25 |
*** dhaun has joined #melange | 13:28 | |
ajaksu | 1st james had one repo (you gave me the url) that he stopped using, then his 2nd was rebased to your correct version and I bailed on quite a lot conflicts, so I'm on my 3rd checkout :) | 13:28 |
SRabbelier | ajaksu: hehe, ok | 13:29 |
SRabbelier | ajaksu: can you push your repo that's rebased to James' latest to github so I can integrate it? | 13:30 |
ajaksu | sure, one sec :) | 13:31 |
SRabbelier | ajaksu: awesome, thanks | 13:32 |
ajaksu | SRabbelier: done, I think... :) | 13:38 |
SRabbelier | ajaksu: win | 13:38 |
ajaksu | SRabbelier: it's still missing my js code to fix survey field adding and removing, but james's patch might have fixed that already... I'll find out after lunch :) | 13:42 |
SRabbelier | ajaksu: one question, why did you merge with master? | 13:43 |
SRabbelier | ajaksu: sr/master that is | 13:43 |
SRabbelier | ajaksu: I say blow away 7d2c1322c33ef68bef02684f94b11a2af465a99e and push 7a14b318ced95b7244c348a65d5a063c222ccb72 instead | 13:43 |
ajaksu | SRabbelier: because pull said I was up-to-date, as I fork from james's repo? | 13:44 |
SRabbelier | ajaksu: yes, but why did you pull from me? | 13:45 |
SRabbelier | ajaksu: (I'm suggesting that you do 'git checkout master && git reset --hard 7a14b318ced && git push -f') | 13:45 |
ajaksu | SRabbelier: because you had pawel's commit, I thought I should have it before pushing... | 13:45 |
SRabbelier | ajaksu: ah, no, you should ask james to rebase instead | 13:46 |
SRabbelier | ajaksu: or, mhhh | 13:46 |
SRabbelier | ajaksu: yes | 13:46 |
ajaksu | before I push? | 13:46 |
SRabbelier | ajaksu: that'd work | 13:46 |
SRabbelier | ajaksu: no, you can just push like this | 13:46 |
SRabbelier | ajaksu: that's fine | 13:46 |
SRabbelier | ajaksu: without pawel's commit | 13:46 |
SRabbelier | ajaksu: it doesn't affect your code, so it's np if you don't have it | 13:46 |
ajaksu | ok, then later when james is up-to-date, I'm up-to-date | 13:47 |
SRabbelier | ajaksu: exactly | 13:47 |
SRabbelier | ajaksu: or, what you could do too | 13:47 |
SRabbelier | ajaksu: is ask james to pull from you | 13:47 |
SRabbelier | ajaksu: -then- rebase | 13:47 |
SRabbelier | ajaksu: but eh, it really doesn't matter much :) | 13:48 |
ajaksu | SRabbelier: I think won't keep doing this pull-edit-push-rebase dance forever, it's taking way too much time and I'm only trying to sync with git to make things easier... I might as well do all my work locally merge with trunk after surveys land there, is there a reindent.py commit hook? | 13:52 |
SRabbelier | ajaksu: a reindent.py commit hook? | 13:53 |
SRabbelier | ajaksu: I don't think we have any commit hooks set up tbh | 13:53 |
SRabbelier | ajaksu: and you should be done with the dance now, I apologise for messing up which forced you guys to rebase | 13:54 |
ajaksu | SRabbelier: no need to apologize, sorry if I'm whiny, I guess the perspective of having to ask james to rebase or rebasing myself in the future (where a merge feels natural) scares me :) | 13:57 |
SRabbelier | ajaksu: ok, if you prefer merging that's fine | 13:58 |
SRabbelier | ajaksu: it's just in the git community it's less weird to rebase | 13:59 |
*** madrazr has joined #melange | 14:03 | |
ajaksu | SRabbelier: I guess after I read a lot on it I'll become comfortable with rebase, but right now I have issues with it :) | 14:04 |
SRabbelier | ajaksu: probably because you had to do a weird rebase | 14:05 |
SRabbelier | ajaksu: you should try rebasing (on a new branch) on top of latest master | 14:05 |
SRabbelier | ajaksu: it's real easy :) | 14:05 |
SRabbelier | ajaksu: 'git checkout test && git rebase sr/master' | 14:05 |
SRabbelier | ajaksu: and that should give you a properly rebased repo with no hassle :) | 14:06 |
ajaksu | SRabbelier: well, the man page says: "When you rebase a branch, you are changing its history in a way that will cause problems for anyone who already has a copy of the branch in their repository and tries to pull updates from you. You should understand the implications of using git rebase on a repository that you share", and I don't understand the implications yet :) | 14:08 |
SRabbelier | ajaksu: there will be no problems if you are the downstream user | 14:08 |
SRabbelier | ajaksu: say you want james to merge your changes | 14:09 |
SRabbelier | ajaksu: you could make that easy for him by rebasing your changes on his latest master | 14:09 |
ajaksu | SRabbelier: say he makes a couple of commits while I'm offline and wants to make things easy for you, so rebases on your latest master... I need to rebase on his master, then... what, fix conflicts? | 14:11 |
SRabbelier | ajaksu: no, you should only rebase on one upstream | 14:11 |
SRabbelier | ajaksu: so either on his, or on mine | 14:11 |
ajaksu | ok, but I have local changes he doesn't have and he has changes I didn't pull before he rebased, I don't even know where to go here... this was more or less what happened when I commited my style changes to git and he started using another repo... | 14:14 |
ajaksu | what would be the correct path? rebase from him, then...? | 14:14 |
SRabbelier | ajaksu: right, so he should not rebase | 14:15 |
ajaksu | SRabbelier: and by extension, you shouldn't or the same problem will happen higher in the hierarchy... and I shouldn't, or the guy following my repo will have the same problem? I think that sums up my issues with rebase :) | 14:16 |
SRabbelier | ajaksu: yes | 14:16 |
SRabbelier | ajaksu: only the leaf nodes should rebase | 14:16 |
SRabbelier | ajaksu: ofcourse, eventually, when you two are done | 14:16 |
SRabbelier | ajaksu: (or when you and james agree to) | 14:16 |
SRabbelier | ajaksu: he could rebase on me | 14:17 |
SRabbelier | ajaksu: to make it easy for me to pull his changes | 14:17 |
ajaksu | SRabbelier: and here's the last thing I don't get: when the work is done, what is the advantage of rebasing on you instead of diffing his tree with yours and sending you a patch? or applying said patch on a fresh checkout of your tree? | 14:19 |
*** Merio has quit IRC | 14:19 | |
SRabbelier | ajaksu: you can't make a nice patch series like that | 14:19 |
SRabbelier | ajaksu: sending someone a patch bomb with one huge patch... not so likely to be accepted | 14:20 |
ajaksu | SRabbelier: ah, so http://github.com/jamslevy/Melange/commit/aab529e4a9da3775e338ba1b5753346ebff5a496 isn't the usual rebase output? | 14:20 |
tpb | <http://ln-s.net/3Dbm> (at github.com) | 14:20 |
SRabbelier | ajaksu: no, that was only because he had to rebase all of his commits (due to my fsckup) | 14:21 |
SRabbelier | ajaksu: I hope he will later on split those into multiple commits :P | 14:21 |
ajaksu | SRabbelier: well, I have mine on hg if we ever want history or code reviews :) | 14:22 |
SRabbelier | ajaksu: those are too granular | 14:23 |
ajaksu | SRabbelier: I can produce patchsets with the needed granularity, that's how I'm commiting to my git thing actually... so maybe that's why I don't get rebases, I'm pre-rebasing stuff in my git usage :) | 14:26 |
SRabbelier | ajaksu: cheater :P | 14:26 |
* ajaksu goes to see how fixed the cache issue is, then make a decent midterm subclass of survey | 14:28 | |
* ajaksu finds out everything is broken, goes to figure out what he broke, what james broke and what is only broken when their code meets :) | 14:33 | |
SRabbelier | :D | 14:37 |
SRabbelier | pretty sweet | 14:37 |
ajaksu | jamtoday: ping? | 14:44 |
*** Merio has joined #melange | 14:53 | |
jamtoday | ajaksu: pong | 14:56 |
jamtoday | ajaksu: uh oh...what's broken? | 14:57 |
SRabbelier | jamtoday: that's usually what I say when one of my team mates ping me | 14:58 |
ajaksu | jamtoday: one thing I broke (mixhandled tabs to spaces in your helpers/surveys.py commit, let me confirm) :) | 14:59 |
ajaksu | jamtoday: and one you broke, if len(survey) == 0: should be len(survey.fields), let me check :) | 15:01 |
jamtoday | ajaksu: About the tabs/spaces thing, my IDE seems to always reset it back to tabs after I restart the X server. I think it's time for a new IDE | 15:02 |
jamtoday | I couldn't figure out a way to add fields to the instance of the SurveyForm without adding the fields to SurveyForm.base_fields | 15:04 |
ajaksu | jamtoday: I have a version of reindent.py that replaces tabs with two spaces carefully, it wouldn't have made the mistake I made... we can use it as a commit-hook, as it also strips trailing whitespace | 15:04 |
jamtoday | But I do think you're right about that being the root of the ghost field problem | 15:04 |
SRabbelier | jamtoday: you're not using eclipse+pydev? | 15:06 |
SRabbelier | jamtoday: perhaps you need to copy | 15:06 |
jamtoday | I'm using Geany on Ubunut | 15:06 |
SRabbelier | jamtoday: copy the base_fields first | 15:06 |
SRabbelier | jamtoday: update as needed | 15:06 |
SRabbelier | jamtoday: then update only the instance? | 15:06 |
jamtoday | Ubunut being a cheap rip off of Ubuntu | 15:06 |
ajaksu | jamtoday: lemme look at BaseModelForm and friends | 15:06 |
ajaksu | eclipse? ew :) | 15:07 |
SRabbelier | jamtoday: Ubunut? | 15:08 |
SRabbelier | ajaksu: eclipse+pydev is not so ew actually | 15:08 |
SRabbelier | ajaksu: it has the only decent autocompletion for python I've seen so far | 15:08 |
jamtoday | SRabbelier: Can it write my code for me? | 15:08 |
SRabbelier | jamtoday: yes, if you ask it nicely | 15:09 |
SRabbelier | jamtoday: but then again, you could use emacs for that too, with C-m, C-L, C-homework | 15:09 |
ajaksu | SRabbelier: I don't think I have enough of a computer for eclipse to run in an acceptable way and I don't like APIs that require autocompletion to be bearable (git does need it :D) | 15:10 |
jamtoday | SRabbelier: I've never fully delved into macros etc. But it's on the todo list! | 15:10 |
jamtoday | ajaksu: you're right. I just got a TemplateSyntaxError | 15:12 |
SRabbelier | ajaksu: I didn't say you need the autocompletion to be bearable | 15:13 |
SRabbelier | ajaksu: but you are sure missing out without it | 15:13 |
ajaksu | jamtoday: maybe we should be using a dynaform? or something that allows us to set fields on the instance | 15:13 |
SRabbelier | jamtoday: macro's | 15:13 |
SRabbelier | jamtoday: ? | 15:13 |
jamtoday | ajaksu: I started to prototyped it, and then decided it would be easier just to inherit from ModelForm directly | 15:17 |
jamtoday | And looking at this code, I don't see how it's successfully running an insert() method on the base_fields dictionary. Since insert() isn't a dictionary method?" | 15:27 |
ajaksu | jamtoday: I have no idea, but I think returning self.fields from get_fields should be enough... trying :) | 15:30 |
ajaksu | jamtoday: it works | 15:33 |
ajaksu | MAN IT WORKS :) | 15:33 |
ajaksu | now, to fix the custom prompts not being saved | 15:33 |
jamtoday | It looks like it's only saving the newest fields added | 15:34 |
ajaksu | jamtoday: did you get my cache fix commit? it was working for keeping (and growing or shrinking) the schema and custom prompts | 15:36 |
ajaksu | I just have to figure out what your patch changes in that area | 15:36 |
jamtoday | I think so...but it's possible I missed it | 15:37 |
ajaksu | jamtoday: and you'd need http://paste.pocoo.org/show/118570/ or something equivalent that adds the to-be-deleted fieldnames to a __deleted__ hidden inputfor | 15:38 |
tpb | Title: Paste #118570 | LodgeIt! (at paste.pocoo.org) | 15:38 |
ajaksu | * input | 15:38 |
ajaksu | http://github.com/ajaksu/Melange/commit/7a14b318ced95b7244c348a65d5a063c222ccb72 (ignore app/soc/views/helper/surveys.py ) | 15:41 |
tpb | <http://ln-s.net/3Dcz> (at github.com) | 15:41 |
jamtoday | ajaksu: we shouldn't need hidden fields to determine deleted fields | 15:44 |
jamtoday | In logic/models/survey.py there's this: # wipe clean existing dynamic properties if they exist | 15:44 |
jamtoday | for prop in this_survey.dynamic_properties(): | 15:44 |
jamtoday | delattr(this_survey, prop) | 15:44 |
jamtoday | So every time an existing survey is edited, it deletes all fields before re-adding them | 15:44 |
jamtoday | So if a field isn't sent in the POST, it is removed | 15:45 |
ajaksu | jamtoday: that's not how it's working for me, before my changes any edit would zap the schema and all fields... | 15:45 |
ajaksu | can you create a survey, look at its SurveyContent, then delete one field and refresh the SurveyContent? | 15:46 |
ajaksu | jamtoday: I can confirm here that without my hack the schema and fields get zapped, do you get different behavior there? | 15:50 |
ajaksu | IIUC, the cache issue was two fold: first, we weren't saving (as in load, change, save) things correctly, then, even when we did, the UI was confused because it was getting non-existant fields that were added at runtime | 15:52 |
ajaksu | so maybe we don't need a hidden field, but we need a list of previous fields to compare to those present in the current POST | 15:52 |
jamtoday | I'm getting this behavior, but it was working fine until recently | 15:53 |
ajaksu | I could never get it to work right, that's why I let the midterm stuff rest | 15:53 |
ajaksu | and since comparing to field in the POST meant we'd have to do startswith tricks again, I thought using JS made more sense, as that's how we delete stuff after all :) | 15:55 |
ajaksu | brb | 15:56 |
jamtoday | ajaksu: there's some code I'm missing | 16:00 |
ajaksu | jamtoday: other than http://github.com/ajaksu/Melange/commit/7a14b318ced95b7244c348a65d5a063c222ccb72 ? | 16:01 |
tpb | <http://ln-s.net/3Dcz> (at github.com) | 16:01 |
jamtoday | there's no __deleted__ component in the javascript | 16:01 |
ajaksu | jamtoday: see my paste above, I had it kinda working in edit_survey.js before we drifted apart in the JS, the paste is the standalone version :) | 16:05 |
jamtoday | not a big jQuery fan? | 16:06 |
ajaksu | jamtoday: I don't have anything against it, I think I had fixed the file whitespace and ran it thru jslint, but you made further changes before I could merge my style fixes so it was a big mess, so I gave up merging it.... | 16:09 |
ajaksu | jamtoday: widget.find('a.delete img').click(function(){ -> add appending of the field name to __deleted__ if value === '', otherwhise ',' + field name :) | 16:10 |
ajaksu | ah, the problem is that my fixes to .js were against your gsoc repo, by the time I got to Melange things had drifted apart I think | 16:11 |
SRabbelier | ajaksu: wouldn't it be easy to rerun fixindent and jslint? | 16:12 |
ajaksu | SRabbelier: reindent yes, jslint needs manual editing (at least the one I use does) | 16:13 |
SRabbelier | ajaksu: ah, ok | 16:13 |
ajaksu | SRabbelier: http://bitbucket.org/ajaksu/melange-surveys/changeset/f7eebc58ed4c/ :) | 16:14 |
tpb | <http://ln-s.net/3Ddn> (at bitbucket.org) | 16:14 |
jamtoday | ajaksu: taking surveys is also not working. It was all going so smoothly a couple days ago | 16:15 |
jamtoday | except for the ghost field problem | 16:15 |
*** MatthewWilkes has quit IRC | 16:16 | |
ajaksu | jamtoday: probably the same issue that is making us lose the custom prompt... I didn't get to isolate it, but I guess we'd need a set_fields now we don't set them in the class? | 16:18 |
ajaksu | actually, that woud be something in EditSurvey and TakeSurvey, right? | 16:23 |
jamtoday | oh no.... | 16:24 |
jamtoday | why is it duplicated every field with a hidden version? | 16:25 |
jamtoday | That's what causing the problems | 16:26 |
ajaksu | jamtoday: maybe it was my code that broke it? | 16:26 |
jamtoday | nope...it was my growfield plugin | 16:27 |
jamtoday | but thats not the only problem | 16:31 |
*** dr__house has quit IRC | 16:32 | |
ajaksu | maybe my changes to View._editPost... or _editPost should populate self.fields as SurveyForm.base_fields.insert(position, property, self.fields[property]) did? | 16:33 |
ajaksu | but in a setattr(this_survey, property, POST[mangled_property_name]) way? | 16:34 |
*** madrazr1 has joined #melange | 16:34 | |
jamtoday | its breaking | 16:37 |
jamtoday | the surveys.py SurveyForm class breaks in the for loop | 16:37 |
jamtoday | and it's failing silently :( | 16:37 |
ajaksu | jamtoday: the version I have in git does, your original one didn't, did it? | 16:38 |
ajaksu | jamtoday: the return line should be outside the for, otherwise we miss the other fields | 16:39 |
jamtoday | oh so THAT's how for loops work | 16:40 |
jamtoday | (kidding) | 16:40 |
jamtoday | thats why they tell you not to have large indented blocks in python 101 | 16:40 |
ajaksu | It was what I broke earlier, I need 'Python for Toddlers' :) | 16:42 |
jamtoday | okay that adjustment obviously fixed a lot, now i'm back to the custom prompts | 16:43 |
jamtoday | it's being stored in the database correctlyu | 16:44 |
jamtoday | Okay, so it's fine until it reaches the front-end, so we're back to the ghost field problem | 16:46 |
ajaksu | peeking at survey.fields after we call get_fields... | 16:49 |
*** madrazr has quit IRC | 16:50 | |
jamtoday | survey.fields is a dictionary that is being setup in get_fields | 16:51 |
jamtoday | I didn't think it had any significance beyond being a temporary store | 16:51 |
*** jamtoday has quit IRC | 16:51 | |
*** jamtoday has joined #melange | 16:52 | |
ajaksu | jamtoday: it works, man it works :) | 17:00 |
jamtoday | pastebin your SurveyForm code | 17:00 |
ajaksu | jamtoday: http://paste.pocoo.org/show/118585/ for full file, diff... | 17:03 |
tpb | Title: Paste #118585 | LodgeIt! (at paste.pocoo.org) | 17:04 |
jamtoday | I'm still having trouble getting the ordering and initial vals to work without using the base_fields | 17:04 |
ajaksu | here http://paste.pocoo.org/show/118586/ | 17:05 |
tpb | Title: Paste #118586 | LodgeIt! (at paste.pocoo.org) | 17:05 |
jamtoday | Initial argument ftw | 17:05 |
jamtoday | Now there's just the ordering of fields | 17:05 |
ajaksu | jamtoday: the return of get_fields (or is it self.fields? have to test) is iterated by items()... we could put an ordered dict there, worst case | 17:10 |
ajaksu | self.fields it is, we can remove the return from get_fields :) | 17:11 |
jamtoday | http://paste.pocoo.org/show/118588/ | 17:11 |
tpb | Title: Paste #118588 | LodgeIt! (at paste.pocoo.org) | 17:11 |
jamtoday | I'm using the survey_fields attribute just to gather the fields, and then inserting them in order to self.fields | 17:12 |
jamtoday | working nicely now :) | 17:13 |
* jamtoday is ordering the survey records to be in their proper order as well | 17:15 | |
ajaksu | great! :) | 17:16 |
jamtoday | it looks like list_key_order should be the target here | 17:24 |
ajaksu | jamtoday: the fields.insert way broke adding new fields for me, reading about "order: a list with the sort order" in logic.models.base.Logic.getForFields :) | 17:36 |
jamtoday | getQueryForFields | 17:37 |
jamtoday | I took the survey_order and made it a method of the SurveyContent class, and now I'm trying to figure to make the order arg | 17:37 |
ajaksu | for key in order: query.order(key) ? | 17:37 |
ajaksu | man, this code is fun to dig, you never know how far it goes :) | 17:38 |
ajaksu | def order(self, property): | 17:40 |
ajaksu | """Set order of query result. | 17:40 |
ajaksu | 17:40 | |
ajaksu | To use descending order, prepend '-' (minus) to the property | 17:40 |
ajaksu | name, e.g., '-date' rather than 'date'. | 17:40 |
ajaksu | 17:40 | |
jamtoday | where is that method? | 17:43 |
ajaksu | jamtoday: tack an .index attribute to the fields? | 17:43 |
jamtoday | I've got an order list setup like ['key1', 'key2'...] but it isn't affecting the list order | 17:44 |
jamtoday | SRabbelier: ping? | 17:44 |
ajaksu | jamtoday: /google/appengine/ext/db/__init__.py , but that should be about the format... so | 17:44 |
ajaksu | so I think we might need to set properties on something (fields?) and order is only the name of that something | 17:45 |
ajaksu | oops, of those properties | 17:45 |
ajaksu | specifically, the code in db.Query will sort by named Expando attributes, how do we map this to form fields? | 17:46 |
*** madrazr1 has left #melange | 17:46 | |
SRabbelier | jamtoday: pong | 17:48 |
SRabbelier | ajaksu, jamtoday: is your latest code @ github? | 17:51 |
SRabbelier | (doesn't seem to be?) | 17:51 |
ajaksu | SRabbelier: not mine, jamtoday? | 17:51 |
jamtoday | I'll push what I have right now | 17:52 |
SRabbelier | ajaksu: can you make sure it is there in 5 hours? | 17:52 |
SRabbelier | I'll do a synch before I leave (in 6 hours or so) | 17:52 |
jamtoday | I just fixed a major bug related to an indentation mistake :) | 17:52 |
SRabbelier | jamtoday: hehe, I read that I think :) | 17:52 |
SRabbelier | jamtoday: win :) | 17:52 |
jamtoday | I was pinging you about how to set the order of values in a list | 17:52 |
ajaksu | jamtoday: another one or my early return again? :) | 17:52 |
ajaksu | jamtoday: in a form? | 17:53 |
jamtoday | I tried passing an order list to getQueryforFields | 17:53 |
SRabbelier | jamtoday: that should work | 17:53 |
jamtoday | and the order list is like ['key1', 'key2'...] | 17:53 |
SRabbelier | jamtoday: if you pass it a list it will order on those | 17:53 |
SRabbelier | jamtoday: but but it won't work unless you have an index | 17:53 |
ajaksu | jamtoday: are you trying to order form fields or entities in a list? | 17:53 |
SRabbelier | jamtoday: you could do the sorting after retrieving the data | 17:53 |
SRabbelier | jamtoday: using .sort | 17:53 |
jamtoday | ah, so i need to add to index.yaml? | 17:53 |
SRabbelier | jamtoday: and a custom key getting | 17:53 |
SRabbelier | jamtoday: you could do that too | 17:54 |
jamtoday | The data is sorted, but the headers aren't | 17:54 |
SRabbelier | jamtoday: headers./ | 17:54 |
SRabbelier | ? | 17:54 |
ajaksu | jamtoday: are you trying to order form fields or entities in a list? | 17:54 |
* SRabbelier is brb | 17:54 | |
ajaksu | SRabbelier: I think you two might be reading different meanings in 'key1', 'key2' :) | 17:54 |
ajaksu | IIUC, key1 is 'sort by property named key1', key2 is 'then, by the one named key2'... | 17:55 |
dhans | SRabbelier: Hello, I was writing an email to you with a question about patterns in django, but before sending I read through it again and found my mistake :) | 17:57 |
SRabbelier | ajaksu: correct | 17:58 |
SRabbelier | dhans: pretty sweet! :D | 17:59 |
SRabbelier | dhans: what kind of patterns btw? | 17:59 |
Erant | XOR patterns, obv. | 17:59 |
ajaksu | jamtoday: from django.utils.datastructures import SortedDict ? | 17:59 |
SRabbelier | ajaksu: let's not go there :P | 17:59 |
dhans | SRabbelier: those patterns which redirects to a proper page | 18:00 |
SRabbelier | dhans: define proper page? | 18:00 |
ajaksu | SRabbelier: how can we maintain field order within a form? :) | 18:00 |
ajaksu | http://code.djangoproject.com/changeset/4093 goes there :) | 18:00 |
tpb | Title: Changeset 4093 - Django - Trac (at code.djangoproject.com) | 18:00 |
SRabbelier | ajaksu: as said, use .sort :) | 18:00 |
dhans | SRabbelier: in each view you define some extra_django_patterns so that these patterns redirects us to this particular view | 18:01 |
SRabbelier | dhans: those patterns define a mapping from an url to a view | 18:02 |
SRabbelier | dhans: but you said you figured it out? :) | 18:03 |
dhans | SRabbelier: I know it, but didn't know how to express it:) mapping is a good word:) | 18:03 |
SRabbelier | dhans: yay for terminology :) | 18:03 |
dhans | SRabbelier: yeah, I just used key_fields as a param instead of scope and could not figure out why my pattern is too long, but it works now:) | 18:04 |
SRabbelier | dhans: nice :) | 18:05 |
ajaksu | SRabbelier: SurveyForm has no .sort, .fields is a dict... are you thinking of a Query or am I looking in the wrong place? | 18:05 |
jamtoday | I got it working | 18:05 |
SRabbelier | ajaksu: methink you should sort the data you are using to feed the form | 18:05 |
SRabbelier | jamtoday: how'd you do it :) | 18:05 |
jamtoday | I just added an ordered_properties method to the SurveyContent class | 18:06 |
SRabbelier | jamtoday: oh? and it automagically works? | 18:06 |
SRabbelier | jamtoday: or do you mean you then iterate over that in the django template? | 18:06 |
jamtoday | After I call it from the handler it does :) | 18:06 |
SRabbelier | smart :) | 18:06 |
ajaksu | cool :) | 18:07 |
SRabbelier | anyway, I must be off to bed | 18:08 |
ajaksu | jamtoday: so you use it instead of .dynamic_properties() ? | 18:08 |
SRabbelier | please do synch your code before I get up :) | 18:08 |
jamtoday | ajaksu: exactly | 18:08 |
ajaksu | SRabbelier: good night, thanks for helping :) | 18:08 |
SRabbelier | ajaksu: hehe, didn't do much, but np :) | 18:08 |
ajaksu | jamtoday: very cool :) | 18:09 |
dhans | SRabbelier: wait a second!:) | 18:09 |
SRabbelier | jamtoday, ajaksu: good luck both, great to see you two cooperating :) | 18:09 |
SRabbelier | dhans: yes? :) | 18:09 |
dhans | SRabbelier: but anyway, I have a simple question:) those cron jobs in gae do not resolve long running tasks problem, do they? they just allow us to schedule some tasks, but have the same limitations as normal requests? | 18:09 |
SRabbelier | dhans: cron job = the same as poking at a certain url every so often | 18:09 |
SRabbelier | dhans: nothing special | 18:09 |
SRabbelier | dhans: our Job system runs on top of that | 18:09 |
dhans | SRabbelier: OK, I just was not sure:) | 18:09 |
SRabbelier | dhans: catches DealineExceededExceptions and handles gracefully | 18:10 |
SRabbelier | (by rescheduling the job, etc) | 18:10 |
dhans | SRabbelier: ok, thanks:) | 18:10 |
SRabbelier | and it'll run as many Jobs in one 'poke' as possible | 18:10 |
jamtoday | ajaksu: It does start misbehaving if you create a survey, someone takes the survey, and then you edit the survey | 18:10 |
SRabbelier | so it's ok to define "small" jobs | 18:10 |
SRabbelier | it won't slow down the system | 18:10 |
jamtoday | makes it harder to diagnose since it's failing silently | 18:11 |
ajaksu | jamtoday: the field order in the form gets messed or something worse? | 18:11 |
* SRabbelier is off to bed | 18:12 | |
SRabbelier | g'night all! | 18:12 |
*** dhaun has quit IRC | 18:12 | |
dhans | SRabbelier: bye | 18:12 |
SRabbelier | :) | 18:12 |
*** SRabbelier has quit IRC | 18:12 | |
*** dhans has quit IRC | 18:14 | |
jamtoday | ajaksu: I just had to add a default None option for a getattr() | 18:16 |
jamtoday | so now it says None instead of skipping to the next field | 18:17 |
ajaksu | jamtoday: cool, I think the cache issue is officially no more and you're done fixing the ordering, I'll try that trick for showing different names for permissions in midterm :) | 18:19 |
*** jamtoday has quit IRC | 18:29 | |
*** jamtoday has joined #melange | 18:32 | |
*** solydzajs has quit IRC | 18:36 | |
*** Merio has quit IRC | 19:00 | |
jamtoday | ajaksu: found some more bugs I left in the edit survey JS...I think there were two versions of this file floating around and I was being careless with my merges :( | 19:01 |
ajaksu | jamtoday: if it makes you feel better, I've decided to go back to your initial midterms and forget the mess I made on it :) | 19:06 |
jamtoday | I just pushed a bunch of fixes | 19:15 |
jamtoday | I took away your __deleted__ code, but it's going to be easier that way | 19:15 |
jamtoday | And I've confirmed that everything relating to editing surveys works | 19:15 |
*** dmitrig01|afk has joined #melange | 19:55 | |
*** ChanServ sets mode: +v dmitrig01|afk | 19:55 | |
*** dmitrig01|afk is now known as dmitrig0` | 19:56 | |
*** dmitrig0` is now known as dmitrig01 | 19:56 | |
*** solydzajs has joined #melange | 21:05 | |
*** ChanServ sets mode: +o solydzajs | 21:05 | |
*** solydzajs has quit IRC | 21:07 | |
*** forever has joined #melange | 22:06 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!