-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
So you can access the schema as well
API /modelname/schema
Returns JSON
Example JSON Rsponse for a blog article model:
call:
localhost:8080/article/shema
response:
schema = {
'title' : { 'type' : 'string', 'maxlength' : 255},
'teaser' : { 'type' : 'string' },
'text' : { 'type' : 'string'},
'tags' : { 'type' : 'list', "default" : [] },
'comments' : { 'type' : 'list', "default" : [] },
'featured' : { 'type' : 'boolean', "default" : False },
'blog' : { 'type' : 'boolean', "default" : False },
"blog_link" : { 'type' : 'string', "default" : "" },
"votes" : { "type" : "integer", "default" : 0 },
"author" : { "type" : "dict" }, #author
"images" : { "type" : "list" }, #list of images uploaded for this article
"featured_image" : { "type" : "string", "default" : "" },
"read_time" : { "type" : "string"},
"published" : { "type" : "boolean"},
"published_date" : { "type" : "datetime", "default" : datetime.datetime(1999,1,1,23,59)},
"voter_ips" : { "type" : "list", "default" : [] },
"twitter_card" : { "type" : "boolean", "default" : False }
}
fwfgr