[00:37] woot, crossed 200 users that completed the sign in process in bookie [01:37] rick_h_: Congratulations! [11:32] New keyboard should show up on Friday. [11:55] snap-l: yay [14:12] How's the morning so far? [14:13] busy [16:05] This tablet is such a sexy beast [16:20] brousch: Rule 34 [16:20] heh [16:20] Transformer Infinity [16:21] 1920x1080 on a 10" screen is nice [16:25] Oh, that's purdy [16:27] And detachable keyboard with like 8 more hours of battery [17:53] this is a mighty fine sight http://www.flickr.com/photos/7508761@N03/8485522775/in/photostream :D [17:55] and afternoon, been afk all morning heh [18:13] nice butt [18:15] baby got back! [18:16] Did you purchase that machine? [18:16] yes, took it home with me [18:17] nice [18:17] yea, going to take it down to ATL in a couple weeks and will make for a nice ride /me hopes [19:02] brousch: thinking of you https://github.com/jensens/pyramid-gae-tutorial [19:03] heh [19:03] I don't have anything on GAE any more, and Linus leaving makes me more nervous about using it [19:03] I mean Guido [19:05] yea [19:06] I've been using Heroku and Linode [20:35] heroku gets $$$ quick [20:36] Not on the free tier! [20:36] yep, but you can tinker with things usually pretty cheap [20:36] right. [20:36] and... [20:36] its a trap. [20:36] well, but I do like they get you diong pretty good practices ootb to deploy there [20:37] makes it easy to deploy to your own host/etc since you've already done some work there [20:37] less of a trap than it seems imo [20:37] Less of a trap than GAE [21:01] Love it when I break code that I thought I fixed. [21:30] snap-l: just means you missed a test :) [21:31] Um, sure. Tests. [21:34] Problem is it's crapping out when I'm doing a sqlalchemy query. [21:34] TypeError: "'NoneType' object is not iterable" [21:35] Which is the null-pointer-exception of Python [21:45] I am about 4 seconds from snapping this keyboard in half. [21:53] vid or it didn't happen [21:55] Heh [21:55] Well, apparently there's a little catch-22 here [21:55] Can't order on a field that returns nothing [21:56] hm, this could prove interesting [22:00] OK, here's a conundrum: [22:00] I'm looking for a record, ordered by a contact date [22:00] if the record isn't there, sqlalchemy bombs because it can't order on a field that isn't there [22:01] but if it's there, I want it to pick only the earliest record. [22:02] Wondering if I should just do the query, then sort the results afterward. [22:02] but I feel sqlalchemy should just return None, not an error [22:03] hmmm. [22:06] snap-l: is sqlalchemy secreltly ordering on the data after its returned?? [22:07] seems like it should be adding it to the SQL query [22:07] I don't think it's adding it to the query [22:08] I'm dumb: haven't been looking at log files. [22:08] yea as long as you order by before you call all() it should be fine [22:08] I'm calling first() [22:08] because I only one the first result [22:09] Should I use all() instead, and then just pop the first result? [22:09] https://github.com/mitechie/Bookie/blob/develop/bookie/models/__init__.py#L159 [22:10] oh well s/all/first [22:10] but don't use one() since that expects a record and tosses an exc if not found [22:11] http://paste.mitechie.com/show/bFnz2azlSC4I9yYcz7bd/ [22:11] yea need to catch res and check for none [22:12] Then I lose the ordering [22:12] can't just unpack when you can get a none response [22:12] so I'll have to sort on the last contact date outside of the query. [22:12] no, sec moving to computer so I can reply better [22:13] kk [22:13] Oh, is the problem the tuple? [22:13] ? CustomerContact.last_contact_date. CustomerContact.contact_embargo_days [22:13] why is there a . in there? [22:14] This is in the model. [22:14] It's a manager [22:15] I think I know what the problem is. I think the tuple unpacking is what's screwing me up [22:15] going to use a list instead [22:15] and see if that makes it happy. [22:15] http://paste.mitechie.com/show/889/ seems to make more sense to me [22:15] right, you need to check if the query returned None (no results found) first [22:15] then unpack [22:16] Yeah, that's where I ran into problems [22:17] party [22:18] LIke I said, SQLAlchemy needs a "you're being stupid" exception [22:18] lol [22:19] I need a magical thwacking [22:22] snap-l: can you do something like SELECT MIN(contact_date), contact_embargo_days FROM blarg WHERE email = email GROUP BY contract_embargo_days? [22:22] instead or ordering, then taking the first one [22:23] maybe sqlalchemy does this... [22:23] widox: Possibly, but I think I have it sorted. [22:24] lesson for the day: Python really doesn't like unpacking None. ;)