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