Пример #1
0
def import_settings(request):
    from forms import ImportSettingsForm

    title = _("Import Settings")
    if request.method == "POST":
        form = ImportSettingsForm(request.POST, request.FILES)
        if form.is_valid():
            ezsettings.reset_settings_with_json_data(request.FILES["file"].read())
            return HttpResponseRedirect(reverse("ezconf.index"))
    else:
        form = ImportSettingsForm()
    return render_to_response("ezconf/import_settings.html", locals(), context_instance=RequestContext(request))
Пример #2
0
def import_settings(request):
    from forms import ImportSettingsForm
    title = _('Import Settings')
    if request.method == 'POST':
        form = ImportSettingsForm(request.POST, request.FILES)
        if form.is_valid():
            ezsettings.reset_settings_with_json_data(
                request.FILES['file'].read())
            return HttpResponseRedirect(reverse('ezconf.index'))
    else:
        form = ImportSettingsForm()
    return render_to_response('ezconf/import_settings.html',
                              locals(),
                              context_instance=RequestContext(request))
Пример #3
0
 def handle(self, *args, **options):
     from ezconf import ezsettings
     original_settings = ezsettings.as_readable_json()
     ezsettings.reset_settings_with_json_data(sys.stdin.read())
     print "//** Below are original settings were overridden:\n"
     sys.stdout.write(original_settings)
Пример #4
0
 def handle(self, *args, **options):
     from ezconf import ezsettings
     original_settings = ezsettings.as_readable_json()
     ezsettings.reset_settings_with_json_data(sys.stdin.read())
     print "//** Below are original settings were overridden:\n"
     sys.stdout.write(original_settings)