Commits

George Notaras committed 20fdad8

Added notes about special form fields required by actions with intermediate pages.

Comments (0)

Files changed (2)

src/powerdns_manager/actions.py

     
     Based on: https://github.com/django/django/blob/1.4.2/django/contrib/admin/actions.py
     
+    Important
+    ---------
+    In order to work requires some special form fields (see the template).
+    
     """
     opts = modeladmin.model._meta
     app_label = opts.app_label
     return render_to_response(
         'powerdns_manager/actions/set_domain_type.html', info_dict, context_instance=RequestContext(request), mimetype='text/html')
     
-
-    # Display the confirmation page
-#    return TemplateResponse(request, modeladmin.delete_selected_confirmation_template or [
-#        "admin/%s/%s/delete_selected_confirmation.html" % (app_label, opts.object_name.lower()),
-#        "admin/%s/delete_selected_confirmation.html" % app_label,
-#        "admin/delete_selected_confirmation.html"
-#    ], context, current_app=modeladmin.admin_site.name)
-#    
-#    
-#        selected = request.POST.getlist(admin.ACTION_CHECKBOX_NAME)
-#        ct = ContentType.objects.get_for_model(queryset.model)
-#        return HttpResponseRedirect("/export/?ct=%s&ids=%s" % (ct.pk, ",".join(selected)))
-#    action_set_domain_type_bulk.short_description = "Set domain type"
-
-
-
-
-

src/powerdns_manager/templates/powerdns_manager/actions/set_domain_type.html

 
             </fieldset>
 
+            {# Special Fields #}
+            {# These are needed for the action code to work. This an undocumented Django feature #}
             {% for obj in queryset %}
                 <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}" />
             {% endfor %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.