Move app url namespaces updates

This commit is contained in:
Roberto Rosario
2014-09-06 16:30:12 -04:00
parent 5d5d9e45b8
commit 76b2cdefcc
28 changed files with 152 additions and 151 deletions

View File

@@ -8,16 +8,16 @@ from .permissions import (PERMISSION_BOOTSTRAP_VIEW, PERMISSION_BOOTSTRAP_CREATE
PERMISSION_NUKE_DATABASE, PERMISSION_BOOTSTRAP_EXPORT,
PERMISSION_BOOTSTRAP_IMPORT, PERMISSION_BOOTSTRAP_REPOSITORY_SYNC)
link_bootstrap_setup_tool = {'text': _(u'bootstrap'), 'view': 'bootstrap_setup_list', 'icon': 'lightning.png', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_list = {'text': _(u'bootstrap setup list'), 'view': 'bootstrap_setup_list', 'famfam': 'lightning', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_create = {'text': _(u'create new bootstrap setup'), 'view': 'bootstrap_setup_create', 'famfam': 'lightning_add', 'permissions': [PERMISSION_BOOTSTRAP_CREATE]}
link_bootstrap_setup_edit = {'text': _(u'edit'), 'view': 'bootstrap_setup_edit', 'args': 'object.pk', 'famfam': 'pencil', 'permissions': [PERMISSION_BOOTSTRAP_EDIT]}
link_bootstrap_setup_delete = {'text': _(u'delete'), 'view': 'bootstrap_setup_delete', 'args': 'object.pk', 'famfam': 'lightning_delete', 'permissions': [PERMISSION_BOOTSTRAP_DELETE]}
link_bootstrap_setup_view = {'text': _(u'details'), 'view': 'bootstrap_setup_view', 'args': 'object.pk', 'famfam': 'lightning', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_execute = {'text': _(u'execute'), 'view': 'bootstrap_setup_execute', 'args': 'object.pk', 'famfam': 'lightning_go', 'permissions': [PERMISSION_BOOTSTRAP_EXECUTE]}
link_bootstrap_setup_dump = {'text': _(u'dump current setup'), 'view': 'bootstrap_setup_dump', 'famfam': 'arrow_down', 'permissions': [PERMISSION_BOOTSTRAP_DUMP]}
link_bootstrap_setup_export = {'text': _(u'export'), 'view': 'bootstrap_setup_export', 'args': 'object.pk', 'famfam': 'disk', 'permissions': [PERMISSION_BOOTSTRAP_EXPORT]}
link_bootstrap_setup_import_from_file = {'text': _(u'import from file'), 'view': 'bootstrap_setup_import_from_file', 'famfam': 'folder', 'permissions': [PERMISSION_BOOTSTRAP_IMPORT]}
link_bootstrap_setup_import_from_url = {'text': _(u'import from URL'), 'view': 'bootstrap_setup_import_from_url', 'famfam': 'world', 'permissions': [PERMISSION_BOOTSTRAP_IMPORT]}
link_bootstrap_setup_repository_sync = {'text': _(u'sync with repository'), 'view': 'bootstrap_setup_repository_sync', 'famfam': 'world', 'permissions': [PERMISSION_BOOTSTRAP_REPOSITORY_SYNC]}
link_erase_database = {'text': _(u'erase database'), 'view': 'erase_database_view', 'icon': 'radioactivity.png', 'permissions': [PERMISSION_NUKE_DATABASE]}
link_bootstrap_setup_tool = {'text': _(u'bootstrap'), 'view': 'bootstrap:bootstrap_setup_list', 'icon': 'lightning.png', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_list = {'text': _(u'bootstrap setup list'), 'view': 'bootstrap:bootstrap_setup_list', 'famfam': 'lightning', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_create = {'text': _(u'create new bootstrap setup'), 'view': 'bootstrap:bootstrap_setup_create', 'famfam': 'lightning_add', 'permissions': [PERMISSION_BOOTSTRAP_CREATE]}
link_bootstrap_setup_edit = {'text': _(u'edit'), 'view': 'bootstrap:bootstrap_setup_edit', 'args': 'object.pk', 'famfam': 'pencil', 'permissions': [PERMISSION_BOOTSTRAP_EDIT]}
link_bootstrap_setup_delete = {'text': _(u'delete'), 'view': 'bootstrap:bootstrap_setup_delete', 'args': 'object.pk', 'famfam': 'lightning_delete', 'permissions': [PERMISSION_BOOTSTRAP_DELETE]}
link_bootstrap_setup_view = {'text': _(u'details'), 'view': 'bootstrap:bootstrap_setup_view', 'args': 'object.pk', 'famfam': 'lightning', 'permissions': [PERMISSION_BOOTSTRAP_VIEW]}
link_bootstrap_setup_execute = {'text': _(u'execute'), 'view': 'bootstrap:bootstrap_setup_execute', 'args': 'object.pk', 'famfam': 'lightning_go', 'permissions': [PERMISSION_BOOTSTRAP_EXECUTE]}
link_bootstrap_setup_dump = {'text': _(u'dump current setup'), 'view': 'bootstrap:bootstrap_setup_dump', 'famfam': 'arrow_down', 'permissions': [PERMISSION_BOOTSTRAP_DUMP]}
link_bootstrap_setup_export = {'text': _(u'export'), 'view': 'bootstrap:bootstrap_setup_export', 'args': 'object.pk', 'famfam': 'disk', 'permissions': [PERMISSION_BOOTSTRAP_EXPORT]}
link_bootstrap_setup_import_from_file = {'text': _(u'import from file'), 'view': 'bootstrap:bootstrap_setup_import_from_file', 'famfam': 'folder', 'permissions': [PERMISSION_BOOTSTRAP_IMPORT]}
link_bootstrap_setup_import_from_url = {'text': _(u'import from URL'), 'view': 'bootstrap:bootstrap_setup_import_from_url', 'famfam': 'world', 'permissions': [PERMISSION_BOOTSTRAP_IMPORT]}
link_bootstrap_setup_repository_sync = {'text': _(u'sync with repository'), 'view': 'bootstrap:bootstrap_setup_repository_sync', 'famfam': 'world', 'permissions': [PERMISSION_BOOTSTRAP_REPOSITORY_SYNC]}
link_erase_database = {'text': _(u'erase database'), 'view': 'bootstrap:erase_database_view', 'icon': 'radioactivity.png', 'permissions': [PERMISSION_NUKE_DATABASE]}

View File

@@ -20,7 +20,7 @@ from .models import BootstrapSetup
register_links([BootstrapSetup], [link_bootstrap_setup_view, link_bootstrap_setup_edit, link_bootstrap_setup_delete, link_bootstrap_setup_execute, link_bootstrap_setup_export])
register_links([BootstrapSetup], [link_bootstrap_setup_list, link_bootstrap_setup_create, link_bootstrap_setup_dump, link_bootstrap_setup_import_from_file, link_bootstrap_setup_import_from_url, link_bootstrap_setup_repository_sync], menu_name='secondary_menu')
register_links(['bootstrap_setup_list', 'bootstrap_setup_create', 'bootstrap_setup_dump', 'bootstrap_setup_import_from_file', 'bootstrap_setup_import_from_url', 'bootstrap_setup_repository_sync'], [link_bootstrap_setup_list, link_bootstrap_setup_create, link_bootstrap_setup_dump, link_bootstrap_setup_import_from_file, link_bootstrap_setup_import_from_url, link_bootstrap_setup_repository_sync], menu_name='secondary_menu')
register_links(['bootstrap:bootstrap_setup_list', 'bootstrap:bootstrap_setup_create', 'bootstrap:bootstrap_setup_dump', 'bootstrap:bootstrap_setup_import_from_file', 'bootstrap:bootstrap_setup_import_from_url', 'bootstrap:bootstrap_setup_repository_sync'], [link_bootstrap_setup_list, link_bootstrap_setup_create, link_bootstrap_setup_dump, link_bootstrap_setup_import_from_file, link_bootstrap_setup_import_from_url, link_bootstrap_setup_repository_sync], menu_name='secondary_menu')
FixtureMetadata(FIXTURE_METADATA_CREATED, generate_function=lambda fixture_instance: fixture_instance.created.strftime(DATETIME_STRING_FORMAT), read_function=lambda x: datetime.datetime.strptime(x, DATETIME_STRING_FORMAT), property_name='created')
FixtureMetadata(FIXTURE_METADATA_EDITED, generate_function=lambda fixture_instance: now().strftime(DATETIME_STRING_FORMAT))

View File

@@ -199,7 +199,7 @@ def bootstrap_setup_dump(request):
else:
bootstrap.save()
messages.success(request, _(u'Bootstrap setup created successfully.'))
return HttpResponseRedirect(reverse('bootstrap_setup_list'))
return HttpResponseRedirect(reverse('bootstrap:bootstrap_setup_list'))
else:
form = BootstrapSetupForm_dump()
@@ -239,7 +239,7 @@ def bootstrap_setup_import_from_file(request):
try:
BootstrapSetup.objects.import_from_file(request.FILES['file'])
messages.success(request, _(u'Bootstrap setup imported successfully.'))
return HttpResponseRedirect(reverse('bootstrap_setup_list'))
return HttpResponseRedirect(reverse('bootstrap:bootstrap_setup_list'))
except NotABootstrapSetup:
messages.error(request, _(u'File is not a bootstrap setup.'))
except Exception as exception:
@@ -267,7 +267,7 @@ def bootstrap_setup_import_from_url(request):
try:
BootstrapSetup.objects.import_from_url(form.cleaned_data['url'])
messages.success(request, _(u'Bootstrap setup imported successfully.'))
return HttpResponseRedirect(reverse('bootstrap_setup_list'))
return HttpResponseRedirect(reverse('bootstrap:bootstrap_setup_list'))
except NotABootstrapSetup:
messages.error(request, _(u'Data from URL is not a bootstrap setup.'))
except Exception as exception:
@@ -318,7 +318,7 @@ def erase_database_view(request):
def bootstrap_setup_repository_sync(request):
Permission.objects.check_permissions(request.user, [PERMISSION_BOOTSTRAP_REPOSITORY_SYNC])
post_action_redirect = reverse('bootstrap_setup_list')
post_action_redirect = reverse('bootstrap:bootstrap_setup_list')
previous = request.POST.get('previous', request.GET.get('previous', request.META.get('HTTP_REFERER', '/')))
next = request.POST.get('next', request.GET.get('next', post_action_redirect if post_action_redirect else request.META.get('HTTP_REFERER', '/')))
@@ -330,7 +330,7 @@ def bootstrap_setup_repository_sync(request):
except Exception as exception:
messages.error(request, _(u'Bootstrap repository synchronization error: %(error)s') % {'error': exception})
return HttpResponseRedirect(reverse('bootstrap_setup_list'))
return HttpResponseRedirect(reverse('bootstrap:bootstrap_setup_list'))
context = {
'previous': previous,