Add registry and cleanup files
This commit is contained in:
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]
|
||||
Reference in New Issue
Block a user