IRC log of #schooltool for Friday, 2006-06-09

pcarduneth1a: sure00:09
*** jinty has quit IRC00:23
*** brigadoon has joined #schooltool00:26
*** brigadoon has quit IRC00:30
*** tristil has quit IRC00:46
*** pcardune has quit IRC00:58
*** felipe__ has joined #schooltool01:50
*** felipe__ has quit IRC02:30
*** jinty has joined #schooltool04:46
*** th1a_ has joined #schooltool04:58
th1a_srichter: ayt?04:58
*** jinty has quit IRC05:11
*** th1a_ has quit IRC08:20
*** kwak has joined #schooltool08:51
*** kwak has left #schooltool08:54
*** kitblake has left #schooltool10:34
*** mgedmin has joined #schooltool11:50
*** gintas has joined #schooltool12:15
povbot/svn/commits: * faassen committed revision 6218:12:50
povbot/svn/commits: Add generation code that:12:50
povbot/svn/commits: * sets up the required utilities for demographics.12:50
povbot/svn/commits: * catalogs all persons by sending ObjectAddedEvent.12:50
* mgedmin notices that buildbot was idling for a couple of days13:11
* mgedmin kicks buildbot in the nethers13:11
*** gintas has quit IRC13:27
*** vidasp has joined #schooltool13:29
povbot/svn/commits: * faassen committed revision 6219:13:31
povbot/svn/commits: Improve search form. Put in some explanatory text, and hook it up to the menu.13:32
*** faassen has joined #schooltool13:34
*** povbuildbot has joined #schooltool13:35
*** gintas has joined #schooltool13:44
*** gintas has quit IRC13:47
*** gintas has joined #schooltool13:48
*** didymo has quit IRC13:59
*** jinty has joined #schooltool14:02
*** gintas has quit IRC14:10
*** ignas has joined #schooltool14:11
*** srichter has quit IRC14:18
*** thisfred has joined #schooltool14:23
ignasfaassen: ping14:31
faassenignas: pong15:08
ignasi sent an email explaining what's the problem with evolution15:08
faassenignas: I'll mail you the Data.fs15:09
faassenignas: I just sent you the Data.fs15:09
faassenignas: I tihnk it's more efficient if you look into it.15:09
ignasit's a 5 minute fix anyway15:11
*** mgedmin has quit IRC15:12
*** mgedmin has joined #schooltool15:14
ignasfaassen: the evolution still breaks, as it seems person objects lose their parents or something :/15:18
ignasshould i just commit the change and leave it to you ?15:18
ignasi am getting tracebacks when trying to view persons calendar15:19
ignaswhile i can see the list of persons or persons themselves without a hitch15:19
povbot/svn/commits: * ignas committed revision 6220:15:25
povbot/svn/commits: Fix invalid deprecation of Term and TermContainer.15:25
faassenyou just get deprecation warnings now.15:27
faassenand what will be do by 0.15? :)15:27
faassenwrite the evolution script that does actually move the class?15:27
faassenanyway thanks for the fix.15:30
ignas1. there will be no 0.15 :D we will have SchoolTool200615:32
ignas2. we will state that we do not support migration from schooltool0.13 to schooltool200715:32
ignasi just understood the implications of your statement15:33
ignasterm container stays with it's old class :/15:34
ignasso deprecation actually is for deprecating interfaces not ZODB classes15:34
ignaswonder why srichter did it with deprecation not evolution then ...15:35
faassenwell, if you deprecate a ZODB class, you need to provide an evolution that upgrades it.15:35
faassenI don't know.15:35
faassenbecause it's a million times easier? :)15:35
ignasbingo :)15:36
faassenI mean, in general it makes sense to deprecate ZODb classes I guess.15:36
faassenif you move them.15:36
faassenif you have clients that use the systme as a framework.15:36
faassensuch as in the case of Zope 3 core and less so for Schooltool15:36
faassenas then your clients know they need to fix things.15:36
ignaswhat clients ?15:41
faassenclients of the framework, I mean.15:42
faassenusers of the framework.15:42
ignasi was being ironic, as schooltool has pretty much no users that use it as a framework15:44
faassenwell, isn't pc..what's his name? one..15:45
faassenand there's the whole intent of the commendation package.15:45
faassenbut I'm actually pretty glad there's nobody who is using it as a framework right now. :)15:45
faassenso for schooltool, deprecation warnings are not so important I'd say.15:45
ignasby the way - can you see calendar for schooltool manager after migrating the Data.fs.small ?15:48
*** jinty has quit IRC15:48
faassenhm, no.15:50
faassenTypeError:    ('Not enough context information to get parent', <schooltool.person.person.Person object at 0xb12b176c>)15:50
faassenweird though, that shouldn't be a schooltool.person.person object.15:50
faassenit should be a schooltool.demographics.person object.15:50
faassenand it is.15:50
faassenso what is it complaining about ..15:50
mgedminfaassen: did you write an evolution script to replace schooltool.person persons witrh demographics persons?15:51
faassenand it works.15:51
faassenusing the introspector, it shows that manager is a demographics person.15:51
mgedminare you sure you got all the references to the old person objects?15:51
faassenmgedmin: well, not anymore obviously.15:51
mgedminit seems to me that the demo person points to some subobject (e.g. calendar?) that has a __parent__ that still points to the old object15:51
mgedminthe old object is dangling (has no __parent__ or something)15:52
faassenso that might be the calendar overlay.15:52
mgedminor it could be that references to the old person object remain somewhere deep in the internals of relationship links15:52
mgedminreplacing an object's class is very very tricky with zodb15:52
faassenI suspect it's just the parent link. I did take care of relationships by just reestablishing them.15:52
faassenokay, ..15:54
faassenoverload_calendars is more complicated than I suspected. :)15:54
faassenI think it turns out to be a BoundOverlaidCalendarsProperty15:54
faassenwhich is a BoundRelationshipProperty15:54
faassenheh, I actually wonder who we're doing this for.15:55
ignasi think calendar overlays must be punished15:55
faassenwell evolving classes is painfully painful. :)15:56
faassenmaybe it's the clincher and I should've used annotations everywhere, though that would've been painful elsewhere.15:56
faassenI sort of think, I should write a test for this.15:56
faassenthough I expect that would cost me the entire afternoon again.15:56
faassenand I just spent a day writing tests for evolve17.py15:57
faassensatisfying the catalog.15:57
ignasi'd say that a surface test that only checks "that the code does that what you think it does" would suffice15:59
ignastough in the long term resurrecting the migration functional testing15:59
ignaswould be nice15:59
faassenit depends on how much set up the test needs.16:00
faassenthe setup is the painful thing.16:00
faassenlovely. NoSuchRelationship.16:02
faassenI tried to do the same thing as for the groups relationship.16:02
faassenbut I get 'NoSuchRelationship'16:02
*** pcardune has joined #schooltool16:03
faassenof course I do eyeball testing by actually starting schooltool.16:03
faassenprobably I wouldn't have been able to replicate this problem if I set up stuff in the test. :)16:03
faassenare overlaid calendars relationships that just cannot be removed or something?16:04
faassenthe doctest of overlaid calendars claims it should work.16:05
faassenokay, so calendar overlays don't appear to be right.16:10
faassenI don't claim to know how the relationship package works.16:10
faassenbut you'd think this would work:16:10
faassen            calendars = list(person.overlaid_calendars)16:11
faassen            for calendar in calendars:16:11
faassen                person.overlaid_calendars.remove(calendar)16:11
faassenbut it doesn't.16:11
faassenit gives me NoSuchRelationship16:11
mgedminhmm, removing while iterating? scary16:11
mgedmindo you perhaps have security proxies there16:11
faassenwhat do you mean?16:11
faassendidn't you see that list?16:11
mgedminoh, oops16:11
* mgedmin blind16:12
faassenwell, the only thing that seems to be in there..16:12
faassenseems to have a target ..16:12
faassen< object at 0xb660652c>16:12
faassenand the other thing it compares to is16:12
faassen< object at 0xb657766c>16:12
faassendon't know whether that causes it to fail.16:12
faassenbut I think it does.16:13
faassenI mean, I'm not going to be the proper way about this, I'm testing by hand. :)16:13
mgedminthe overlaid_calendars proxy magically constructs transient OverlaidCalendarInfo objects in its __iter__16:13
mgedminbut forgets to take those into account in remove()16:13
mgedminI suspect16:13
faassenI don't think I'm easily capable to do this myself.16:13
faassencapable of doing this myself, that is.16:14
faassenfixing it, I mean.16:14
mgedminno... BoundOverlaidCalendarsProperty's docstring tests that case16:14
mgedminno it doesn't!16:15
mgedminok, here's how to make it work:16:15
mgedminfor cal_info in list(person.overlaid_calendars): person.overlaid_calendars.remove(cal_info.calendar)16:15
mgedminor we could rethink the unobvious api16:16
faassenyou'd expect this to always work for relationships.16:16
faassenI mean, that should be part of the semantics.16:16
faassenin Eiffel, you'd express this with pre and postconditions and it would be inherited.16:16
faassennot that I know Eiffel. :)16:16
mgedminthe abuse of __iter__ is Bad16:16
mgedminthe person who did this was probably smoking something16:17
mgedminum... that would be me, I guess ;)16:17
mgedminanyway, don't these relationship properties have a clear() method?16:18
faassenmight be.16:18
faassenhm, IOverlaidCalendarsProperty doesn't.16:18
faassenit doesn't subclass anything.16:18
mgedminnope, they don't16:19
mgedminthere's a global unrelateAll() function, but it removes *all* relationships16:19
faassenjoy, now it starts but I get some kind of duplicate relationship error16:20
faassenit's hardly as if I added that relationship already.16:21
faassenI set up fresh person objects.16:22
faassenbut perhaps they already ahve some relationship in there..16:22
*** jinty has joined #schooltool16:28
faassenokay, I give up.16:31
faassenI have no idea how to migrate these overlaid calendars.16:31
faassenI've sent a report to the mailing list. :)16:49
*** jinty has quit IRC16:50
ignasZODB sucks :/16:55
ignasand if i would have some time i would actually redo overlaid calendars completely16:57
ignasas the implementation is unflexible and too complex at the same time16:58
faassenyeah, it's pretty complicated.16:58
faassenany code with __get__ in it is overly complicated. :)16:58
faassenand words like Bound.16:58
faassenincluding zope.formlib.16:58
ignasand we can't even have custom colors for overlays with all that complexity16:59
faassenI debugged through it and I saw a reference to colors. :)17:00
faassenthat's all I know about overlays.17:00
faassenI don't really know what's going on. :)17:00
faassenI vaguely wonder what real world schooltools will really be upgrading anyway. :)17:01
ignasa public promise to migrate databases was made so :/ even if there is one user in the basement that is actually using schooltool we must do it17:02
faassenall upgrade strategies have their ups and downs.17:03
faassenXML export and import is hard to make too.17:03
faassenbut avoids a whole set of issues.17:03
faassenit has its own issuse though.17:03
*** jinty has joined #schooltool17:05
ignasfaassen: yay, found the bug17:05
ignasIIRC person added subscriber automatically overlays some calendars17:05
ignasso you should remove all the calendar relationships AFTER adding the person once more17:06
faassenthat's what I suspected but I don't know what to do about t.17:06
faassenagain, huh?17:06
faassenoh, and concerning testing...17:06
faassenthanks for the help by the way.17:06
faassenI mean, I consider writing an actual test for this more trouble than it's worth.17:06
faassenI speak as someone who spent a day writing the catalog test. :)17:06
ignasi'll look at it though17:07
ignasi can refactor some parts17:07
ignasand test them separately17:07
ignasjust to be sure17:07
faassenwill you check in the fix?17:07
faassenor shall I?17:07
ignasi will17:07
faassenI mean, I dno't know how to start writing a test for this.17:07
faassenthanks for the help, that's great. :)17:07
faassensorry I get grumpy.17:07
faassenI am hatching plots to make Zope 3 safe for mortals.17:07
faassenI'm not all complaints. :)17:07
ignas./makezopeinstance --iddqd17:08
faassenwhat's iddqd?17:11
ignasDoom2 immortality cheat code17:11
ignasbtw why exactly are you doing event.notify(ObjectAddedEvent(person)) ?17:12
faassenis that adding overlays?17:12
faassenit's one thing I had my doubts about doing.17:12
faassenI'm doing this to trigger the cataloging.17:12
ignasi see17:12
faassenso my doubts were correct.17:12
faassenI mea,n it triggers the intid index.17:12
ignashow many subscribers there are that do catalogs ?17:12
faassenwhich triggers the catalog.17:12
faassenbut isn't that in evolve16?17:13
faassenI'm confused about the objectadded event in ..17:13
faassenwhy is that adding the overlays?17:13
faassenwe have a problem in evolve14, right?17:13
ignasapparently not17:13
faassenyou mean that it's trying to add them again..17:13
faassenwhile they now already exist.17:13
faassenokay, that explains it.17:13
faassensorry, took me a while to catch up.17:13
faassenanyway, I could change that to manually call the intid thing.17:14
faassenI tink.17:14
ignasone way to do this is "hack the subscriber" to cope with objects that have been "added" twice17:14
faassenI think.17:14
faassenso there's no object added event response.17:14
faassenbasically call addIntIdSubscriber manually.17:15
faassenthat should trigger the right response.17:15
faassen from import addIntIdSubscribe17:15
pcarduneI've got a question about these Crowd things, who should I ask about them?17:16
faassenaddIntIdSubscriber(person, None)17:16
faassennot sure about the None bit. you might have to make a dummy ObjectAddedEvent object.17:16
faassenand pass that on.17:16
faassenignas: would that help you fix it?17:16
ignaslooking at it17:17
faassenignas: any luck?17:28
ignasevolution script works, but i am still getting the traceback when looking at my calendar17:28
faassenwe do avoid the add event now.17:28
faassenand nothing else is subscribed to intids in schooltool.17:29
faassenso evolve17 isn't the issue anymore.17:29
ignasapparently - no17:29
ignasdon't know about unit tests though17:29
faassenwell, leave it like that anyway, it's cleaner.17:29
faassendid you try running the unit tests?17:29
ignas17 pass17:30
ignas14 not yet17:30
faassenprobably as I didn't do enough mockup there.17:31
faassenthis is rather a pain to mock up, and you probably still won't find the real bugs.17:31
ignasi am doing all kinds of bugs not just real ones ;) so they do help me (i have a lot of problems noticing minute details)17:33
*** vidasp has quit IRC17:33
faassenoh, I agree they're helpful.17:35
faassenit's just that I think for upgrade we'd be better off doing functional tests.17:35
ignasthere was a "framework" for that17:37
faassenyeah, yeah, don't scare me. :)17:38
*** alga has joined #SchoolTool17:39
ignasno really, a couple of old Data.fs.0.11 and Data.fs.0.12 files with python scripts that Copy them and run schooltool17:39
ignasso one would not have to do it by hand17:39
faassenI just am scared by frameworks right now. :)17:40
algaHappy BD Martijn!17:41
faassenoh, thanks. :)17:43
faassenthat darn orkut, huh?17:43
faassenwho still uses Orkut in lithuania?17:43
* faassen grins.17:43
th1aHappy birthday, faassen!18:09
th1aWhat could be a better birthday present than working on generations scripts!18:10
faassenI did that yesterday mostly.18:10
mgedminfaassen.generation += 118:10
th1aI do appreciate your persistence, faassen.18:10
faassentoday I wisely decided to give up before I was dragged into it.18:10
mgedminhappy birthday18:10
faassentoo deeply.18:10
faassenth1a: hah, persistence, me? :)18:11
faassenI changed the add form to your behavior now. it works. now to fix all the broken tests. :)18:12
th1aclass faassen(persistent):18:12
faassenth1a: I don't mean your behavior, I mean the behavior you specified. I think. :)18:12
* faassen laughs.18:12
faassenfrom programmer import Grumbly18:13
faassenclass Faassen(Grumbly):18:13
faassen ....18:13
faassenWe test whether Faassen is really grumbly enough:18:13
faassen  >>> faassen.changeAddFormBehavior(Person)18:13
faassen    >>> faassen.runAllTests()18:13
faassen>>> faassen.wait()18:14
faassen>>> faassen.getTestFailureReport()18:15
faassen  "6 failures only"18:15
faassen>>> faassen.rejoice()18:15
faassen>>> faassen.spendHoursFixingTests()18:15
faassen>>> faassen.getEmotionalState()18:15
faassenlet's see whether centralizing the add form thing helped. :)18:16
ignasfaassen: found the bug18:24
faassenwhat was the problem?18:25
ignastricky fungus18:25
ignasproblem is18:26
ignascalendar is stored in annotations18:26
faassenwhat? :)18:26
ignascalendar has __parent__18:26
ignasso one must actually go through objects stored in annotations and check whether they are pointing at the old person18:26
mgedmin<mgedmin> it seems to me that the demo person points to some subobject (e.g. calendar?) that has a __parent__ that still points to the old object18:27
faassenyeah, well, I first had to solve the whole relationship issue. :)18:28
ignasmgedmin: that's lawyer talk18:28
faassenbefore we even go to that thing.18:28
faassen*and* solve the issue concerning dual adding of these relationships.18:29
ignasweird :?18:34
ignascan't grok it ...18:34
ignas__annotations__ do not contain calendar18:34
faassendoesn't the CalendarInfo have a __parent__ thing?18:35
mgedmincould be...18:35
ignaswhat's weird is that - getCalendar takes the calendar out of annotations18:35
faassenor whatever it was.18:36
faassenmaybe those are stored in the special overlaid relationship property thingy.18:36
faassenI know I saw a __parent__ in there.18:36
faassenwhen debugging through it. I was touring the scenery, I had no real idea where I was.18:36
faassenannotations are evil, it's very clear now! :)18:36
faassenwhatever happened to good old attributes. :)18:36
pcarduneSo, does someone have time to answer a few of my crowd questions?18:38
pcarduneI guess everyone has left to watch the world cup18:42
algaI guess you're wrong18:44
faassenI don't watch the world cup. :)18:44
faassenbut I'm going home soon.18:44
pcardunethere is still 15 minutes left for people to leave...18:44
faassenwith geeks it's all a bit confusing, it's actually not trendy to be a world cup fan.18:45
pcarduneI guess I'm just one of those fence sitters... watching the world cup while I program18:45
*** vidasp has joined #schooltool18:46
ignaspcardune: just ask questions18:46
ignasi'll answer them as soon as i am not 100% busy thinking18:46
pcarduneIt seems like you can register permissions/crowds for browser views but what happens to the permissions on the context object the browser view is working on?  Are browser views like trusted adapters?18:48
algaof course they're not18:48
algayou have to have a permission to render the view18:48
algaand the permission to access the data18:49
algain some cases,  the view acts as a "trusted" adapter18:49
faassenthat's not different with crowds now, pcardune18:49
algain that case you need to carefully call removeSecurityProxy in the view18:49
faassenZope 3's security model isn't entirely complete. for instance, if you look up a utility, you can do anything you'd like.18:50
faassenthrough that utility.18:50
mgedminwhat's a "world cup"?18:50
pcarduneok, so i have a grading spreadsheet, which contains data for all students... I want a student to only see his/her data.  there are however different views for spreadsheet and single student grades.  Should I put low permissions on the spreadsheet data, and then higher permissions on the views?18:50
faassenwell, it's this theory that some worlds can have the shape of a cup.18:50
faassenand in certain gravitationally complex systems18:51
mgedmin"and this is how we know the world is banana shaped"18:51
faassenfor instance with a number of gas giants going around a black hole.18:51
faassenyou can have world shapes that are cups.18:51
faassenit only works with certain unified theories, though.18:52
faassenbut general relativity appears to predict the world cup.18:52
faassenmgedmin: that clear? :)18:52
vidaspi thought it has something to do with printing system...18:52
faassenno, that's Cups World.18:52
faassenthe global high flying conference on Cups.18:52
faassenfull of noisy stands, demos of the latest cups extensions.18:52
faassenand a keynote by Steve "Shuttle" Jobs.18:53
algapcardune: yes, that's exactly the case18:53
algapcardune: you ensure that the view does proper checking and does not reveal the data18:53
pcardunehmm.  OK then.  thanks18:53
algapcardune: require high permission on data18:54
algaand have the view do removeSecurityProxy18:54
algaand make the view more or less public18:54
algaand, when using removeSecurityProxy, add a comment explaining why and how18:55
povbot/svn/commits: * faassen committed revision 6221:18:55
povbot/svn/commits: Change the person add form to look mostly like the nameinfo form, with some extra fields for username and password. Submitting it successfully now redirects to the next tab.18:55
povbot/svn/commits: Adjust the tests so they work with it.18:55
faassenokay, I'm going home. :)18:56
faassennot to watch the world cup, however.18:56
faassenignas: thanks for that evolution help..goodl uck with it. :)18:56
faassenignas: sorry cause this, indirectly indirectly.18:56
faassenbye! have a nice weekend.18:57
*** faassen has quit IRC18:57
povbot/svn/commits: * ignas committed revision 6222:19:09
povbot/svn/commits: Fixed 14th and 17th evolution scripts.19:09
*** th1a_ has joined #schooltool19:15
*** th1a_ is now known as th1a|X60s19:16
pcardunealga: what's the difference between schooltool raising a ForbiddenAttribute error, and getting the login screen?  In which cases are you going to get which screen?19:40
*** srichter has joined #schooltool19:55
ignaspcardune: i think you get ForbiddenAttribute when permissions are not set19:57
ignasand a log in screen when you don'[t have19:57
ignassufficient privileges to do something19:57
pcarduneignas: do you have any tips for debugging security?19:58
ignaswhat problem are you having exactly20:01
pcardunewell, I get this log in screen, but i'd like to see which permissions the logged in user has, and which ones they need to access the given page20:01
pcarduneand where they get those permissions from... like which crowd20:02
ignasit's the other way20:02
ignaswhen you declare a view you say permission="schoooltool.view"20:02
ignasor edit20:02
ignasyou can find it in zcml20:02
ignasthen the view tries to acquire the crowd (not crowds) that can do "schooltool.view" on the object20:03
ignasas the object is a view20:03
ignasand views don't have ICrowd adapters for them20:03
ignas__parent__ of the view is taken20:03
ignasand a named adapter of ICrowd is queried20:04
ignasso now we have a crowd of people who can see that view20:04
ignasline 64 of schooltool/securitypolicy/policy.py20:05
ignasand we check whether current principal is in that crowd20:05
ignasas you probably have a particular object in mind20:05
pcardunebut you can have multiple crowds for a given permission on a view, and a principal can be part of multiple crowds20:05
ignasnot multiple crowds20:05
ignasrather one aggregate crowd20:06
ignasyou can add import pdb; pdb.set_trace() in line 62 of thet file20:06
ignasprefferably with an if "" in str()20:06
ignasso it would not stop on every check20:07
ignasor ISomeInterface.providedBy(obj) ...20:07
ignasand inspect the crowd20:07
ignasit will be AggregateCrowd most of the time20:07
ignasto inspect it call:20:07
ignasthat should list the crowds contained in there20:08
ignashope that clears the picture a bit20:09
pcarduneit does a lot.  Thanks20:09
*** jinty has quit IRC20:15
ignaspcardune: found the problem ?20:49
pcarduneyes I did actually20:49
pcarduneit was incorrect permissions on something I didn't realize was being accessed20:50
pcarduneI've just put a bunch of print statements with a catch on security rejections and I can see things very clearly20:50
povbot/svn/commits: * ignas committed revision 6223:20:53
povbot/svn/commits: Deleted some commented out debug code.20:53
*** thisfred has quit IRC21:01
*** jinty has joined #schooltool21:27
*** ignas has quit IRC21:31
*** dwoo has joined #schooltool22:06
*** pcardune_ has joined #schooltool22:08
*** alga has quit IRC22:10
*** pcardune has quit IRC22:23
*** Aiste has quit IRC22:36
*** mgedmin has quit IRC22:38
*** Aiste has joined #schooltool23:08
*** jinty has quit IRC23:21
*** pcardune has joined #schooltool23:31
*** dwoo has quit IRC23:33
*** pcardune_ has quit IRC23:33
*** pcardune has quit IRC23:57

Generated by 2.15.1 by Marius Gedminas - find it at!