Code

Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#20416 closed New feature (wontfix)

Model Scaffold should generate REST API

Reported by: juzerali Owned by: nobody
Component: Utilities Version: master
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?

Attachments (0)

Change History (2)

comment:1 Changed 14 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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 Changed 14 months ago by aaugustin

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.