@mamasi so this is probably what you want: docs.djangoproject.com/en/1.6/ref/contrib/admin/actions - it doesn't work from a button at the top, but is specifically meant for doing bulk stuff to selected rows in the changelist
otherwise you can add a view specifically in the ModelAdmin subclass and link it in with get_urls
@JonClements I thought so, but I preferred the more interesting interpretation ;-)
They say that some weather is pretty much exclusive to certain parts of the world, on account of joggraphy. Like, 99% of tornados occur in the United States.
So my database-querying app has two functions: "search", which displays the result of the query on the screen, and "download", which puts the results in an XML file that the user can save on their system.
Today I am testing both. The first takes five seconds to execute. The second is taking ten minutes and counting.
The browser having long since returned "connection timed out", but the back end is still churning away.
This isn't even the bug I'm working on. I have to fix this bug just to be able to see the other bug.
Hoo, the "search" option uses shiny_new_search_query, and "download" uses old_crusty_search_query. I could upgrade the latter to use the shiny new version, but I'd have to modify a few hundred lines of fiddly business logic.
I'm willing to do this, but I fear that the customer will then say, "what happened to my good old download results? Change it back"
Man, I wish QA's machines allowed copy-paste. Then, instead of sending me a screenshot of a fifty line SQL query that failed, they could send me the actual text.
@mamasi that looks good. In fact your xlsx_export method would work fine as an admin action as well, if you allowed an optional queryset parameter. So you could check for that and if it exists then use it in place of the queryset in line 46. Then simply register the method as an admin action, and you're laughing
Pfft, someone is not understanding how learning works..
I agree, they can sod off and go study up on things somewhere else. It's a good thing that only people who can understand these things at a high level are able to learn from this question. — Korijn4 mins ago
I know how to put Presentation in presentation mode with notes, but having to switch back to the hangout window, switching screen sharing to the terminal was jarring.
@JonClements Thanks, gone now as I had also flagged it as such.
@Ffisegydd yes... that was my cunning plan... instead of hopping on the HS1 and getting into central London in about 40 minutes... I was going to inflate the hot air balloon and head east until I got there :)
(sorry I'm late - you won't believe the wind conditions!)
@DanielRoseman I was too tired the day I gave my presentation and am not yet in the mood to watch myself back, but yours looked smooth, yes. :-)
@JonClements I think they'll be accessible after the conference is over.
For now it is a for-pay conference, so you'll have to fork out if you want to see it.
@DanielRoseman That's exactly what I did; I opened a separate Spaces desktop, put a hangout window, presentation windows (two presentation and notes) and a terminal there.
@MartijnPieters yes, I don't think there's a better way than that. Originally the moderator, Joe, was going to control the slides, leaving me to just switch between video and terminal, but they couldn't get it working on the night - perhaps they have sorted it by now
it's also a bit surprising that Google don't have a better integration between presentation and hangouts, but never mind
@Ffisegydd Nah, my business is mostly about rapid software prototyping. I've worked a lot of projects with other mechanical and electrical engineers in that line of work. It seemed only sensible to get a 3D printer (we really, really needed it). Working on a project just now, and I realised it would cost less to buy a good 3D printer and do it all myself than pay someone else to 3D print it
@Ffisegydd I do offer up some printing services to the general public, but I can't compete against the regular 3D printers. They print more cheaply and more "accurately", so on paper my printer looks bad
MainPage.aspx is taking a long time to load, let's check the call stack. The call stack is pointing to SomeOtherPage.someButtonClickedHandler. SomeOtherPage has no relation to MainPage, and even if it did, I never clicked a button.
Ok, adding to the todo list: fix the bug that's preventing me from fixing the bug that's preventing me from fixing the bug I'm supposed to be working on.
"You can sod off and go study up on things somewhere else. It's a good thing that only people who can understand these things at a high level are able to learn from this question."
The bounty on this question runs out in < 1 hour. Then they're the 24 hour grace period. Hopefully should get at least 25 rep, possibly 50 (and my first ever bounty :o )
Yeah, I'm not implying malice on your part. I'm implying stupidity on my own part. "Oops, I fat fingered and changed my current working directory to root" kind of thing
The traffic flow of this room is too slow for it to be useful anyway. The people that read the post the first time, will be the exact same people that read it the second time.
("it" being my feelings towards the language, not the language itself. Although the language may indeed be complicated. I have no comment on that matter.)
note: "For starters, rm doesn't accept a regular expression as an argument. Besides the wildcard *, every other character is treated literally." (superuser.com/questions/392872/…)
there's actually another instance of the same thing: subprocess.call() and friends do not convert the elements of their input lists for the commands to strings
Yeah same. For instance I've got a scipy.stats distribution function which has a str() representation of '<scipy.stats._distn_infrastructure.rv_frozen object at 0x00000000079FF898>'. Very unlikely I'd want that in a string :P
I can perhaps see not wanting to join say file handles (the naive user might think it would print their contents or something, but it prints a big pile of repr-looking stuff)
So unless I could guarantee that all objects had a __str__ method that returned something suitable for a possible str.join - and I might want to use that method for something else apart from that...
I wonder if there's any useful way by inspecting str vs repr to know if an object is likely to be wanted as a string or not
like if something has a repr but no str implementation maybe that means it's not great for joining, but I'm not sure this is practical given the code out there today
@JohnZwinck the interpreter wouldn't stand a chance at that, plus it'd be overhead analysis to do so... which, I reckon, would be more time consuming than just explicitly converting everything anyway
but then, people (me!) often write to files which need to be parsed later. in fact half the time that's why I do str.join(), is to write it to a file somewhere
what does anyone think about adding a new method like str.joinstr() or whatever, that does what I want but with a slightly more conspicuous name, and no backcompat issues? Martijn will still hate it I know :)
Man, I've got a really bad track record in the field of "playing god". Why do things always go horribly awry when I toy with forces beyond my comprehension :-(
Man, I went digging through the issue tracker looking for a "str join enchancement request" topic, and when I get back, Martijn already found a rejection from the BDFL.
@Kevin right now I have $120USD in my bank account, i'm living out of a 188sq.ft. office space, haven't had a shower in three days, and in final stages with three well funded start-ups for a CTO position
@JohnZwinck I was holding back mine to see if I could have been wrong and there was a stronger and longer refutation from Guido that would shut out future meandering discussion.
@JohnZwinck The thread dano links to actually is toying with a concat() function similar to print() in that it takes keyword arguments to configure behaviour (taking a sep keyword argument). I can imagine that using explicit string conversion.
still, I don't see why explicit mapping to str is such inelegance.
@obimod Reminds me of a Youtube video @IntrepidBrit posted yesterday, which predicted that every coffee shop in the world will know what your favorite flavor is. "Convenient, right?" it says. "yes, but also creepy", I says.