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',
'allowed': [
'published',
'deleted',
'flagged',
'edited'
],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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