HNHacker News
TopNewBestAskShowJobs

tomchristie

2,252 karma · joined January 31, 2011

submissionscomments
tomchristie··on Django REST framework 2.3 released: ViewSets and Routers
Note sure. I seem to be able to replicate that if the browser window is exactly 727 pixels wide, but otherwise everything displays just fine for me on Chrome 26.0.1410.65. Will look into it later.

Edit: Are you seeing this for all browser widths, or just specific ranges?

tomchristie··on Chrome World Wide Maze
> It's been done already

This is kinda different in that the mobile device doesn't need a custom app on it to act as the controller (as in your Brass Monkey example), but can act as the controller directly within the browser. No extra installations, just hit up the website and go.

tomchristie··on Django Suit: modern theme for Django admin
What's the problem? Don't like it, don't buy it. If it gives a more professional finish to the sites you build for your clients, and you think it's worth the (pretty low) price tag, then pay up.

Personally, I'd love to see more of a marketplace for OSS projects. Open, collaborative projects that still make enough money to fund continued developement seems like a pretty good thing all round to me.

tomchristie··on Django REST framework 2.2 released
> It seems that it's currently using a "shared secret" approach instead of supporting signed-requests, thus limiting its use to HTTPS only.

Yeah, I believe oauth1 support would address that, and is planned. :)

tomchristie··on Django REST framework 2.2 released
@almost is right - there's nothing that strictly ties you in to Django's ORM.

A few thoughts:

* You'll need to use the Serializer class rather than the automatic ModelSerializer.

* You'll need to do a bit of tweaking if you want to use the Generic class based views (since they default to using the standard Django querysets), but if you're just writing the views yourself there's nothing tying you to the ORM.

* You'll need to deal with the transaction management, probably by using middleware something like this: http://stackoverflow.com/questions/6606725/best-way-to-integ...

If it is something you pursue it'd be tremendously helpful if you could post to the list on how you get on.

tomchristie··on Django REST framework 2.2 released
It supports various types of authentication, including Django's standard session-based auth (which is useful if you're building AJAX clients to your Web API)
tomchristie··on Introducing Contributions
No not really, I wanted to say something about the attitude.

I didn't think the points merited response, because it's self-evident that the blanket statement of 'the data is useless' simply isn't the case.

Anyway, let me be specific:

1. I can see why folks might want to be able to turn it on or off, but introducing visual inconsistency between different user profiles would feel pretty wonky to me.

2. Keeps the information dense. I don't need to know exactly what was committed in order for the information to be broadly useful.

3. Incorrect.

4. Recent = relevant.

That's not to say that I think it's perfect - for example, the 'current streak' will tend to 0 days for most users as noted by other comments, but overall I think it hangs together pretty well.

tomchristie··on Introducing Contributions
> Github appeals to the self-improvement, tomato-timer, fitbit crowd here.

What a bunch of bullshit. It's a tool. Thousands upon thousands of people use it daily because it helps them get stuff done.

If you don't happen to like the way it's presented, fine, but that's a personal preference, not a lifestyle choice.

tomchristie··on Introducing Contributions
I think it works really nicely. I wouldn't necessarily treat it as a measure of productivity, but it does help give an indication of consistency and trend.

I also like the idea of annotating it (perhaps that'll come as a feature sometime) It'd be nice to be able to mark on coding sprints & events.

tomchristie··on Uses for cURL
I'm sure there must be other sites documenting this too, but that's a very well written and prioritized bit of documentation - nicely done.

Your echo service is pretty nifty too.

tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
If using the generic CBVs you can override .get_queryset() to implement filtering just as you would with regular Django CBVs.

There's also an outstanding pull req to build in support for django-filter and other filtering backends which now just needs some docs, and which I plan to have merged in within the next few days or so. https://github.com/tomchristie/django-rest-framework/pull/29... That'll make it easier to do more complex filtering stuff. (And eventually have the filters be presented in the Browsable API)

tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
There's so much work has gone into REST framework 2 that it's hard to present a single definitive migration guide. Best way to get an idea of migration plan would be to work your way through the tutorial first to get an idea of how everything fits together. You will need to put a little bit of work in, but it'll be time very well spent. Any questions at all just head over to https://groups.google.com/forum/?fromgroups#!forum/django-re... or try #restframework on freenode IRC.
tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
It uses the client's 'Accept:' header which specifies which media types it prefers for the response (eg. 'text/html', 'application/json')

Browsers will indicate that they prefer HTML, so that's what REST framework serves them.

tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
Note that there's a live version of the tutorial project available for testing here: http://restframework.herokuapp.com/
tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
Pretty trivial. I'm planning on having integration with django-oauth2-provider added any day now.

Here's the outstanding ticket for OAuth: https://github.com/tomchristie/django-rest-framework/issues/... There's a link to a gist on there which implements that for REST framework 0.4, which just needs a little updating, testing, and documentation.

tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
Seriously, take a look a 2.0 - it's a huge, huge step up from the previous version, practically every aspect has been reworked and redesigned.

The initial version made some design compromises in order to support the Browseable API, and didn't take full advantage of Django's generic CBV's. (Since it was released when Django was still at 1.2) REST framework 2 fixes all that and much, much more.

I'd throughly recommend spending a while walking through the tutorial and taking a browse around the docs - I think you'll be pleasantly surprised.

tomchristie··on REST framework 2 released: Simple, beautiful, browsable Web APIs for Django
REST framework's serialization isn't tied to the ORM, so it should play perfectly well with mongodb.
tomchristie··on If Hemingway wrote JavaScript
> They don't compromise on a single letter

+1. I think that's why the Hemingway snippet works so perfectly. The tone both perfectly captures Hemingway's voice, and the design qualities of beautifully engineered code.

> I believe that learning to write better will make you a much better coder and communicator.

And again, yes.

tomchristie··on If Hemingway wrote JavaScript
The Hemingway snippet is genius. Spot on.
tomchristie··on How RESTful is Your API?
Overloading the request method using URL paramaters, as the author mentions is a bad idea. What is accepted behavior, is overloading the request method using hidden form data in a POST request.

The later is what Rails actually does - http://guides.rubyonrails.org/form_helpers.html section 2.4

"There are two noncontroversial uses for overloaded POST. The first is to simulate HTTP's uniform interface for clients like web browsers that don't support PUT or DELETE" - RESTful Web Services, Leonard Richardson & Sam Ruby.

tomchristie··on Just say No to brainteaser questions at interviews
> "how many golf balls can you get in a double decker bus"... > 1) i don't have enough information and 2) its not relevant to this position.

Whilst I agree somewhat with the sentiment, I don't think that's at all an unreasonable question.

1. You do very clearly have enough information to make a decent informed guess. 2. It is a relevant question.

It's relevant because it assesses your general sense of numeracy. Whilst that won't show how quickly you'd be able to deal with a database issue, it does give an indication of how you might go about making broad judgement calls in the absence of any hard-and-fast numbers. For example: Is it worth looking into this database issue, or is it likely to be insignificant compared to the network overhead?

tomchristie··on Django REST framework with admin-style browseable self-documenting API
Not sure that's quite true really.

(I think tastypie is really good tho, btw)

tomchristie··on Django REST framework with admin-style browseable self-documenting API
we're working on it hard. :) sprints at djangocon this thurs+fri, so hopefully will pick up some more contributors and really get things rolling...
tomchristie··on Django REST framework with admin-style browseable self-documenting API
> Roll your own (surprisingly common since it's not too hard)

Easy to roll your own. Deceptively hard to do it really simply and really well.

Hence the proliferation of frameworks.

I like a comment by Fielding here: "most people just make the mistake that it should be simple to design simple things. In reality, the effort required to design something is inversely proportional to the simplicity of the result."

← PreviousPage 5 of 5