Add registry and cleanup files
This commit is contained in:
8
apps/acls/cleanup.py
Normal file
8
apps/acls/cleanup.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import AccessEntry, DefaultAccessEntry
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
AccessEntry.objects.all().delete()
|
||||||
|
DefaultAccessEntry.objects.all().delete()
|
||||||
10
apps/acls/registry.py
Normal file
10
apps/acls/registry.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'defaultaccessentry',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
6
apps/document_indexing/cleanup.py
Normal file
6
apps/document_indexing/cleanup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
from .models import Index
|
||||||
|
Index.objects.all().delete()
|
||||||
14
apps/document_indexing/registry.py
Normal file
14
apps/document_indexing/registry.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'index',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'indextemplatenode',
|
||||||
|
'sanitize': False,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
10
apps/documents/cleanup.py
Normal file
10
apps/documents/cleanup.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import Document, DocumentType
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
for document in Document.objects.all():
|
||||||
|
document.delete()
|
||||||
|
|
||||||
|
DocumentType.objects.all().delete()
|
||||||
13
apps/documents/registry.py
Normal file
13
apps/documents/registry.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'documenttype',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'documenttypefilename',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
7
apps/dynamic_search/cleanup.py
Normal file
7
apps/dynamic_search/cleanup.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import RecentSearch
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
RecentSearch.objects.all().delete()
|
||||||
6
apps/dynamic_search/registry.py
Normal file
6
apps/dynamic_search/registry.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
6
apps/folders/cleanup.py
Normal file
6
apps/folders/cleanup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
from .models import Folder
|
||||||
|
Folder.objects.all().delete()
|
||||||
6
apps/folders/registry.py
Normal file
6
apps/folders/registry.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
7
apps/history/cleanup.py
Normal file
7
apps/history/cleanup.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import History
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
History.objects.all().delete()
|
||||||
6
apps/history/registry.py
Normal file
6
apps/history/registry.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
7
apps/linking/cleanup.py
Normal file
7
apps/linking/cleanup.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
from .models import SmartLink
|
||||||
|
|
||||||
|
SmartLink.objects.all().delete()
|
||||||
15
apps/linking/registry.py
Normal file
15
apps/linking/registry.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'smartlink',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'smartlinkcondition',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
8
apps/metadata/cleanup.py
Normal file
8
apps/metadata/cleanup.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import MetadataType, MetadataSet
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
MetadataType.objects.all().delete()
|
||||||
|
MetadataSet.objects.all().delete()
|
||||||
20
apps/metadata/registry.py
Normal file
20
apps/metadata/registry.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'metadatatype',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'metadataset',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'metadatasetitem',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'documenttypedefaults',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
7
apps/permissions/cleanup.py
Normal file
7
apps/permissions/cleanup.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .models import Role, PermissionHolder
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
Role.objects.all().delete()
|
||||||
11
apps/permissions/registry.py
Normal file
11
apps/permissions/registry.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'role',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
9
apps/sources/cleanup.py
Normal file
9
apps/sources/cleanup.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
from .models import StagingFolder, WebForm, SourceTransformation
|
||||||
|
|
||||||
|
StagingFolder.objects.all().delete()
|
||||||
|
WebForm.objects.all().delete()
|
||||||
|
SourceTransformation.objects.all().delete()
|
||||||
6
apps/sources/registry.py
Normal file
6
apps/sources/registry.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
7
apps/tags/cleanup.py
Normal file
7
apps/tags/cleanup.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from taggit.models import Tag
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
Tag.objects.all().delete()
|
||||||
15
apps/tags/registry.py
Normal file
15
apps/tags/registry.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
bootstrap_models = [
|
||||||
|
{
|
||||||
|
'name': 'taggit.tag',
|
||||||
|
'sanitize': False,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'tagproperties',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
8
apps/user_management/cleanup.py
Normal file
8
apps/user_management/cleanup.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from django.contrib.auth.models import User, Group
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
User.objects.exclude(is_staff=True).exclude(is_superuser=True).delete()
|
||||||
|
Group.objects.all().delete()
|
||||||
6
apps/user_management/registry.py
Normal file
6
apps/user_management/registry.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from .cleanup import cleanup
|
||||||
|
|
||||||
|
|
||||||
|
cleanup_functions = [cleanup]
|
||||||
Reference in New Issue
Block a user