Friday, 2009-05-22

*** tpb has joined #melange00:00
*** madrazr has joined #melange00:07
*** madrazr has left #melange00:27
ajaksujamtoday: 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 #melange00:42
*** ChanServ sets mode: +o solydzajs00:42
*** dmitrig01_ has quit IRC00:57
*** dmitrig01|afk has joined #melange00:57
*** ChanServ sets mode: +v dmitrig01|afk00:57
*** dbentley-lapto1 has joined #melange01:27
*** penyaskito has quit IRC01:27
*** dbentley-laptop has quit IRC01:45
*** forever has quit IRC01:57
*** dbentley-lapto1 has left #melange01:59
*** dmitrig01|afk has quit IRC02:16
*** madrazr has joined #melange02:50
*** madrazr has quit IRC03:07
*** forever has joined #melange04:16
*** mithro has quit IRC05:00
*** MatthewWilkes has joined #melange05:44
*** scorche has quit IRC06:00
*** scorche has joined #melange06:00
*** SRabbelier has joined #melange06:16
*** ChanServ sets mode: +o SRabbelier06:16
*** dhans has joined #melange06:51
*** SRabbelier has quit IRC07:09
*** SRabbelier has joined #melange07:10
*** ChanServ sets mode: +o SRabbelier07:10
*** SRabbelier has quit IRC07:11
*** SRabbelier has joined #melange07:12
*** ChanServ sets mode: +o SRabbelier07:12
SRabbelierajaksu: ping07:35
*** dhans has quit IRC07:42
*** solydzajs has quit IRC08:15
*** florinciu has joined #melange08:28
*** dhans has joined #melange08:30
*** madrazr has joined #melange08:56
*** dr__house has joined #melange09:26
*** forever has quit IRC10:09
ajaksuSRabbelier: 3½ hours late pong10:57
SRabbelierajaksu: nice :)10:58
SRabbelierajaksu: can you rebase your branch on Jame's latest?10:58
*** penyaskito has joined #melange10:58
ajaksuSRabbelier: yep, I'll try that in about 15 minutes11:00
SRabbelierajaksu: win11:00
ajaksuhopefully I'm going to code a lot today :)11:00
SRabbelierajaksu: I hopez I hopez I hoepz? :D11:01
*** solydzajs has joined #melange11:05
*** ChanServ sets mode: +o solydzajs11:05
ajaksuSRabbelier: 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
ajaksubah, lemme try, otherwise I'll never learn this stuff :)11:10
SRabbelierajaksu: you should be able to rebase your work, which means that you will not lose any code11:11
ErantHg?11:16
SRabbelierErant: yes11:26
SRabbelierErant: but James has his code on github11:27
SRabbelierErant: I think ajaksu is using hg-git11:27
ajaksuonly git for github, but I'm using hg for my local work :)11:27
ErantHow's Hg compared to Git? I've only worked with Git so far11:29
SRabbelierErant: Hg is like git, only it won't give you the damn shotgun11:29
SRabbelierErant: it's like "nono, here, try this watergun instead"11:29
SRabbelierErant: sure, it's funny for a while, but it gets damn frustrating if you know what you're doing11:29
SRabbelierErant: (and as such don't want/need handholding)11:30
ajaksuErant: hg is very comfy if you're a bit unsure about what you're doing, so it's really great for me :)11:30
Erantlol11:32
ajaksubtw, 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
ErantSRabbelier: 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
SRabbelierErant: exactly ^_^11:32
*** florinciu has quit IRC11:33
ajaksuI think bzr is java (without the performance), hg is closer to python :)11:33
ajaksuouch, multistep rebase, gross11:35
SRabbeliermultistep?11:36
madrazrajaksu: no bzr is Python too11:38
madrazrthats exactly what delayed Python's switch to Hg(Guido was confused to which one to choose? ;-) )11:38
ajaksusplit commit actually... while in real life, we use patches without history all the time :)11:38
ajaksumadrazr: I meant in the 'git is to hg as C is to Java' sense :)11:39
madrazrajaksu: he he Ok11:40
SRabbeliergit is awesome like hg is not? :P11:42
* SRabbelier runs11:42
ajaksuLOL, 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
ajaksuSRabbelier: 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
SRabbelierajaksu: you need those 23MB11:43
SRabbelierajaksu: that's the new commits11:43
SRabbelierajaksu: and you won't have to downlod them again11:43
SRabbelierajaksu: do you want me to do the rebase for you?11:44
ajaksuSRabbelier: git rebase jamslevy/master now?11:44
SRabbelierajaksu: 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
ajaksuSRabbelier: your initial github repo was wrong? james's? mine?11:46
SRabbelierajaksu: mine was wrong11:46
SRabbelierajaksu: but, what you can do11:46
SRabbelierajaksu: is 'git checkout -t jamslevy/master11:47
SRabbelierajaksu: which will put you on a branch tracking james11:47
SRabbelierajaksu: and then you can 'cherry-pick' your changes11:47
ajaksuSRabbelier: that means cherrypicking... diffstat: 8 files changed, 520 insertions(+), 579 deletions(-)11:49
ajaksutons of tabs to spaces11:49
SRabbelierajaksu: ok11:51
SRabbelierajaksu: whitespace fixes?11:51
*** penyaskito has quit IRC11:51
ajaksuSRabbelier: and general style http://github.com/ajaksu/Melange/commit/f604675b773b12eff41a965f083a6dded902e50711:52
tpb<http://ln-s.net/3DZh> (at github.com)11:52
SRabbelierajaksu: ok, do you know how to  cherry-pick?11:53
ajaksuSRabbelier: 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
SRabbelierajaksu: wait, am I right that you have only one commit that you want to apply?11:57
SRabbelierajaksu: do 'git checkout master && git reset --hard jamslevy/master && git cherry-pick f604675b773b12eff41a965f083a6dded902e507'11:57
*** Merio has joined #melange11:58
ajaksuSRabbelier: 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
SRabbelierajaksu: because you don't think git :P12:00
SRabbelierajaksu: not to worry, this should be the last time you need to do this :P12:01
SRabbelierajaksu: after you're done, you can do 'git push -f' to update your github12:02
ajaksuaha, 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
SRabbelierajaksu: worth a shot, make sure your hg repo is indeed up to date :)12:11
* SRabbelier is off for dinner12:20
* SRabbelier is back12:46
*** SRabbelier has quit IRC12:48
*** madrazr has left #melange13:00
*** SRabbelier has joined #melange13:06
*** ChanServ sets mode: +o SRabbelier13:06
*** Merio has quit IRC13:20
ajaksuSRabbelier: 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
SRabbelierajaksu: I wiill update my repo, one sec13:23
SRabbelierajaksu: please do base your changes off my branch, I'll try to make sure it's always up to date :)13:23
SRabbelierajaksu: 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 #melange13:25
ajaksuSRabbelier: 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
SRabbelierajaksu: why do you have more than one checkout/13:25
SRabbelier?13:25
*** dhaun has joined #melange13:28
ajaksu1st 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
SRabbelierajaksu: hehe, ok13:29
SRabbelierajaksu: can you push your repo that's rebased to James' latest to github so I can integrate it?13:30
ajaksusure, one sec :)13:31
SRabbelierajaksu: awesome, thanks13:32
ajaksuSRabbelier: done, I think... :)13:38
SRabbelierajaksu: win13:38
ajaksuSRabbelier: 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
SRabbelierajaksu: one question, why did you merge with master?13:43
SRabbelierajaksu: sr/master that is13:43
SRabbelierajaksu: I say blow away 7d2c1322c33ef68bef02684f94b11a2af465a99e and push 7a14b318ced95b7244c348a65d5a063c222ccb72 instead13:43
ajaksuSRabbelier: because pull said I was up-to-date, as I fork from james's repo?13:44
SRabbelierajaksu: yes, but why did you pull from me?13:45
SRabbelierajaksu: (I'm suggesting that you do 'git checkout master && git reset --hard 7a14b318ced && git push -f')13:45
ajaksuSRabbelier: because you had pawel's commit, I thought I should have it before pushing...13:45
SRabbelierajaksu: ah, no, you should ask james to rebase instead13:46
SRabbelierajaksu: or, mhhh13:46
SRabbelierajaksu: yes13:46
ajaksubefore I push?13:46
SRabbelierajaksu: that'd work13:46
SRabbelierajaksu: no, you can just push like this13:46
SRabbelierajaksu: that's fine13:46
SRabbelierajaksu: without pawel's commit13:46
SRabbelierajaksu: it doesn't affect your code, so it's np if you don't have it13:46
ajaksuok, then later when james is up-to-date, I'm up-to-date13:47
SRabbelierajaksu: exactly13:47
SRabbelierajaksu: or, what you could do too13:47
SRabbelierajaksu: is ask james to pull from you13:47
SRabbelierajaksu: -then- rebase13:47
SRabbelierajaksu: but eh, it really doesn't matter much :)13:48
ajaksuSRabbelier: 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
SRabbelierajaksu: a reindent.py commit hook?13:53
SRabbelierajaksu: I don't think we have any commit hooks set up tbh13:53
SRabbelierajaksu: and you should be done with the dance now, I apologise for messing up which forced you guys to rebase13:54
ajaksuSRabbelier: 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
SRabbelierajaksu: ok, if you prefer merging that's fine13:58
SRabbelierajaksu: it's just in the git community it's less weird to rebase13:59
*** madrazr has joined #melange14:03
ajaksuSRabbelier: 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
SRabbelierajaksu: probably because you had to do a weird rebase14:05
SRabbelierajaksu: you should try rebasing (on a new branch) on top of latest master14:05
SRabbelierajaksu: it's real easy :)14:05
SRabbelierajaksu: 'git checkout test && git rebase sr/master'14:05
SRabbelierajaksu: and that should give you a properly rebased repo with no hassle :)14:06
ajaksuSRabbelier: 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
SRabbelierajaksu: there will be no problems if you are the downstream user14:08
SRabbelierajaksu: say you want james to merge your changes14:09
SRabbelierajaksu: you could make that easy for him by rebasing your changes on his latest master14:09
ajaksuSRabbelier: 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
SRabbelierajaksu: no, you should only rebase on one upstream14:11
SRabbelierajaksu: so either on his, or on mine14:11
ajaksuok, 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
ajaksuwhat would be the correct path? rebase from him, then...?14:14
SRabbelierajaksu: right, so he should not rebase14:15
ajaksuSRabbelier: 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
SRabbelierajaksu: yes14:16
SRabbelierajaksu: only the leaf nodes should rebase14:16
SRabbelierajaksu: ofcourse, eventually, when you two are done14:16
SRabbelierajaksu: (or when you and james agree to)14:16
SRabbelierajaksu: he could rebase on me14:17
SRabbelierajaksu: to make it easy for me to pull his changes14:17
ajaksuSRabbelier: 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 IRC14:19
SRabbelierajaksu: you can't make a nice patch series like that14:19
SRabbelierajaksu: sending someone a patch bomb with one huge patch... not so likely to be accepted14:20
ajaksuSRabbelier: 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
SRabbelierajaksu: no, that was only because he had to rebase all of his commits (due to my fsckup)14:21
SRabbelierajaksu: I hope he will later on split those into multiple commits :P14:21
ajaksuSRabbelier: well, I have mine on hg if we ever want history or code reviews :)14:22
SRabbelierajaksu: those are too granular14:23
ajaksuSRabbelier: 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
SRabbelierajaksu: cheater :P14:26
* ajaksu goes to see how fixed the cache issue is, then make a decent midterm subclass of survey14: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:D14:37
SRabbelierpretty sweet14:37
ajaksujamtoday: ping?14:44
*** Merio has joined #melange14:53
jamtodayajaksu: pong14:56
jamtodayajaksu: uh oh...what's broken?14:57
SRabbelierjamtoday: that's usually what I say when one of my team mates ping me14:58
ajaksujamtoday: one thing I broke (mixhandled tabs to spaces in your helpers/surveys.py commit, let me confirm) :)14:59
ajaksujamtoday: and one you broke, if len(survey) == 0: should be len(survey.fields), let me check :)15:01
jamtodayajaksu: 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 IDE15:02
jamtodayI couldn't figure out a way to add fields to the instance of the SurveyForm without adding the fields to SurveyForm.base_fields15:04
ajaksujamtoday: 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 whitespace15:04
jamtodayBut I do think you're right about that being the root of the ghost field problem15:04
SRabbelierjamtoday: you're not using eclipse+pydev?15:06
SRabbelierjamtoday: perhaps you need to copy15:06
jamtodayI'm using Geany on Ubunut15:06
SRabbelierjamtoday: copy the base_fields first15:06
SRabbelierjamtoday: update as needed15:06
SRabbelierjamtoday: then update only the instance?15:06
jamtodayUbunut being a cheap rip off of Ubuntu15:06
ajaksujamtoday: lemme look at BaseModelForm and friends15:06
ajaksueclipse? ew :)15:07
SRabbelierjamtoday: Ubunut?15:08
SRabbelierajaksu: eclipse+pydev is not so ew actually15:08
SRabbelierajaksu: it has the only decent autocompletion for python I've seen so far15:08
jamtodaySRabbelier: Can it write my code for me?15:08
SRabbelierjamtoday: yes, if you ask it nicely15:09
SRabbelierjamtoday: but then again, you could use emacs for that too, with C-m, C-L, C-homework15:09
ajaksuSRabbelier: 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
jamtodaySRabbelier: I've never fully delved into macros etc. But it's on the todo list!15:10
jamtodayajaksu: you're right. I just got a TemplateSyntaxError15:12
SRabbelierajaksu: I didn't say you need the autocompletion to be bearable15:13
SRabbelierajaksu: but you are sure missing out without it15:13
ajaksujamtoday: maybe we should be using a dynaform? or something that allows us to set fields on the instance15:13
SRabbelierjamtoday: macro's15:13
SRabbelierjamtoday: ?15:13
jamtodayajaksu: I started to prototyped it, and then decided it would be easier just to inherit from ModelForm directly15:17
jamtodayAnd 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
ajaksujamtoday: I have no idea, but I think returning self.fields from get_fields should be enough... trying :)15:30
ajaksujamtoday: it works15:33
ajaksuMAN IT WORKS :)15:33
ajaksunow, to fix the custom prompts not being saved15:33
jamtodayIt looks like it's only saving the newest fields added15:34
ajaksujamtoday: did you get my cache fix commit? it was working for keeping (and growing or shrinking) the schema and custom prompts15:36
ajaksuI just have to figure out what your patch changes in that area15:36
jamtodayI think so...but it's possible I missed it15:37
ajaksujamtoday: and you'd need http://paste.pocoo.org/show/118570/ or something equivalent that adds the to-be-deleted fieldnames to a __deleted__ hidden inputfor15:38
tpbTitle: Paste #118570 | LodgeIt! (at paste.pocoo.org)15:38
ajaksu* input15:38
ajaksuhttp://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
jamtodayajaksu: we shouldn't need hidden fields to determine deleted fields15:44
jamtodayIn logic/models/survey.py there's this:       # wipe clean existing dynamic properties if they exist15:44
jamtoday      for prop in this_survey.dynamic_properties():15:44
jamtoday        delattr(this_survey, prop)15:44
jamtodaySo every time an existing survey is edited, it deletes all fields before re-adding them15:44
jamtodaySo if a field isn't sent in the POST, it is removed15:45
ajaksujamtoday: that's not how it's working for me, before my changes any edit would zap the schema and all fields...15:45
ajaksucan you create a survey, look at its SurveyContent, then delete one field and refresh the SurveyContent?15:46
ajaksujamtoday: I can confirm here that without my hack the schema and fields get zapped, do you get different behavior there?15:50
ajaksuIIUC, 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 runtime15:52
ajaksuso maybe we don't need a hidden field, but we need a list of previous fields to compare to those present in the current POST15:52
jamtodayI'm getting this behavior, but it was working fine until recently15:53
ajaksuI could never get it to work right, that's why I let the midterm stuff rest15:53
ajaksuand 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
ajaksubrb15:56
jamtodayajaksu: there's some code I'm missing16:00
ajaksujamtoday: other than http://github.com/ajaksu/Melange/commit/7a14b318ced95b7244c348a65d5a063c222ccb72 ?16:01
tpb<http://ln-s.net/3Dcz> (at github.com)16:01
jamtodaythere's no __deleted__ component in the javascript16:01
ajaksujamtoday: 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
jamtodaynot a big jQuery fan?16:06
ajaksujamtoday: 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
ajaksujamtoday:  widget.find('a.delete img').click(function(){ -> add appending of the field name to __deleted__ if value === '', otherwhise ',' + field name :)16:10
ajaksuah, 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 think16:11
SRabbelierajaksu: wouldn't it be easy to rerun fixindent and jslint?16:12
ajaksuSRabbelier: reindent yes, jslint needs manual editing (at least the one I use does)16:13
SRabbelierajaksu: ah, ok16:13
ajaksuSRabbelier: http://bitbucket.org/ajaksu/melange-surveys/changeset/f7eebc58ed4c/ :)16:14
tpb<http://ln-s.net/3Ddn> (at bitbucket.org)16:14
jamtodayajaksu: taking surveys is also not working. It was all going so smoothly a couple days ago16:15
jamtodayexcept for the ghost field problem16:15
*** MatthewWilkes has quit IRC16:16
ajaksujamtoday: 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
ajaksuactually, that woud be something in EditSurvey and TakeSurvey, right?16:23
jamtodayoh no....16:24
jamtodaywhy is it duplicated every field with a hidden version?16:25
jamtodayThat's what causing the problems16:26
ajaksujamtoday: maybe it was my code that broke it?16:26
jamtodaynope...it was my growfield plugin16:27
jamtodaybut thats not the only problem16:31
*** dr__house has quit IRC16:32
ajaksumaybe my changes to View._editPost... or _editPost should populate self.fields as SurveyForm.base_fields.insert(position, property, self.fields[property]) did?16:33
ajaksubut in a setattr(this_survey, property, POST[mangled_property_name]) way?16:34
*** madrazr1 has joined #melange16:34
jamtodayits breaking16:37
jamtodaythe surveys.py SurveyForm class breaks in the for loop16:37
jamtodayand it's failing silently :(16:37
ajaksujamtoday: the version I have in git does, your original one didn't, did it?16:38
ajaksujamtoday: the return line should be outside the for, otherwise we miss the other fields16:39
jamtodayoh so THAT's how for loops work16:40
jamtoday(kidding)16:40
jamtodaythats why they tell you not to have large indented blocks in python 10116:40
ajaksuIt was what I broke earlier, I need 'Python for Toddlers' :)16:42
jamtodayokay that adjustment obviously fixed a lot, now i'm back to the custom prompts16:43
jamtodayit's being stored in the database correctlyu16:44
jamtodayOkay, so it's fine until it reaches the front-end, so we're back to the ghost field problem16:46
ajaksupeeking at survey.fields after we call get_fields...16:49
*** madrazr has quit IRC16:50
jamtodaysurvey.fields is a dictionary that is being setup in get_fields16:51
jamtodayI didn't think it had any significance beyond being a temporary store16:51
*** jamtoday has quit IRC16:51
*** jamtoday has joined #melange16:52
ajaksujamtoday: it works, man it works :)17:00
jamtodaypastebin your SurveyForm code17:00
ajaksujamtoday: http://paste.pocoo.org/show/118585/ for full file, diff...17:03
tpbTitle: Paste #118585 | LodgeIt! (at paste.pocoo.org)17:04
jamtodayI'm still having trouble getting the ordering and initial vals to work without using the base_fields17:04
ajaksuhere http://paste.pocoo.org/show/118586/17:05
tpbTitle: Paste #118586 | LodgeIt! (at paste.pocoo.org)17:05
jamtodayInitial argument ftw17:05
jamtodayNow there's just the ordering of fields17:05
ajaksujamtoday: 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 case17:10
ajaksuself.fields it is, we can remove the return from get_fields :)17:11
jamtodayhttp://paste.pocoo.org/show/118588/17:11
tpbTitle: Paste #118588 | LodgeIt! (at paste.pocoo.org)17:11
jamtodayI'm using the survey_fields attribute just to gather the fields, and then inserting them in order to self.fields17:12
jamtodayworking nicely now :)17:13
* jamtoday is ordering the survey records to be in their proper order as well17:15
ajaksugreat! :)17:16
jamtoday it looks like list_key_order should be the target here17:24
ajaksujamtoday: 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
jamtodaygetQueryForFields17:37
jamtodayI took the survey_order and made it a method of the SurveyContent class, and now I'm trying to figure to make the order arg17:37
ajaksufor key in order: query.order(key) ?17:37
ajaksuman, this code is fun to dig, you never know how far it goes :)17:38
ajaksudef order(self, property):17:40
ajaksu    """Set order of query result.17:40
ajaksu17:40
ajaksu    To use descending order, prepend '-' (minus) to the property17:40
ajaksu    name, e.g., '-date' rather than 'date'.17:40
ajaksu17:40
jamtodaywhere is that method?17:43
ajaksujamtoday: tack an .index attribute to the fields?17:43
jamtodayI've got an order list setup like ['key1', 'key2'...] but it isn't affecting the list order17:44
jamtodaySRabbelier: ping?17:44
ajaksujamtoday: /google/appengine/ext/db/__init__.py , but that should be about the format... so17:44
ajaksuso I think we might need to set properties on something (fields?) and order is only the name of that something17:45
ajaksuoops, of those properties17:45
ajaksuspecifically, the code in db.Query will sort by named Expando attributes, how do we map this to form fields?17:46
*** madrazr1 has left #melange17:46
SRabbelierjamtoday: pong17:48
SRabbelierajaksu, jamtoday: is your latest code @ github?17:51
SRabbelier(doesn't seem to be?)17:51
ajaksuSRabbelier: not mine, jamtoday?17:51
jamtodayI'll push what I have right now17:52
SRabbelierajaksu: can you make sure it is there in 5 hours?17:52
SRabbelierI'll do a synch before I leave (in 6 hours or so)17:52
jamtodayI just fixed a major bug related to an indentation mistake :)17:52
SRabbelierjamtoday: hehe, I read that I think :)17:52
SRabbelierjamtoday: win :)17:52
jamtodayI was pinging you about how to set the order of values in a list17:52
ajaksujamtoday: another one or my early return again? :)17:52
ajaksujamtoday: in a form?17:53
jamtodayI tried passing an order list to getQueryforFields17:53
SRabbelierjamtoday: that should work17:53
jamtodayand the order list is like ['key1', 'key2'...]17:53
SRabbelierjamtoday: if you pass it a list it will order on those17:53
SRabbelierjamtoday: but but it won't work unless you have an index17:53
ajaksujamtoday: are you trying to order form fields or entities in a list?17:53
SRabbelierjamtoday: you could do the sorting after retrieving the data17:53
SRabbelierjamtoday: using .sort17:53
jamtodayah, so i need to add to index.yaml?17:53
SRabbelierjamtoday: and a custom key getting17:53
SRabbelierjamtoday: you could do that too17:54
jamtodayThe data is sorted, but the headers aren't17:54
SRabbelierjamtoday: headers./17:54
SRabbelier?17:54
ajaksujamtoday: are you trying to order form fields or entities in a list?17:54
* SRabbelier is brb17:54
ajaksuSRabbelier: I think you two might be reading different meanings in 'key1', 'key2' :)17:54
ajaksuIIUC, key1 is 'sort by property named key1', key2 is 'then, by the one named key2'...17:55
dhansSRabbelier: 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
SRabbelierajaksu: correct17:58
SRabbelierdhans: pretty sweet! :D17:59
SRabbelierdhans: what kind of patterns btw?17:59
ErantXOR patterns, obv.17:59
ajaksujamtoday: from django.utils.datastructures import SortedDict  ?17:59
SRabbelierajaksu: let's not go there :P17:59
dhansSRabbelier: those patterns which redirects to a proper page18:00
SRabbelierdhans: define proper page?18:00
ajaksuSRabbelier: how can we maintain field order within a form? :)18:00
ajaksuhttp://code.djangoproject.com/changeset/4093 goes there :)18:00
tpbTitle: Changeset 4093 - Django - Trac (at code.djangoproject.com)18:00
SRabbelierajaksu: as said, use .sort :)18:00
dhansSRabbelier: in each view you define some extra_django_patterns so that these patterns redirects us to this particular view18:01
SRabbelierdhans: those patterns define a mapping from an url to a view18:02
SRabbelierdhans: but you said you figured it out? :)18:03
dhansSRabbelier: I know it, but didn't know how to express it:) mapping is a good word:)18:03
SRabbelierdhans: yay for terminology :)18:03
dhansSRabbelier: 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
SRabbelierdhans: nice :)18:05
ajaksuSRabbelier: SurveyForm has no .sort, .fields is a dict... are you thinking of a Query or am I looking in the wrong place?18:05
jamtodayI got it working18:05
SRabbelierajaksu: methink you should sort the data you are using to feed the form18:05
SRabbelierjamtoday: how'd you do it :)18:05
jamtodayI just added an ordered_properties method to the SurveyContent class18:06
SRabbelierjamtoday: oh? and it automagically works?18:06
SRabbelierjamtoday: or do you mean you then iterate over that in the django template?18:06
jamtodayAfter I call it from the handler it does :)18:06
SRabbeliersmart :)18:06
ajaksucool :)18:07
SRabbelieranyway, I must be off to bed18:08
ajaksujamtoday: so you use it instead of .dynamic_properties() ?18:08
SRabbelierplease do synch your code before I get up :)18:08
jamtodayajaksu: exactly18:08
ajaksuSRabbelier: good night, thanks for helping :)18:08
SRabbelierajaksu: hehe, didn't do much, but np :)18:08
ajaksujamtoday: very cool :)18:09
dhansSRabbelier: wait a second!:)18:09
SRabbelierjamtoday, ajaksu: good luck both, great to see you two cooperating :)18:09
SRabbelierdhans: yes? :)18:09
dhansSRabbelier: 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
SRabbelierdhans: cron job = the same as poking at a certain url every so often18:09
SRabbelierdhans: nothing special18:09
SRabbelierdhans: our Job system runs on top of that18:09
dhansSRabbelier: OK, I just was not sure:)18:09
SRabbelierdhans: catches DealineExceededExceptions and handles gracefully18:10
SRabbelier(by rescheduling the job, etc)18:10
dhansSRabbelier: ok, thanks:)18:10
SRabbelierand it'll run as many Jobs in one 'poke' as possible18:10
jamtodayajaksu: It does start misbehaving if you create a survey, someone takes the survey, and then you edit the survey18:10
SRabbelierso it's ok to define "small" jobs18:10
SRabbelierit won't slow down the system18:10
jamtodaymakes it harder to diagnose since it's failing silently18:11
ajaksujamtoday: the field order in the form gets messed or something worse?18:11
* SRabbelier is off to bed18:12
SRabbelierg'night all!18:12
*** dhaun has quit IRC18:12
dhansSRabbelier: bye18:12
SRabbelier:)18:12
*** SRabbelier has quit IRC18:12
*** dhans has quit IRC18:14
jamtodayajaksu: I just had to add a default None option for a getattr()18:16
jamtodayso now it says None instead of skipping to the next field18:17
ajaksujamtoday: 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 IRC18:29
*** jamtoday has joined #melange18:32
*** solydzajs has quit IRC18:36
*** Merio has quit IRC19:00
jamtodayajaksu: 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
ajaksujamtoday: 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
jamtodayI just pushed a bunch of fixes19:15
jamtodayI took away your __deleted__ code, but it's going to be easier that way19:15
jamtodayAnd I've confirmed that everything relating to editing surveys works19:15
*** dmitrig01|afk has joined #melange19:55
*** ChanServ sets mode: +v dmitrig01|afk19:55
*** dmitrig01|afk is now known as dmitrig0`19:56
*** dmitrig0` is now known as dmitrig0119:56
*** solydzajs has joined #melange21:05
*** ChanServ sets mode: +o solydzajs21:05
*** solydzajs has quit IRC21:07
*** forever has joined #melange22:06

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!