IRC log of #schooltool for Saturday, 2007-03-03

*** Ninno has quit IRC00:56
*** Fujitsu has quit IRC01:19
*** Fujitsu has joined #schooltool01:31
*** didymo has quit IRC03:43
*** wjohnsto has quit IRC03:43
*** Lumiere has quit IRC03:43
*** wjohnsto has joined #schooltool03:44
*** didymo has joined #schooltool03:44
*** Lumiere has joined #schooltool03:44
*** pcardune has joined #schooltool04:00
*** liuwei has joined #schooltool04:45
*** liuwei has left #schooltool04:50
*** smalekgh has joined #schooltool07:00
*** smalekgh has left #schooltool07:05
*** didymo has quit IRC08:04
*** pcardune has quit IRC09:04
*** pcardune has joined #schooltool09:05
*** pcardune has quit IRC09:36
*** mgedmin has joined #schooltool10:29
*** lisppaste5 has quit IRC10:50
*** lisppaste5 has joined #schooltool10:57
*** pcardune has joined #schooltool11:10
*** pcardune has quit IRC11:26
*** jfroche__ has joined #schooltool12:10
*** mgedmin has quit IRC16:56
*** smalekgh has joined #schooltool17:55
*** smalekgh has quit IRC17:59
*** CPCarey11 has joined #schooltool18:04
*** bnguyen has joined #schooltool18:06
*** jelkner has joined #schooltool18:29
jelknerwjohnsto: william, you're early18:29
bnguyenjelkner: william isn't here right now18:34
wjohnstojelkner: I am here, had to take a shower18:35
wjohnstocan't be smelly for class18:35
jelknerwjohnsto: did you get my email about the change in the first sprint?18:36
wjohnstoyes I did18:37
jelknergreat18:37
*** smalekgh has joined #schooltool18:38
*** Makorihi has joined #schooltool18:45
jelknerbnguyen and wjohnsto: do you know if linda fixed your bug in lesson 5?18:46
bnguyenyes she did18:47
jelknerexcellent!18:47
*** mlinnell has joined #schooltool18:47
wjohnstoI'm going to setup the TS server if anyone has it and wants to use it18:47
*** pcardune has joined #schooltool18:48
jelknerpcardune: morning, teach!18:50
*** kjcole has joined #schooltool18:50
pcardunejelkner: you really love calling me "teach"18:50
jelknerremember, i want abt 10 minutes at the beginning of class for house keeping18:51
pcardunedon't worry... I remember18:51
smalekghhouse keeping == ???18:51
jelknersmalekgh: sharing information and such18:51
smalekghooooh... information... *stares in wonder* >_<18:52
jelknersmalekgh: patience... it will all be clear soon ;-)18:53
* smalekgh continues to stare in wonder18:53
wjohnstoI have a teamspeak server if you know what it is and want to use it18:54
jelknerwjohnsto: better to work that out the week ahead of time18:55
jelknerlet's shoot for next class18:55
wjohnstosounds good18:55
*** Mounika has joined #schooltool18:56
wjohnstoI was just saying for anyone who might already have it, it's easy to setup18:56
jelkneryou should also prepare folks using the mailing list ahead of time18:56
*** tehminkeh has joined #schooltool18:56
jelknerso they can have software installed before class starts18:56
wjohnstoI'll write up a tutorial or something like that on Monday then18:56
jelknergreat18:57
*** AVN` has joined #schooltool18:58
*** Preetam has joined #schooltool18:59
* wjohnsto is William Johnston, "Hello!"18:59
* AVN` is Chris B19:00
* jelkner is Jeff Elkner, "Good morning!"19:00
* Preetam is Preetam19:00
* mlinnell is Mary L19:00
* tehminkeh is Stephen Drodge19:00
* smalekgh is Masood M, and wonders why attendance is being taken BEFORE class <_<19:00
* pcardune is the "teach"19:00
* bnguyen is Brittney N19:00
* Mounika is Mounika G19:00
* tehminkeh thinks the last one might've been a bit obvious19:01
* CPCarey11 is Chris C19:01
* Makorihi is Jama Mohamed19:01
jelknerOK, good morning all!19:01
pcardunetake it away jelkner...19:01
* kjcole is Kevin Cole (with bad network connectivity)19:01
jelknerI asked paul for a few minutes to update you all on the internship process19:02
* smalekgh is Masood M, and wonders why attendance is being taken BEFORE class <_<19:02
smalekghack, sorry19:02
smalekghhit the enter key by accident19:02
jelknerit is now time to start getting internship agreements handed out, signed, and returned19:02
jelknerhere is how i would like the process to work:19:03
jelkner1. we match two of you who would like to work together with a project19:03
jelkner2. we get you both the internship agreements and discuss sprint participation and scheduling19:03
jelkner3. you show the agreement to your parents, you and they sign-in, dave welsh and i sign it, and we are off19:04
tehminkehdoes everyone basically automatically get accepted?19:04
tehminkehor do some of us "get cut"19:04
Makorihii think he said something about 'half way'19:05
*** nitromaster has joined #schooltool19:05
jelkneri haven't seen anyone yet whose performance would warrent "cutting"19:05
jelkneryou are doing a great job!19:05
nitromastersorry im late, im Andrew Rodriguez19:06
jelkneranyone who will be home tomorrow between 4 and 7 pm, please email me at: jeff@elkner.net19:06
smalekghwhat shall the e-mail contain?19:06
jelknersend me your phone number and i will begin making calls to talk with you19:06
jelkneranother thing is that we are not having an Atlanta sprint19:07
jelknerwe are moving it to ACC so that more of you can participate19:08
jelknerpaul will be coming here19:08
jelkneri'm almost out of time, so two more quick things:19:08
jelkner1. please sign up for the March 17 sprint if you can make it19:08
jelknerhttp://wiki.python.org/moin/ArlingtonSprint19:08
jelkner2. please send me the email if you will be home tomorrow between 4 and 7 with your phone number19:09
jelknerthat's all i have19:09
smalekghuh, if it isn't tomorrow, then when?19:09
jelknerpcardune: teach, thanks for the time!19:09
jelknerthe 17th would be the next time19:09
jelkneri'll keep setting up times until i've talked with everyone19:10
pcarduneok, i guess it is my turn to speak now19:10
pcarduneLast class was two weeks ago, so I hope none of you have forgotten all the zope3 you learned19:11
pcardunedoes anyone remember what we did last week?19:11
tehminkehnothing19:11
Makorihiwe made containers19:11
Preetamoh yea19:11
smalekghthe thingers that held thingers (and only one kind of thinger)19:11
pcarduneok, good... just checking that people are awake19:11
pcardunetwo weeks ago we didn't finish the containers and they still don't do a whole lot19:12
tehminkehi still maintain that we didnt do anything last week19:12
pcardunethe idea of making your own containers is so that they can really work for you19:12
pcardunetehminkeh: ... *you* didn't do anything last week... I know *I* did something19:12
pcardunewe want containers to help us manage contacts in some way19:13
tehminkehpcardune: i was kidding, because we didnt have class last week19:13
pcardunetehminkeh: i know... I *still* did something lat week though....19:13
wjohnstolet's start class!19:14
pcarduneso what do we want a container to do?19:14
pcardunepart of that question is, what does a container do already?19:14
Makorihito contain things19:14
wjohnstohold contacts and contact information19:14
AVN`it can add stuff19:14
smalekghit holds stuff19:14
pcarduneright now we get a list of the objects it contains... but it that list really helpful to us?19:14
pcardunewhat gets displayed?19:14
pcardunethe object names (not any other information)19:14
pcarduneand the object names can be pretty ugly19:15
pcardunethey are just what get used in the url19:15
pcarduneSo it might be nicer if our container displayed first and last name19:15
pcarduneor maybe last and first name19:15
pcarduneso we wouldn't have to remember what we named the contact object19:15
pcarduneso let's say we want the container to display all the contacts, but with "LastName, FirstName" isntead of the object name19:16
pcardunewhat is the first thing we are going to do for this new functionality?19:16
nitromastera view19:17
pcardunebefore that...19:17
CPCarey11__repr__()19:17
pcardunethis is almost a trick question19:17
wjohnstocan't we do it in the ZMI19:17
pcarduneno... we can't do it in the ZMI, i'm not sure what you are thinking of there19:18
pcardunebut I'm thinking about writing functional tests19:18
pcarduneso open up your functional tests and add some tests for this functionality19:18
pcardunenotice I will be helping you less now with some of the tasks we have already covered (like functional tests)19:19
pcardunebut if you have questions, do ask19:19
pcarduneI also recommend creating a additional contacts in the functional tests so that you have something to play with19:19
pcarduneI'll post what I have too19:21
lisppaste5pcardune pasted "browser.txt" at http://paste.lisp.org/display/3766419:22
pcarduneafter writing your test, you should run them just to make sure they are actually failing (remember we right failing tests, then write code to make them pass)19:22
pcardunelet me know when you have something written19:24
pcarduneok, well i'm going to keep going, and if you get behind you can copy what I've pasted19:30
pcarduneSince we specified the contactcontainer.pt file as the template for this page, we have to create that page template.19:30
pcarduneI like to to create page templates by first copying an existing one and then editing it. This way I don't have to remember all the names of the macros I am looking for.19:31
pcarduneSo I would copy viewcontact.pt to contactcontainer.pt and then rewrite what's inside the body19:32
pcardunewe want a tal:repeat to repeat over the contents of the container19:32
pcarduneand remember that since this view is registered for the container... the context variable will be the container19:32
pcardunewe can grab the contents of the container using the "values" method19:33
pcarduneit has the same API of a python dictionary19:33
pcardunewhen repeating, we want to create links that point to the actual contact object19:34
pcarduneoh, you know what, i accidentally skipped something19:34
lisppaste5pcardune pasted "configure.zcml" at http://paste.lisp.org/display/3766519:34
pcardunethat is how I have registered a new page in configure.zcml19:34
CPCarey11I have a question about our functional tests19:35
pcardunego ahead19:35
CPCarey11when we display the contents of our container..19:35
CPCarey11how do we determine in which order the names will be displayed?19:36
pcardunethat is a good question19:36
pcarduneone way to determine the order is to wait and find out (that's what I did)19:36
AVN`wait what are we doing to contactcontainer.pt?19:36
CPCarey11oh ok19:36
pcarduneso now I can tell you that the order is alphabetical by the name of the contact object19:36
pcarduneAVN`: we are about to create contactcontainer.pt19:37
CPCarey11oh thank you19:37
AVN`whats tal:repeat ?19:37
pcarduneremember the tal:content attribute?19:37
pcardunethe tal:repeat attribute is another tal attribute that does cool stuff19:37
pcarduneit is just a loop19:37
AVN`how do we use it?19:37
pcarduneso when we write: <div tal:repeat="contact context/values">19:38
pcardunein python that would look like: for contact in context.values()19:38
pcardunethen the div will be created multiple times, once for each contact19:38
pcarduneand any tales inside the repeat has access to the "contact" variable19:38
pcardunejust like in python for loops19:39
AVN`oh, I see19:39
pcardunehere is my contactcontainer.pt file19:39
lisppaste5pcardune pasted "contactcontainer.pt" at http://paste.lisp.org/display/3766719:39
pcarduneinside that div we have a link19:40
pcarduneand the link has dynamically generated href attributes and a dynamically generated content19:40
pcardunewhen we write tal:attributes="href contact/@@absolute_url" it sets the href attribute to the url of the contact object19:41
pcardunethe @@ part says that this is a view lookup19:41
pcardunewe will talk about those more later19:41
pcarduneor actually, now is a good time to talk about them19:42
pcarduneremember that pages are views19:42
pcardunewe can actually access all of our pages with the @@ in front of the name of the page19:42
pcardune(like @@index.html)19:42
wjohnstoI think I've witnessed that19:42
pcardune@@absolute_url is a special view that zope has which returns just a plain string with the url of the object19:43
pcardunein fact, you can go to any object in your ZMI and just add @@absolute_url to the end of the url and see what you get19:43
wjohnstoyou get what the URL is19:44
pcarduneI don't know if I have assigned this before, but there is going to be homework for next week19:44
pcardunethe homework will be to read over the zope page template reference19:44
pcardunewhich can be found here: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx19:44
smalekghthis is going to be the absolute first time when I save homework to the bookmarks folder in firefox...19:45
pcarduneso hopefully everyone understands the rest of the contactcontainer.pt file19:45
pcarduneso start up your zope servers and try it out19:46
AVN`darn, error19:48
pcarduneso what's next?19:48
*** Aiste has joined #schooltool19:49
pcardunewell, the user stories on the wiki ask for the contacts to be ordered by last name19:49
pcarduneRight now they are ordered based on the Object Name we specified when adding the objects (i.e. paulcarduner and jeffelkner).19:49
pcarduneSo change your functional tests so that the contacts are in fact ordered by last name19:51
pcarduneand rerun the tests to make sure they fail19:51
pcarduneAlphabetical ordering constitutes a bit more logic than we can handle in a page template so we will have to create a view class for the container. Remember the view class we had for editing a contact?19:52
AVN`please slow down a bit19:53
wjohnstothe Contact Class?19:53
pcarduneyes19:53
wjohnstoclass Contact(persistent.Persistent)19:54
pcardunewjohnsto: no, actually it was the ContactView class in browser.py19:54
pcardunewell we are going to create a new view class in browser.py called ContactContainerView19:55
pcardunebut first you should register this class for the page by adding a class attribute to the page declaration pointing to zcontact.browser.ContactContainerView19:55
pcarduneNow we need to create the ContactContainerView class in a file called browser.py. So as we create this class, let's think about what a browser view does again.19:59
*** Mattva01 has joined #schooltool19:59
pcarduneRemember that a browser view takes an object (the context of the page we are displaying) and a request (the HTTP request from the users web browser) and does stuff with them.19:59
AVN`how do we add the class atribute to the page decleration?20:00
pcardunejust put in: class="zcontact.browser.ContactContainerView"20:01
pcardunein the browser:page tag that is registered for the IContactContainer interface20:01
AVN`ok20:02
pcardunecontinuing on: Also, the browser view class can be accessed from the page template through the view variable.20:03
pcarduneA lot of the time, our view class only has to have a few methods that help the template do extra hard python processing.20:03
pcarduneIn this case, we should only have one method in our class, called getSortedContacts.20:03
lisppaste5pcardune pasted "browser.py" at http://paste.lisp.org/display/3766820:04
pcardunethis example has some slightly more advanced python20:04
smalekghooh, it almost looks like a ternary operator declared as a function... uh... inline... uh, yeah...20:05
pcarduneThe sorted function is a standard python function that takes a list of items and returns another list with those items sorted.20:05
*** jelkner has quit IRC20:05
wjohnstojelkner is skipping class20:05
pcarduneSo if there were a list of numbers it would sort them from smallest to largest, and if there were a list of strings, it would sort them alphabetically.20:05
pcarduneBut we have neither of these. Rather, we have a list of objects.20:06
*** jelkner has joined #schooltool20:06
smalekghjelkner is not skipping class >_<20:06
pcardune\Python doesn't know how to sort objects so we have to specify some function for comparing the objects - for telling python which object is greater that the other.20:06
smalekghso it's passing an object encompassing a function?20:07
AVN`like Comparable in java20:07
pcarduneSince we are ordering the contacts based on last name, it makes perfect sense to compare the objects by actually comparing their lastName attributes.20:07
*** jelkner has quit IRC20:07
smalekgheverything is like a comparable, because the have the __cmp__ method20:07
smalekghI think20:07
pcarduneRather than right a whole separate method just for comparing the objects, we will write a lambda function.20:07
wjohnstowait20:07
wjohnstothere is no sort?20:07
wjohnstoin the os?20:07
pcardunewjohnsto: what do you mean in the os?20:07
smalekghyou mean the standard api?20:08
wjohnstoimport os20:08
smalekghor not >_< *is shutting up*20:08
wjohnstoat some point this year20:08
wjohnstoI think I opened up a list of objects20:08
pcarduneos is an api for doing stuff with the operating system... sort doesn't have anything to do with the operating system20:08
wjohnstoand sorted them20:09
pcardunethere is a sort method, all lists have the sort method20:09
*** jfroche__ has quit IRC20:09
pcardunebut we have to customize our sort method20:09
pcardunedoing [3,42,4,5].sort() does a sort in place (it doesn't return a new list)20:10
pcardunebut doing sorted([3,42,4,5]) does return a new list20:10
pcarduneso back to the lambda function20:10
wjohnstook20:10
pcarduneRather than right a whole separate method just for comparing the objects, we will write a lambda function.20:10
pcarduneLambdas are a great way to write one line functions. Expanded, the lambda we have here would look like:20:10
pcardunedef someFunc(a, b):20:10
pcardune    return cmp(a.lastName, b.lastName)20:10
pcarduneThe syntax for lambda functions is simply lambda then the parameters the function takes, and after the colon is what the function returns. So this just returns a comparison of the lastName attribute as we desired.20:12
pcardunehopefully everyone understands how lambda functions work now20:13
Preetamthey are pretty neat20:13
smalekghexcept you can't name them, can you?20:13
smalekgh(it would make some functions really uber short)20:13
pcarduneright, you can't name them20:14
pcarduneWith the browser view class written, we need to make our page template utilize the view class. Instead of repeating over context/values, we will repeat over view/getSortedContacts.20:14
pcarduneso i just changed one line in the page template:  <div tal:repeat="contact view/getSortedContacts">20:15
pcardunenow your tests should pass20:15
pcardunealso be sure to check it out in a web browser20:15
pcardunenext up is adding functionality for deleting contacts20:17
pcarduneBut first, let's write functional tests for this functionality.20:20
pcarduneI think a good way to add delete functionality to our user interface is using checkboxes - the way zope does it already in the default container view.20:20
pcarduneThere should be one checkbox for each contact, and a delete button at the bottom that will delete all the checked contacts.20:20
smalekghI got to go, have to eat lunch, I'll read the logs... Cya!20:21
*** smalekgh has left #schooltool20:21
lisppaste5pcardune annotated #37668 with "browser.txt (delete functionality)" at http://paste.lisp.org/display/37668#120:21
pcarduneThis time we will explicitly tell the browser which checkbox to check by specifying the name of the checkbox input element.20:22
pcarduneTo solve this problem we have to think about it a bit more carefully. Specifically, how are we going to pass on which contact we want to delete to the browser view class.20:23
AVN`my functional tests are failing already, I think the ...something... thing is not working20:23
pcarduneAVN`: that seems to happen a lot, but they actually do work, look further down in the diff for the real problem20:23
*** jinty has joined #schooltool20:24
pcardunethere is an art to reading functional test failures and you can only learn it with experience20:24
pcarduneRemembering what the browser view class takes as parameters, it's clear that the request object is a good place to store this information.20:24
pcarduneand we  can store things in the request using forms in html20:24
pcarduneso let's edit the contactcontainer.pt file and encapsulate the repeat in a form element20:25
pcardunefor the action of the form we want to use a tal:attribute20:26
pcarduneit would look like this: tal:attributes="action request/URL"20:26
pcardunethe request object has a variable, URL which is just the URL for the page you are looking at20:27
pcardune(kind of like @@absolute_url except that it will give you the page too, as in @@index.html)20:27
pcardunethen you should add a check box before the link inside the repeat:20:27
pcardune<input type="checkbox" tal:attributes="name string:${contact/__name__}.delete" />20:28
pcarduneagain, the name attribute for the checkbox is going to be based on the name of the contact object20:28
pcardunewe know that these names will be unique because all objects in a container have unique names20:28
pcarduneand we access the name of an object through the __name__ attribute20:28
pcarduneThen we can append ".delete" to that name so we know the checkbox is for deleting and now something else20:29
pcardunefinally we should put the delete button at the bottom of the form: <input type="submit" value="Delete" name="DELETE_SUBMIT"/>20:30
AVN` is that in the tal repeat?20:31
pcarduneno20:31
pcardunethat should be outside the tal repeat because we only want one delete button for all the contacts20:31
pcarduneso with that we should get a nice looking form20:33
pcarduneyou should check it out in a web browser20:33
AVN`is this bad?  UserWarning: You did not specify an i18n translation domain for the 'title' field in /home/cbeacham/lib/python/zcontact/configure.zcml20:35
pcarduneAVN`: no, we will fix that when we get to internationalization20:35
pcarduneNow upon clicking the Delete button, our browser view should be sent the selected checkboxes through the request object.20:37
pcardunewe need to do something with these checkboxes though20:37
pcardunewe need to implement deletion of the objects in the browser view.20:37
pcarduneSince we want this to happen right when the page is loaded, we will put the functionality in the __init__ method.20:37
pcarduneso create an __init__ method in the ContactContainerView class20:38
lisppaste5wjohnsto pasted "Error" at http://paste.lisp.org/display/3767320:38
pcarduneand make sure that it takes context and request as parameters20:38
lisppaste5pcardune annotated #37668 with "browser.py" at http://paste.lisp.org/display/37668#220:42
lisppaste5wjohnsto annotated #37673 with "browser.txt" at http://paste.lisp.org/display/37673#120:43
pcarduneso rerun the tests and they should pass20:46
AVN`darn20:48
pcardunewith that finished we are done with the user stories we have20:51
pcardunebut there will be more user stories next week20:51
pcarduneI would also like to introduce you to bzr20:51
pcarduneKevin Cole made a good bzr tutorial here http://dc.ubuntu-us.org/resources/tutorials/bzr-intro.php20:52
pcarduneyou should read over it20:52
pcardunebzr is a revision control system that allows you to manage changes in a project20:53
pcarduneWe will be using it extensively over the summer20:53
pcarduneI want you to make your zcontact application into a bzr repository20:53
pcardunealso try adding some little bit of cool functionality to the existing application20:55
pcardunenext week we will have a small show and tell of what people did20:55
pcardunesince i've given you some homework for the next week, we can end class 4 minutes early20:56
Preetamlol20:56
pcardunedo give you 4 extra minutes to work on your homework :)20:56
pcardunes/do/to20:56
pcarduneclass dismissed20:57
Preetamalright, thanks!20:57
*** Preetam has quit IRC20:58
*** AVN` has quit IRC20:58
CPCarey11I have a piano festival next saturday20:58
CPCarey11I can't make it to class20:58
pcarduneok20:58
*** bnguyen has left #schooltool20:58
*** Mounika has quit IRC21:01
*** pcardune has quit IRC21:01
*** mlinnell has quit IRC21:01
*** Makorihi has quit IRC21:02
*** kjcole has left #schooltool21:04
*** CPCarey11 has quit IRC21:07
*** tehminkeh has left #schooltool21:08
*** nitromaster has left #schooltool21:08
*** jinty has quit IRC22:49
*** ignas has joined #schooltool23:04
*** ignas has quit IRC23:09
*** ignas has joined #schooltool23:21
*** ignas has quit IRC23:28

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!