/srv/irclogs.ubuntu.com/2013/02/18/#ubuntu-us-mi.txt

rick_h_woot, crossed 200 users that completed the sign in process in bookie00:37
snap-lrick_h_: Congratulations!01:37
snap-lNew keyboard should show up on Friday.11:32
rick_h_snap-l: yay11:55
snap-lHow's the morning so far?14:12
brouschbusy14:13
brouschThis tablet is such a sexy beast16:05
snap-lbrousch: Rule 3416:20
brouschheh16:20
brouschTransformer Infinity16:20
brousch1920x1080 on a 10" screen is nice16:21
snap-lOh, that's purdy16:25
brouschAnd detachable keyboard with like 8 more hours of battery16:27
rick_h_this is a mighty fine sight http://www.flickr.com/photos/7508761@N03/8485522775/in/photostream :D17:53
rick_h_and afternoon, been afk all morning heh17:55
brouschnice butt18:13
rick_h_baby got back!18:15
brouschDid you purchase that machine?18:16
rick_h_yes, took it home with me18:16
brouschnice18:17
rick_h_yea, going to take it down to ATL in a couple weeks and will make for a nice ride /me hopes18:17
rick_h_brousch: thinking of you https://github.com/jensens/pyramid-gae-tutorial19:02
brouschheh19:03
brouschI don't have anything on GAE any more, and Linus leaving makes me more nervous about using it19:03
brouschI mean Guido19:03
rick_h_yea19:05
brouschI've been using Heroku and Linode19:06
jrwrenheroku gets $$$ quick20:35
brouschNot on the free tier!20:36
rick_h_yep, but you can tinker with things usually pretty cheap20:36
jrwrenright.20:36
jrwrenand...20:36
jrwrenits a trap.20:36
rick_h_well, but I do like they get you diong pretty good practices ootb to deploy there20:36
rick_h_makes it easy to deploy to your own host/etc since you've already done some work there20:37
rick_h_less of a trap than it seems imo20:37
brouschLess of a trap than GAE20:37
snap-lLove it when I break code that I thought I fixed.21:01
rick_h_snap-l: just means you missed a test :)21:30
snap-lUm, sure. Tests.21:31
snap-lProblem is it's crapping out when I'm doing a sqlalchemy query.21:34
snap-lTypeError: "'NoneType' object is not iterable"21:34
snap-lWhich is the null-pointer-exception of Python21:35
snap-lI am about 4 seconds from snapping this keyboard in half.21:45
brouschvid or it didn't happen21:53
snap-lHeh21:55
snap-lWell, apparently there's a little catch-22 here21:55
snap-lCan't order on a field that returns nothing21:55
snap-lhm, this could prove interesting21:56
snap-lOK, here's a conundrum:22:00
snap-lI'm looking for a record, ordered by a contact date22:00
snap-lif the record isn't there, sqlalchemy bombs because it can't order on a field that isn't there22:00
snap-lbut if it's there, I want it to pick only the earliest record.22:01
snap-lWondering if I should just do the query, then sort the results afterward.22:02
snap-lbut I feel sqlalchemy should just return None, not an error22:02
snap-lhmmm.22:03
widoxsnap-l: is sqlalchemy secreltly ordering on the data after its returned??22:06
widoxseems like it should be adding it to the SQL query22:07
snap-lI don't think it's adding it to the query22:07
snap-lI'm dumb: haven't been looking at log files.22:08
rick_h_droidyea as long as you order by before you call all() it should be fine22:08
snap-lI'm calling first()22:08
snap-lbecause I only one the first result22:08
snap-lShould I use all() instead, and then just pop the first result?22:09
rick_h_droidhttps://github.com/mitechie/Bookie/blob/develop/bookie/models/__init__.py#L15922:09
rick_h_droidoh well s/all/first22:10
rick_h_droidbut don't use one() since that expects a record and tosses an exc if not found22:10
snap-lhttp://paste.mitechie.com/show/bFnz2azlSC4I9yYcz7bd/22:11
rick_h_droidyea need to catch res and check for none22:11
snap-lThen I lose the ordering22:12
rick_h_droidcan't just unpack when you can get a none response22:12
snap-lso I'll have to sort on the last contact date outside of the query.22:12
rick_h_no, sec moving to computer so I can reply better22:12
snap-lkk22:13
snap-lOh, is the problem the tuple?22:13
rick_h_? CustomerContact.last_contact_date. CustomerContact.contact_embargo_days22:13
rick_h_why is there a . in there?22:13
snap-lThis is in the model.22:14
snap-lIt's a manager22:14
snap-lI think I know what the problem is. I think the tuple unpacking is what's screwing me up22:15
snap-lgoing to use a list instead22:15
snap-land see if that makes it happy.22:15
rick_h_http://paste.mitechie.com/show/889/ seems to make more sense to me22:15
rick_h_right, you need to check if the query returned None (no results found) first22:15
rick_h_then unpack22:15
snap-lYeah, that's where I ran into problems22:16
rick_h_droidparty22:17
snap-lLIke I said, SQLAlchemy needs a "you're being stupid" exception22:18
rick_h_droidlol22:18
snap-lI need a magical thwacking22:19
widoxsnap-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
widoxinstead or ordering, then taking the first one22:22
widoxmaybe sqlalchemy does this...22:23
snap-lwidox: Possibly, but I think I have it sorted.22:23
snap-llesson for the day: Python really doesn't like unpacking None. ;)22:24

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