Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20416 closed New feature (wontfix)

Model Scaffold should generate REST API

Reported by: juzerali Owned by: nobody
Component: Utilities Version: dev
Severity: Normal Keywords: scaffolding, automation
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Does it makes sense to automatically generate a REST API for a model if the switch is provided in scaffolding command?

For example, creating a model named User from scaffold with --REST switch could auto generate following REST APIs

GET /user/1 --> Send user with id 1 as JSON
POST /user/ --> Create a user and return the user id
PUT /user/1 --> Update the user with id 1
DELETE /user/1 --> Delete the user with id 1
PATCH /user/1 --> make partial update to user with id 1.

Additionally
GET /user?limit=5&skip=10&sortBy=id-desc&contain=username

What do you guys think? Worth the effort?

Change History (2)

comment:1 by Aymeric Augustin, 11 years ago

Resolution: wontfix
Status: newclosed

I'm not sure what you're calling scaffolding; it's the first time I see this word in the context of Django.

A number of third party apps already implement the feature you're describing (tastypie, nap, piston, etc.) The competition is healthy in this area and right now I don't see a compelling reason to add this to Django core. The current trend is toward slimming down Django, not bloating it.

If you have a strong case for merging such an application in Django, please make it on the DevelopersMailingList.

comment:2 by Aymeric Augustin, 11 years ago

And I forgot django-rest-framework, it's an excellent option.

Note: See TracTickets for help on using tickets.
Back to Top