spiral-project / daybed

Form validation and data storage API
http://daybed.rtfd.org/
BSD 3-Clause "New" or "Revised" License
52 stars 8 forks source link

Automatically redirect to /{api version} if it's missing #250

Closed magopian closed 10 years ago

magopian commented 10 years ago

I got bitten by the documentation saying that I could go to http://localhost:8000/fields, and had a 404.

@Natim told me that instead of fixing the code, I could automatically redirect to use the api version if the path is missing it.

If it's a bad idea, then it's @Natim's fault ;)

(Obviously, if it's a good idea, it's thanks to me, right? ;)

Natim commented 10 years ago

Why did you amend the master commit?

Natim commented 10 years ago

I think the documentation is another question, but at least this will be useful even if we want to fix the documentation later.

Natim commented 10 years ago

I have no specific comments to add to this PR, it looks good to me.

leplatrem commented 10 years ago

Yes thanks ! Welcome onboard @magopian !

More generally I'm suprised that pyramid doesn't provide url rewrite (see hard coded urls in the code: https://github.com/spiral-project/daybed/blob/master/daybed/views/models.py#L115-L116)

magopian commented 10 years ago

aouch, indeed :/ and thanks ;)