IRC log of #schooltool for Sunday, 2006-02-26

*** ignas has joined #schooltool00:10
*** Aiste_ is now known as Aiste00:44
*** didymo has quit IRC01:10
*** ignas has quit IRC02:33
*** wrobel has quit IRC04:53
*** wrobel has joined #schooltool04:54
*** Aiste has quit IRC08:16
*** th1a has joined #schooltool08:28
*** th1a has quit IRC10:31
*** Aiste has joined #schooltool11:58
*** ignas has joined #schooltool14:58
*** ignas has quit IRC14:58
*** jinty has joined #schooltool15:15
*** ignas has joined #schooltool15:16
*** ignas has quit IRC15:19
*** jelkner has joined #schooltool15:33
jelknersrichter: good morning stephan15:34
*** ignas has joined #schooltool15:37
*** ignas has quit IRC15:37
*** ignas has joined #schooltool15:55
*** ignas has quit IRC15:56
tiredbonesjelkner, how was pycon?15:59
jelknertiredbones: i'm still here16:06
jelknerbut friday and saturday were great16:06
jelknerjim fulton's "state of zope" talk was very helpful16:07
jelkneri'm going to miss the morning sessions today to attend class16:08
tiredbonesjelkner, I'm glade you are enjoying yourself.16:08
tiredbonesjelkner, I'm glade you are enjoying yourself.16:08
tiredbonesjelkner, Speaking of class, what time does it start/16:08
jelknerin 2 hours16:09
jelknerless 9 minutes ;-)16:09
tiredbonesjelkner, what part of jim's speach did you like/16:09
jelknertiredbones: it was most interesting to get a sense of jim's thoughts on zope3 and zope2, and what they are, who they are for, and where they are going16:11
jelkneri never really understood the extent to which in moving to support Python programers (zope2 was never really aimed at Python programmers), zope3 has largely abandoned zope's original audience16:13
*** ignas has joined #schooltool16:13
jelknerjim called zope2 the "ruby on rails of it's time"16:13
jelknerit was aimed at user's, content managers, and through the web developers16:14
jelknerzope3 has an entirely different audience in mind16:14
jelknerso there are real questions as to which way forward is best.16:14
jelknershould zope2 and zope3 eventually merge?16:15
tiredbonesjelkner, what audience do you think zope 3 is intended for?16:15
jelknerzope3 was designed by and written for programmers16:16
tiredbonesjelkner, but zope 2 was designed by and written for programmers. So it seems same goal to me.16:17
tiredbonesjelkner, it will be interesting to read his speach.16:18
jelknernot according to jim16:19
jelknerand many python programmers complained about how difficult it was to use zope2 the way they wanted16:19
jelknerthat was the motivation for zope3 in the first place16:20
tiredbonesjelkner, nothing change there, the learning curve is still sharp.16:20
jelknerthat's true, but once you rap your head around (or so i've been told, since i don't know from person experience ;-), zope3 is much friendlier to programmers16:23
tiredbonesjelkner, I'm counting on it!16:23
jelknerlet's see how this class runs16:23
jelknerok, i need to do a bit of studying before class, i'll be back in an hour...16:24
srichterjelkner: good morning16:40
*** ignas has quit IRC16:47
*** ignas has joined #schooltool16:51
jelknersrichter: pycon has been good (like always) again this year16:53
jelknerjim thanked you several times for the work you have been doing with zope316:53
jelkneri was hoping you would be here16:54
*** flint has joined #schooltool17:30
flinthey jeff17:31
*** pcardune has joined #schooltool17:34
tiredbonespcardune, can I ask you a question on IContainer and IContained?17:35
pcardunetiredbones: yep17:36
flinthey paul.  got an account on maddog.17:36
tiredbonespcardune, IContainer is used to specify that we want to store an object, does IContained used to conter what object can be stored?17:37
pcarduneIContained defines what kind of container an object can be stored in17:38
pcarduneIt will become clearer in our implementation17:38
tiredbonespcardune, that's what I thought.17:39
tiredbonespcardune, If that is so, then why define what object can be contain with IContainer?17:40
tiredbonespcardune, It seems they both do the same thing.17:40
tiredbonespcardune, Only in s different way.17:41
pcardunebecause there are some cases when you want to put an object into a container that doesn't have any constraints on what it contains (like a Folder container)17:42
pcarduneYou can't change the constraints on the Folder container (adding your object to the list of objects it can contain) so instead you have to define the constraint with IContained17:43
pcarduneit's true that for this example it doesn't seem entirely necessary, but it is just the standard pattern used in Zope17:43
pcarduneflint: did you get my email(s)17:44
tiredbonespcardune, So if we define an IContainer and we then want to add an object that we did not make an ICOntainer for we would use IContained?17:44
flintpcardune, paul, they were very helpful.  Did you get mine from last night?17:44
pcarduneflint: yes, did you get my response to the ones from last night?17:45
flintpcardune, the discussion I had with Jeff this morning lead to an account on maddog.  I will check this morning.  BTW it is 08:00 in the AM where you are!17:45
flintpcardune, whatever you are getting for this it is not worth gettting up THAT early! :^)17:46
pcardunetiredbones: no, rather if used an IContainer that we didn't make, (one that where we cant change the code), then we would make an IContained for the objects we want to put in that container (assuming there are no constraints on the IContainer that we are using)17:46
* tiredbones thinks about that!17:47
pcarduneflint: I like having to get up early, because when the class is over, I'm still up earlier than I normally would be, which means I have a longer day and more time to do stuff.17:47
jelknerpcardune: where are you?17:48
jelkneri just tried to call, but i got an answering machine17:48
pcardunejelkner: I'm in another room17:49
*** Yuy has joined #schooltool17:49
pcardunejelkner: with more light, and more space to work17:49
jelknergood morning, linda!17:49
tiredbonespcardune, those constraints would be define by ItemTypePrecondition17:49
Yuyclass won't start for 10 minutes17:49
flintYuy, good morning linda.17:49
Yuyhello, teacher17:50
pcardunehi linda17:50
tiredbonespcardune, I thought I get my question out of the way so that I would bother the class.17:50
pcardunetiredbones: the ItemTypePrecondition is for the Container, not the object being contained17:51
flintpcardune, I will try the final path suggestion you have.  Elkner I am not pathing correctly on maddog, and the final test from the lesson is not working " ~/zope3/bin/test -vpu --dir timeclock17:52
flint" is bombing out on maddog.  The python is working ok.17:52
flintjelkner, paul has suggested a fix.  I am trying this fix.17:53
tiredbonespcardune, ok I see that now. thanks17:53
flintpcardune, your final fix fixed all.  Things are working.  Lets move forward.  Thanks for your help one and all!17:58
pcarduneflint: great17:59
flintpcardune, regarding your indecent proclivity of rising early, I feel that quests for moral perfection are best left to the young :^)17:59
flintbe right back after i get more coffee.18:00
pcarduneOk, is everyone that needs to be here, here?18:00
jelknerif not, they are late18:00
jelknerlet's go! ;-)18:00
pcarduneok, so last week we wrote our first failing test, along with figuring out how to run tests.18:01
pcardunethis week , we are going to make that test pass, and write more tests18:01
*** wdickers has joined #schooltool18:01
pcarduneand write the implementation of our IPerson and IPersonContainer interfaces18:01
pcarduneso, my first suggestion is to rerun the failing test from last week to make sure you still remember how all that stuff works18:02
pcardunegoodmorning wdickers18:02
pcardunepay attention to the error message, and think of how this might be remedied (it is just regular python, and no zope to make this test pass)18:03
pcarduneonce you have made the test pass, come back and say so, or if you dont get it, I will explain it if necessary in a minute18:04
jelkner  Ran 1 tests with 0 failures and 0 errors in 0.031 seconds.18:05
pcarduneok jelkner, why don't you tell us what you did to make that test pass18:06
jelknerwell, the test wanted to import a Person class from a person module18:06
jelknerso i created a file named (the person module)18:07
jelknerand in that put:18:07
jelknerclass Person:18:07
jelkner    pass18:07
jelknerthat's it18:07
jelkneri don't know about docstrings or such18:07
pcarduneok, good18:07
pcardune(that's right)18:07
flintjelkner, I also touched a file called person, and the test failed.  how did you know what to put in the file?18:08
jelknerit says "from person import Person"18:08
jelknerin python capital letters are used for class names18:09
flintok what about "pass"?18:09
flintbtw it works here as well.18:09
jelkneri'm not sure pass was the right thing to do, but the class had to have a body18:09
pcarduneflint: the class doesn't need to do anything other than exist, so we just write pass to say "move along... there is nothing to see here"18:10
jelknerpass is just a place holder when you don't know waht to put18:10
pcarduneso, the next step is to write the next test18:10
flintpcardune, is "pass" bette syntax than say "move along... there is nothing to see here" or maybe banana?18:10
pcarduneflint: pass is python18:10
pcarduneit is a python keyword18:10
jelkneryuy, wdickers, did it work for you?18:10
Yuywe're creating a file now?18:11
wdickersYes, it worked18:11
pcarduneyes, please follow the solution that jelkner posted for making the test pass18:11
flintpcardune, i have checked pass is not optional.  The module fails without it.18:12
pcarduneflint: right, like jelkner said, every class needs a body... if you don't want the body to do anything, you write "pass"18:12
flintpcardune, that I did not know thanks.18:13
pcardunethere always has to be something after a ':' in python, so you can also see pass statements after, loops, conditionals, function definitions, etc.18:13
pcarduneso moving on18:13
pcardunethe next thing we want to do in our README.txt file (please open that up), is to create an instance of this Person object we made18:13
flintpcardune, a comment will not work.  it must be a keyword other than a comment eh18:13
pcarduneflint: yes18:14
pcardunejust like regular python, you might want to write  ">>> worker = Person()"18:14
pcarduneHere I have just come up with an arbitrary variable "worker" that relates slightly to the context of timeclock (since we are dealing with workers) but otherwise it is totally arbitrary18:15
jelknerwe could use a docstring instead of pass, yes?18:15
jelknerwhich is the zope way of doing things?18:15
flintwhere do we put this?  The beginning seems like a bad place, the end seems not right.  What about before the "cool" line?18:16
* tiredbones used ">>>Consultant = Person()"18:17
pcarduneflint: yes, before the cool line, in fact, you can even delete the cool line because we wont need that18:17
pcardunetiredbones: use all lowercase for the variable... ">>> consultant = Person()" would be the standard way18:17
flinttiredbones, as a consultant I would challange the verasity of this statement.  consultants are not people, ever eaten with one?:^)18:17
pcardunejelkner: we can't use a docstring on a class because python doesn't like that, we can do it on class methods though18:18
wdickerswhat "cool" line is this? I don't see one in README18:18
pcardunewdickers: it was on the README from the wiki18:18
jelknernor i18:18
pcarduneor in the README that I sent out to everyone18:19
flintpcardune, it was README.txt in the tarball.18:19
pcardunedon't worry about, it was superfluous18:19
pcarduneafter creating our object, we want to make sure it implements the IPerson interface18:19
flintpcardune, yet it hurts nothing to leave it there?18:19
pcarduneflint: nope, that test will always pass18:20
flintpcardune, gotcha18:20
jelknershould look like this now18:20
pcarduneto do this, in README.txt add the line ">>> from timeclock import interfaces" either just below, or after importing Person18:21
pcardunethis gives us access to all the stuff we defined in interfaces.py18:21
flintpcardune, and it still passes the test process.18:23
pcarduneflint: as it should, we already made the file18:23
pcardunenow, the way you check to see if an object implements a certain interface, you use the providedBy method18:23
pcarduneso add this line to the bottom of the test18:24
pcardune>>> interfaces.IPerson.providedBy(worker)18:24
pcarduneand then a "True" right after that18:25
pcarduneit should look like:18:25
pcardune  >>> interfaces.IPerson.providedBy(worker)18:25
pcardune  True18:25
pcarduneas it would look in a python interpreter18:25
wdickerswait, when you say 'test'', do you mean or README.txt?18:25
flintpcardune, what would happen if you said "true" (note case)18:26
pcardunei mean README.txt18:26
pcarduneflint: True is another python keyword18:26
pcarduneand case matters18:26
pcarduneso true would not work18:26
pcarduneif you run the test, it should fail18:27
flintpcardune, it does indeed.18:27
pcarduneso, this brings us to the concept of "providing"18:27
pcarduneimplementations implement an interface18:28
pcarduneand objects provide an interface18:28
pcarduneso an instance of our implementation should provide the interface we want our implementation to implement18:29
jelknersay that 3 times quickly! ;-)18:29
pcarduneyeah, you can use that line to impress people who don't know about the component architecture or zope, like all your non-techie friends (it works every time)18:30
pcardunethere is also another method you can use to test the Person class, and not just an instance of it18:30
flintpcardune, implementation implements an interface18:31
pcarduneflint: correct18:31
pcarduneto test the class itself you would write18:31
pcardune  >>> interfaces.IPerson.implementedBy(Person)18:31
pcardune  True18:31
flintpcardune, you gott watch you 's with this crowd... :^)18:31
pcarduneflint: ?18:31
wdickerswhy do we use Person instead of Worker?18:32
tiredbonesflint, implementation implements what and interface provides18:32
pcardunewdickers: implementedBy is for class definitions, interfaces are implemented by a class, so we test the class18:32
pcarduneinstances of a class *provide* the interfaces of the class, so we use providedBy18:33
wdickerswell wouldn't worker be the same class as Person? Or is worker merely an instance?18:33
pcarduneworker is merely an instance18:33
wdickersah, okay18:33
tiredbonespcardune, Can you also have interface in modules?18:33
pcarduneso if you wanted to, you could put the implementedBy part before we have defined worker and the test should still pass18:34
pcardunetiredbones: I'm not sure I understand your question18:34
pcarduneso, if everyone has a failing test, lets go make it pass18:34
pcardunego back to person.py18:35
tiredbonespcardune, Can't interface be provided by a module?18:35
flintpcardune, what you said was "implementations implement an interface". What you meant was "implementation implements an interface" the "s" was in the wrong place.18:35
tiredbonespcardune, Can't interface be provided by a module instead of a class18:35
pcardunemake sure you add a docstring to the Person class (something simple like """An implementation of IPerson.""")18:35
pcardunetiredbones: no, interfaces are only provided by classes18:35
pcarduneflint: thank you... that was subtle18:36
pcardunenow, we are going to want to make a few imports18:36
flintpcardune, your welcome, this stuff is subtle.18:36
pcarduneimport the following modules: zope.interface,, interfaces18:37
pcarduneit is also a convention to separate imports by the modules you are importing them from... so all zope imports go in one place, and all imports from timeclock related stuff goes below that with a line in between18:38
pcarduneimport zope.interface18:38
pcarduneimport interfaces18:38
pcardunewoops... it didn't like my empty line in before "import interfaces"... pretend it is there18:38
Yuyand to clarify, this is all in the README.txt fil18:39
pcardunesorry, i didn't mention that we were switching again to the file18:39
jelkneryuy: we are working on now,18:39
pcarduneso the last things i said about imports are in person.py18:40
wdickersoh, whoops xD18:40
*** alga has joined #SchoolTool18:41
flintpcardune, no, you said it "go back to"  about 10 lines back.18:41
pcarduneI am just going to give you the Person class as it should look to pass the test18:41
pcarduneflint: wow, in that case, even I missed what I had just said18:41
pcarduneyour file should look like
flintpcardune, this is what happens when a young man such as yourself gets up too early in the morning :^)18:42
pcardunejust copy the Person class that is there18:42
pcarduneflint: small price to pay18:42
pcardunelet me first call your attention to the "zope.interface.implements(...." line18:43
tiredbonesNow days anything below 50yrs is young.18:43
pcardunethis tells zope what this class is supposed to implement18:44
pcardunedoes everyone understand this line?18:44
pcardunewe just give it a list of interfaces18:44
Yuyyes, and it coincides with the 'from timeclock ...' line in the README file18:45
wdickersso it implements those classes?18:46
pcarduneright, so next look out how Person now inherits from
pcardunewdickers: it implements those *interfaces*, but yes you have the right idea18:46
pcarduneremember that IPersonContained inherited from
pcardunefortunately, there is already an implementation of this interface... we just reuse it by having our Person class inherit from that18:47
pcarduneso, now our Person class is also a class18:48
pcardunewhich will satisfy the "contract" with IPersonContained18:48
pcardunedoes that make sense to everyone?18:48
flintpcardune, No. did it make sense to you?18:49
pcarduneflint: surprisingly, yes18:49
flintpcardune, ok move on.18:49
jelknerflint: thanks! ;-)18:49
pcardunewell, if everyone else is also guessing, then I should stop and make this clearer18:49
pcardunejelkner: do you get this?18:50
flintpcardune, make elkner write it down.18:50
pcarduneok, flint, just read carefully18:50
wdickerswait, in the Interfaces from ypal, IPersonContained inherits from Container18:50
pcardunereally? that must be a type18:51
pcardunes/type/typo (the irony)18:51
pcarduneok, it is fixed... thanks wdickers for seeing that18:52
pcardunenext to satisfy the contract with IPerson, we need to define two attributes to the class18:52
pcardunetitle, and username, as you see done there18:52
pcarduneplease note that they are unicode strings18:53
wdickersWhy do we use single quotes instead of double like in Interfaces?18:53
wdickers**interfaces (stupid caps)18:53
pcardunewdickers: its arbitrary, you could use either18:54
pcarduneso, the attributes are initially just empty, but they are of a type that conforms to how they were defined in the IPerson interface18:54
pcardunethat is, they are strings (zope.schema.TextLine deals with strings)18:55
flintwdickers, so the typo was in
pcardunethey also have to be unicode18:55
wdickersflint: yes18:55
pcarduneflint: yes, but i think the typo was just on the wiki18:55
wdickerswell I kinda copied from the Wiki so....18:55
pcardunethe unicode is necessary because when we are creating the a Person object through a web interface, we want the user to be able to enter in any kind of characters, be they letters with accent marks, or chinese characters, or arabic, etc.  regular ascii wont do this, we need unicode strings18:56
pcarduneso, now try running the test, and it should pass18:56
jelknerit does18:57
flintthat is what the "u" is all about?18:57
pcardunego back to README.txt18:57
flintjelkner, thank you Jeff Typo, er... Elkner. :^)18:58
pcardunewe forgot to test that Person implements IPersonContained18:58
flintpcardune, the test passed.18:58
pcardunewhich is fine, sometimes we write tests after we write the code that makes them pass18:59
pcarduneyou should all know how to add this test by now18:59
pcarduneyour README.txt should look like
pcarduneok, now lets implement PersonContainer19:01
pcarduneso, back in README.txt19:02
pcarduneadd a few blank lines, and we will begin writing the PersonContainer tests19:02
pcardunestart by importing a class called PersonContainer from timeclock.person19:03
pcarduneand run the test19:03
pcardunethen write code to make the test pass, then run the test again and make sure it passes19:03
wdickerssorry to interrupt, but when does this class end again? o.o;;19:05
jelkner1 pm19:05
jelkner50 minutes from now19:05
pcarduneso, is everyone done with that?19:06
pcardunenow add tests to make sure that PersonContainer implements IPersonContainer19:07
jelkneryuy: linda, how are you doing?19:07
Yuyjelkner: as done as I'll ever be19:07
pcardunerun the test again (it should fail)19:07
wdickersshouldn't it be "IPersonContainer"?19:08
wdickersWait, nvm19:08
pcarduneonce you have done that, check out the solution at
pcardunenotice that we are using a zope class called BTreeContainer19:09
pcarduneas you can guess, BTree stands for Binary Tree, and you should all know what those are (really cool data structurs with really fast searching)19:10
*** jinty has quit IRC19:11
pcardunejust as before, inheriting from the Contained class (a preexisting implementation of IContained), the PersonContainer class inherits from BTreeContainer (a preexisting implementation of IContainer)19:11
pcardunethere are other implementation of IContainer that we could have user, like a Folder class, but we're not going to because Folders have extra things that we dont need19:12
pcardunewhen copying this, dont forget the line "import" up at the top19:13
wdickersSorry everyone, but I'm afraid I must leave now. I have a bowling tournament to get to19:14
Yuywdickers: good luck19:14
flintpcardune, oddly enough, this tested without the "import" statement19:14
jelknerwdickers: knock those pins down!19:14
wdickersxD Thanks19:15
*** wdickers has quit IRC19:15
jelknermy test must be wrong19:15
jelkneri have:19:15
pcarduneflint: that is odd19:15
jelkner  >>> from timeclock.person import PersonContainer19:15
jelkner  >>> interfaces.IPersonContainer.implementedBy(PersonContainer)19:15
jelkner  True19:15
jelknerand when i run the tests i get:19:15
jelkner    NameError: name 'PersonContainer' is not defined19:16
pcardunejelkner: you must have a typo somewhere... because that should work19:16
flintjelkner, it should be 'Person' not 'PersonContainer' eh?19:17
pcarduneand flint: dont forget to write a test that you can actually create a PersonContainer instance19:17
pcarduneno, jelkner has it right it seems19:17
pcardunelet me put up my README.txt file19:17
pcardunecheck out
pcarduneflint: if you had included people = PersonContainer() then it would have failed without the btree import19:18
* tiredbones is sick, I'll look at the logs later. Thanks for letting me ask question.19:19
pcardunetiredbones: i hope you feel better, and feel free to email me any questions about the log19:19
pcarduneso, is everyone on the same page now?19:20
YuyI hope so19:20
tiredbonesjelkner, do you have my email address?19:20
jelknertiredbones: no19:20
jelknerall tests pass now19:21
flintpcardune, If i am getting 20% of this, if i take this course five times all will be well.19:21
jelknerwhat's next?19:21
pcarduneok, we are done writing our implementation19:22
pcardunewe could write a few more tests to show how the PersonContainer actually contains Person objects...19:22
pcardunebut that isn't really necessary19:22
tiredbonesjelkner, do you have it now? I sent it to you privately19:22
jelknertiredbones: sent it where?19:23
pcardunenext, we are going to make the configur.zcml file19:23
pcarduneeveryone knows what I'm talking about from the reading right?19:24
flintpcardune, this is the thing that actually puts stuff on zope eh?19:24
pcarduneflint: so to speak19:24
tiredbonesjelkner, thru XChat. On a separate channel.19:24
jelknerit didn't show up19:25
jelknerjust send me an email at: jeff@elkner.net19:25
tiredbonesjelkner, ok19:25
*** rjelliso has joined #schooltool19:25
jelknerso, configure.zcml19:26
*** rjelliso has joined #schooltool19:26
*** rjelliso has joined #schooltool19:26
pcardunelook at
rjellisoFinally here (Again).19:27
jelknerhi robbie19:27
pcardunehi rjelliso19:27
Yuywe do the config file straight on the vi editor?19:27
pcarduneYuy: yep19:27
jelkneri have a question about this file:19:28
jelknerwhy the dot in front of:   <content class=".person.Person">?19:28
jelkneri mean why the leading . ?19:29
jelknerin front of person19:29
pcardunethe leading . just says, (the current directory)19:29
pcarduneperson.Person would turn into /person/Person, and .person.Person would turn into ./person/Person (just like unix)19:29
pcarduneyou could be explicit and say timeclock.person.Person if you wanted to19:30
pcardunebut most configure files don't look like that19:30
flintpcardune, in the first line you have to register this namespace?  what if you are on a private network?19:30
pcarduneflint: it doesn't actually do anything through the web19:31
pcarduneI'm not sure exactly how/why it works that way19:31
pcardunebut that is the way you have to do it19:31
flintpcardune, that's good, it looks like it does something :^)19:31
jelknerok, now what?19:31
jelknerwe are almost out of time19:32
flintpcardune, i am ok with the JCL of it all, it is the idea of doing what google maps did in javascript that worries me.19:32
pcardunethe explanation on pg 103 of stephan's book isn't much better than mine19:32
flintwe have 30 minutes jeff.19:32
jelknerwith this zcml file, can we see our new Person objects in a running zope?19:32
pcardunethis is the next step19:32
pcardunewe might not complete this, this lesson, but lets see how far we can get with your new knowledge of how things work19:33
pcarduneunfortunately, there isn't really a simple way of testing configure files19:33
pcarduneand they are kind of boring, so i wont go into a detailed explanataion of how configure.zcml works19:33
pcarduneit should be simple to understand after reading that chapter19:33
pcarduneso, next create a folder in timeclock called browser19:34
flintpcardune, chapter 13.19:34
pcarduneit is standard to put all display related things in a browser module19:34
pcarduneflint: yes19:34
pcardunedon't forget to touch to make it a python package19:35
pcardunenext go to the configure.zcml file we were just working with19:35
pcarduneand add at the bottom (but before the </configure>, the line:19:36
pcardune<include package=".browser" />19:36
pcarduneand then create a new file with the path (timeclock/browser/configure.zcml)19:36
jelknerinside content tags, or outside19:36
pcardunejelkner: outside19:37
pcardunejust before </configure>19:37
pcarduneit should look like
pcarduneso, you should now have two configure.zcml files, one in timeclock, and one in timeclock/browser19:38
jelknerhow are they different?19:39
jelkneror are they?19:39
pcardunethe one in browser will configure all the things related to what you see through a web browser19:39
pcardunethe one in timeclock configures internal zope machinery not related to what you see19:40
jelknerbut right now, our two files are the same, yes?19:40
pcarduneno, the one in browser should be empty19:40
flintpcardune, you are kidding right?19:40
pcarduneflint: no, i'm not19:40
rjellisoOh, I thought the difference was the line at the bottom. (*oops*)19:40
pcardunethere is sort of a hierarchie of configure.zcml files19:41
pcardunethe zope instance has one, which includes ones for all relevant packages, which have other includes19:41
pcarduneits just like importing in python19:41
pcarduneor like includes in c++19:42
rjellisoah, I think I get it then.19:42
pcarduneso to start off make some configure tags19:42
jelknerso we are going to add content now to our configure.zcml in the browser folder?19:42
flintpcardune, would a comment at the head of each of these cascading configure.zcml files be helpful19:42
flintpcardune, the header commend would identify each files home.19:43
pcarduneflint: if you need it, you can put it in, but normally there aren't any comments like that19:43
*** jinty has joined #schooltool19:43
flintpcardune, job security for zope3 programmers, I am writing that book :^)19:43
pcardunethis time the configure tags should use the namespace
pcarduneso, it should look like <configure xmlns="">19:44
pcarduneso, now switch to python developer mode into website developer mode19:46
pcardunewe now have the ability to create PersonContainers and Person objects with python19:46
pcardunenow we want to do that through the web19:46
pcarduneso we need some kind of add form19:47
flintpcardune, i am on maddog and will likely collide with lisa... I did not change ports where do I do this?19:47
pcardunethat is, some web page which lets us click "add Person Container" and input a name for the container and let us create it19:47
pcarduneflint: ~/zope3/etc/zope.conf19:48
pcarduneyou should see19:48
flintpcardune, yea the "address" line19:48
pcardune  type HTTP19:48
pcardune  address 808019:48
pcarduneok, good19:48
pcarduneso, rather than having to write up html for our addform... we can auto generate one!19:49
pcardune(you may remember talking about this 2 weeks ago19:49
pcarduneso, we define an add form like so:19:49
pcardune  <addform19:50
pcardune      label="Add Person Container"19:50
pcardune      name="AddPersonContainer.html"19:50
pcardune      schema="timeclock.interfaces.IPersonContainer"19:50
pcardune      content_factory="timeclock.person.PersonContainer"19:50
pcardune      permission="zope.ManageContent"19:50
pcardune      />19:50
pcarduneunder the <configure ...> tag19:50
pcardunebut before the </configure> line19:50
pcarduneif you all did the reading, this should make sense19:50
pcardunebut if you want, i will explain it19:50
pcardunemake sense to everyone?19:52
jelknerpcardune: we are almost out of time19:53
pcardunewe are almost done19:53
jelknerlet's go then19:53
pcardunenow add another we want to have a link to this addform page...19:53
pcardune  <addMenuItem19:53
pcardune      class="timeclock.person.PersonContainer"19:54
pcardune      title="TimeClock Person Container"19:54
pcardune      description="A TimeClock Person Container"19:54
pcardune      permission="zope.ManageContent"19:54
pcardune      view="AddPersonContainer.html"19:54
pcardune      />19:54
pcardunethis should also make sense after doing the reading19:54
pcarduneonce you have that19:54
pcardunecreate the file timeclock/timeclock-configure.zcml19:55
pcardunenote that this is not in the browser directory19:55
pcarduneadd one line to it:19:55
flintthis is in the /browser/ configure.zcml19:55
pcarduneno, this is a new file19:55
pcardunein timeclock folder19:55
jelknerdon't we need to close the configure tag?19:55
pcardunejelkner: yes, you do19:56
jelkneryou didn't tell us to do that19:56
pcardunewell, i figure you all know how xml works19:56
pcarduneit is implied :)19:56
jelkneryou are figuring too much! ;-)19:56
flintpcardune, got my vote paul!!! :^)19:56
pcardunewell, i was just making sure you were on your feet19:56
pcarduneso, the timeclock-configure.zcml file should have one line in it:19:57
pcardune<include package="timeclock" />19:57
pcardunenow, i want you to copy this file we just created to ~/zope3/etc/package-includes/19:57
pcardunethis registers our timeclock application with zope19:58
pcarduneso when we start the zope server everything will run19:58
flintpcardune, that is neat.19:58
pcardune(of the timeclock stuff that is)19:58
flintpcardune, I already started the zope server to test it.19:58
jelknerwow, so let's pause and evaluate19:58
jelknerwe just finished "hello world!"19:58
pcardunewe have a copy in the timeclock folder so that when we right an install script/makefile, it will copy that file automatically19:58
jelknerit only took us 6 hours19:58
rjellisocopy the file? Or move it? (Or does it matter?)19:59
jelknerzope3 is *easy* ! ;-)19:59
pcardunecopy it19:59
pcardunewell, now test what you ahve19:59
flinti am in zopectl and restarted my zope...19:59
pcardunestart the zope server19:59
pcarduneor you can use zopectl if you know how19:59
pcarduneopen a web browser19:59
pcardunelog in to your zope instance19:59
pcardunego to the manage screen20:00
flintPaul, I did not need to log on at port 8020 of maddog.20:00
pcarduneit has a url like http://localhost:8080/manage (depending on your port)20:00
flintnever mind I logged on.20:00
pcarduneon the left hand side you should see a list of things you can "Add"20:00
pcarduneflint: that might end up in your browser, i am currently at http://localhost:8080/@@contents.html20:01
flintI can add a site manager folder...20:01
flintnice got it.20:01
pcardunedoes everyone see the list of stuff to add?20:01
jelkneri don't see Person20:01
pcardunein that list should be "TimeClock Person Container"20:02
pcardunejelkner: we didn't do that part yet20:02
pcarduneclick on it20:02
pcardunenow you see our auto generated form20:02
pcardunetype in an object name with no spaces20:02
pcarduneand click add20:02
pcardunewe have now created our first object through the web20:03
rjellisoFinally, results! : >20:03
Yuy(my parents are calling me to get off) I can take what I need from the log tomorrow, right?20:03
pcardunewe are done20:03
pcarduneyou are free to go20:03
jelknerwe need homework20:03
pcarduneI will email it20:03
YuyI can stay to hear that20:03
jelknerbye linda20:03
flintwhere is this object...  bye linda20:03
Yuybye everyone20:04
*** Yuy has left #schooltool20:04
flintpcardune, the one we created...20:04
pcardunethis object is in the root folder of your zope instace20:04
flintna i mean on the web interface side.20:04
flintonce it is created it should be somewhere eh?20:04
*** ignas has quit IRC20:05
pcarduneyeah, in the root folder of zope20:05
pcardunethe web side20:05
flintpcardune, I am being a little picky, and I am gratified we got this far...20:05
flintgotcha there it is.20:05
pcardunethat is where it is20:05
pcarduneyou will only see the introspector because we haven't made any other pretty views for it20:06
pcardunehold on, i will be right back20:06
pcardunei have to switch rooms and log off for a minute20:06
flintjelkner, = "The page that you are trying to access is not available"20:07
flintjelkner, i called the object paul.20:08
flintgot a clue?20:08
pcarduneflint: you must have forgotten to click "add" or something20:08
flintpcardune, na the silly thing is there, check for yourself.  there is a folder object called "paul"20:09
flintadmin for this instance is flint password is yellow you-know-what.20:09
flintpcardune, paul, note that I am good to get this far this week.20:10
pcardunei'm looking at it20:11
flintjelkner, what are you up to?20:11
*** ignas has joined #schooltool20:11
flintignas, greetings are you one of the POV?20:11
*** ignas has quit IRC20:11
jelknersee you all next week!20:12
pcarduneflint: i can't seem to log in to your instance20:12
*** jelkner has quit IRC20:13
pcarduneoh wait... nvm20:13
pcardunei got in20:13
flintpcardune, hang on... it is flint and banana20:13
pcarduneok, instead of putting in that url20:13
pcardunego back to that @@contents.html page20:13
rjellisoI've got to dash as well  : <   There's anything revolutionary coming up or will checking the logs/email later be ok?20:13
pcarduneor click on [top]20:13
pcardunerjelliso: we are done20:14
pcarduneeveryone is free to go20:14
pcarduneclass dismissed20:14
rjellisoalright, thanks, talk to you next week then.20:14
*** rjelliso has quit IRC20:14
flinti am at top.  if you gotta stop paul we can.20:14
pcarduneflint: after you click on top, now click on paul20:14
flintgoes into an inspector is that correct?20:15
pcarduneflint: its 10am... there is nothing for me to do this early in the morning except homework... and this sounds a lot more appealing than that20:15
pcarduneflint: yeah20:15
pcardunethat's all there is to see at this point20:15
flintok then it works, I though that was a dreaded zope error page.  this is good.20:15
pcarduneyou homework is going to be to add more browser views20:15
flintno, you should make us stick needles in our necks, less painful.  What chapter?20:16
pcardunesame chapter20:16
pcardune13 is a pretty big/important chapter20:17
pcarduneand a prime number!20:17
pcarduneyou gotta love it20:17
flintgreat, i am going to chop off an earlobe so I can find the next less painful thing.  :^)20:17
flintpcardune, you are doing fine.  it helps that things are working.  I am gonna transfer what happened on maddog and get it working on docbox.20:18
flintdocbox is a strange beast but is in a production mode.20:18
flintthis went well.  I am gonna go get coffee.  thanks.20:18
pcarduneyour welcome20:19
*** flint has quit IRC20:19
*** pcardune has quit IRC20:21
*** ignas has joined #schooltool20:29
*** ignas has quit IRC22:25

Generated by 2.15.1 by Marius Gedminas - find it at!