8

I am using the Django REST Framework.
When using the browsable API, after clicking on the OPTIONS button, I see beautiful definitions of fields and allowed actions for the resource, for example this user resource below:

HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS

{
    "name": "XSpot User Detail", 
    "description": "", 
    "renders": [
        "application/json", 
        "text/html"
    ], 
    "parses": [
        "application/json", 
        "application/x-www-form-urlencoded", 
        "multipart/form-data"
    ], 
    "actions": {
        "PUT": {
            "url": {
                "type": "field", 
                "required": false, 
                "read_only": true
            }, 
            "mail_sent": {
                "type": "boolean", 
                "required": false, 
                "read_only": false, 
                "label": "mail sent"
            }, 
            "email": {
                "type": "email", 
                "required": true, 
                "read_only": false, 
                "label": "email address", 
                "max_length": 255
            }
        }
    }
}

QUESTION: are there any JS frameworks able to utilize this meta information to generate forms?

2
  • some taste of Angular... davidmburke.com/2014/07/06/… Commented Jul 22, 2014 at 18:09
  • Oh hey thanks for linking that post. It sounds like nirvana to automatically generate forms from a rest api. I haven't seen anything that can do it. If you want to collaborate on creating a angular project to do this I'd be happy to work with you on it. Commented Jul 24, 2014 at 16:56

3 Answers 3

3

Well i think this could be helpful http://formly-js.github.io/angular-formly this takes JSON and renders a HTML form.

Sign up to request clarification or add additional context in comments.

1 Comment

Paste the core info of the link in the answer.
1

With a few extra steps, you can have not only forms, but a complete administration based on the Django REST API. Check out ng-admin (https://github.com/marmelab/ng-admin), an Angular.js module for building backend apps on top of RESTful web services.

Comments

0

I started a project in order to solve this problem , PS check this repo, But, I recommend to generate the form configuration with the cli tool and store it in your project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.