Use soft-delete for nodes

This commit is contained in:
Sybren A. Stüvel 2016-05-02 17:06:59 +02:00
parent b9367f9944
commit 3e8494e3bf
10 changed files with 9 additions and 19 deletions

View File

@ -11,7 +11,6 @@ node_type_comment = {
'type': 'string', 'type': 'string',
'allowed': [ 'allowed': [
'published', 'published',
'deleted',
'flagged', 'flagged',
'edited' 'edited'
], ],

View File

@ -15,7 +15,6 @@ node_type_group = {
'allowed': [ 'allowed': [
'published', 'published',
'pending', 'pending',
'deleted'
], ],
}, },
'notes': { 'notes': {

View File

@ -15,7 +15,6 @@ node_type_group_texture = {
'allowed': [ 'allowed': [
'published', 'published',
'pending', 'pending',
'deleted'
], ],
} }
}, },

View File

@ -15,7 +15,6 @@ node_type_page = {
'type': 'string', 'type': 'string',
'allowed': [ 'allowed': [
'published', 'published',
'deleted',
'pending' 'pending'
], ],
'default': 'pending' 'default': 'pending'

View File

@ -15,7 +15,6 @@ node_type_post = {
'type': 'string', 'type': 'string',
'allowed': [ 'allowed': [
'published', 'published',
'deleted',
'pending' 'pending'
], ],
'default': 'pending' 'default': 'pending'

View File

@ -58,7 +58,6 @@ node_type_project = {
'allowed': [ 'allowed': [
'published', 'published',
'pending', 'pending',
'deleted'
], ],
}, },
# Logo # Logo

View File

@ -13,7 +13,6 @@ node_type_texture = {
'published', 'published',
'pending', 'pending',
'processing', 'processing',
'deleted'
], ],
}, },
# Used for sorting within the context of a group # Used for sorting within the context of a group

View File

@ -579,7 +579,6 @@ projects_schema = {
'allowed': [ 'allowed': [
'published', 'published',
'pending', 'pending',
'deleted'
], ],
}, },
# Latest nodes being edited # Latest nodes being edited
@ -701,6 +700,7 @@ nodes = {
'schema': nodes_schema, 'schema': nodes_schema,
'public_methods': ['GET'], 'public_methods': ['GET'],
'public_item_methods': ['GET'], 'public_item_methods': ['GET'],
'soft_delete': True,
} }
users = { users = {

View File

@ -40,7 +40,7 @@ EXAMPLE_PROJECT = {
u'name': u'Textures', u'name': u'Textures',
u'node_types': [{u'description': u'Group for texture node type', u'node_types': [{u'description': u'Group for texture node type',
u'dyn_schema': {u'order': {u'type': u'integer'}, u'dyn_schema': {u'order': {u'type': u'integer'},
u'status': {u'allowed': [u'published', u'pending', u'deleted'], u'status': {u'allowed': [u'published', u'pending'],
u'type': u'string'}, u'type': u'string'},
u'url': {u'type': u'string'}}, u'url': {u'type': u'string'}},
u'form_schema': {u'order': {}, u'status': {}, u'url': {}}, u'form_schema': {u'order': {}, u'status': {}, u'url': {}},
@ -59,7 +59,7 @@ EXAMPLE_PROJECT = {
{u'description': u'Generic group node type edited', {u'description': u'Generic group node type edited',
u'dyn_schema': {u'notes': {u'maxlength': 256, u'type': u'string'}, u'dyn_schema': {u'notes': {u'maxlength': 256, u'type': u'string'},
u'order': {u'type': u'integer'}, u'order': {u'type': u'integer'},
u'status': {u'allowed': [u'published', u'pending', u'deleted'], u'status': {u'allowed': [u'published', u'pending'],
u'type': u'string'}, u'type': u'string'},
u'url': {u'type': u'string'}}, u'url': {u'type': u'string'}},
u'form_schema': {u'notes': {}, u'order': {}, u'status': {}, u'url': {}}, u'form_schema': {u'notes': {}, u'order': {}, u'status': {}, u'url': {}},
@ -101,8 +101,7 @@ EXAMPLE_PROJECT = {
u'order': {u'type': u'integer'}, u'order': {u'type': u'integer'},
u'status': {u'allowed': [u'published', u'status': {u'allowed': [u'published',
u'pending', u'pending',
u'processing', u'processing'],
u'deleted'],
u'type': u'string'}, u'type': u'string'},
u'tags': {u'schema': {u'type': u'string'}, u'type': u'list'}}, u'tags': {u'schema': {u'type': u'string'}, u'type': u'list'}},
u'form_schema': {u'attachments': {u'visible': False}, u'form_schema': {u'attachments': {u'visible': False},
@ -148,8 +147,7 @@ EXAMPLE_PROJECT = {
u'weight': {u'type': u'integer'}}, u'weight': {u'type': u'integer'}},
u'type': u'dict'}, u'type': u'dict'},
u'type': u'list'}, u'type': u'list'},
u'status': {u'allowed': [u'published', u'deleted', u'flagged', u'status': {u'allowed': [u'published', u'flagged', u'edited'],
u'edited'],
u'type': u'string'}}, u'type': u'string'}},
u'form_schema': {u'confidence': {}, u'form_schema': {u'confidence': {},
u'content': {}, u'content': {},
@ -203,7 +201,7 @@ EXAMPLE_PROJECT = {
u'minlength': 5, u'minlength': 5,
u'required': True, u'required': True,
u'type': u'string'}, u'type': u'string'},
u'status': {u'allowed': [u'published', u'deleted', u'pending'], u'status': {u'allowed': [u'published', u'pending'],
u'default': u'pending', u'default': u'pending',
u'type': u'string'}, u'type': u'string'},
u'url': {u'type': u'string'}}, u'url': {u'type': u'string'}},
@ -243,8 +241,7 @@ EXAMPLE_PROJECT = {
u'resolution': {u'type': u'string'}, u'resolution': {u'type': u'string'},
u'stat_ensure_file_existsus': {u'allowed': [u'published', u'stat_ensure_file_existsus': {u'allowed': [u'published',
u'pending', u'pending',
u'processing', u'processing'],
u'deleted'],
u'type': u'string'}, u'type': u'string'},
u'tags': {u'schema': {u'type': u'string'}, u'type': u'list'}}, u'tags': {u'schema': {u'type': u'string'}, u'type': u'list'}},
u'form_schema': {u'aspect_ratio': {}, u'form_schema': {u'aspect_ratio': {},

View File

@ -113,7 +113,7 @@ class ProjectEditTest(AbstractProjectTest):
put_project['name'] = u'โครงการปั่นเมฆ' put_project['name'] = u'โครงการปั่นเมฆ'
put_project['summary'] = u'Это переведена на Google' put_project['summary'] = u'Это переведена на Google'
put_project['is_private'] = False put_project['is_private'] = False
put_project['status'] = 'deleted' put_project['status'] = 'pending'
put_project['category'] = 'software' put_project['category'] = 'software'
put_project['user'] = other_user_id put_project['user'] = other_user_id
@ -161,7 +161,7 @@ class ProjectEditTest(AbstractProjectTest):
put_project['name'] = u'โครงการปั่นเมฆ' put_project['name'] = u'โครงการปั่นเมฆ'
put_project['summary'] = u'Это переведена на Google' put_project['summary'] = u'Это переведена на Google'
put_project['is_private'] = False put_project['is_private'] = False
put_project['status'] = 'deleted' put_project['status'] = 'pending'
put_project['category'] = 'software' put_project['category'] = 'software'
put_project['user'] = other_user_id put_project['user'] = other_user_id