Django Dynamic Formset v1.1 released

30 Nov

Almost two months ago, I released the Django Dynamic Formset plugin, with the hope that someone out there might find it useful. Since then, I’ve received a good bit of feedback, which I’ve been meaning to roll into a new release. Last weekend, I finally made some time to update the documentation and examples, and today, I updated the project site on Google Code.

This new release contains two bugfixes (thanks to Wilson.Andrew.J and an anonymous fella), as well as a few more examples (thanks lfborjas). Here’s the short list of changes:

  • Fixed bug that erased the values on all checkboxes/radiobuttons in a cloned form
  • Fixed a bug in the way the “add new” event handler was being assigned (discoverd this while adding support for multiple formsets)
  • Added support for multiple formsets on the same page — see documentation
  • Added two new examples
  • Updated the documentation

You can download the releases from the Google Code page, or use the links below:

Big Thanks to all those who reported bugs, contributed patches or just left comments — you guys rock.

About these ads

5 Responses to “Django Dynamic Formset v1.1 released”

  1. Justin January 6, 2010 at 10:08 pm #

    Stanislaus, this is a great plugin and I will be using it a lot. I have figured out a pretty easy way to add it to any Admin form. Add the following to templates/admin/APP/MODEL/change_form.html and make sure to change the prefix:

    {% extends "admin/change_form.html" %}
    {% load i18n admin_modify adminmedia %}
    {% block extrahead %}
    {{ block.super }}
    
    
    
        // Define this so we don't have to bother with the admin jsi18n stuff:
        function gettext(msgid) { return msgid; }
    
    
    
        $(function() {
            $('.inline-related tbody tr').formset({
    			prefix: 'MODEL_set',
    			addText: 'Add',
    			deleteText: 'Delete',
    		});
        });
    
    
        .add-row {
            padding-left:18px;
            background:url({% admin_media_prefix %}img/admin/icon_addlink.gif) no-repeat left center;
        }
        .delete-row {
            float:right;
            display:block;
            padding-left:18px;
            background:url({% admin_media_prefix %}img/admin/icon_deletelink.gif) no-repeat left center;
        }
    
    {% endblock %}
    
  2. elo80ka January 13, 2010 at 9:24 am #

    @Justin: yep, overriding those admin templates is a pretty nifty trick. Thanks for the post and links.

  3. Toby January 19, 2010 at 2:05 pm #

    When i click remove and post the form, the removed object is not deleted from the database. Do i need to include the delete checkbox in my form?

  4. elo80ka January 19, 2010 at 5:00 pm #

    Clicking ‘remove’ just removes the form from the formset; it doesn’t delete the underlying object. To do that, you’ll need to pass ‘can_delete=True’ to the inlinemodelformset_factory, and display the ‘delete’ checkbox on the form, like you said.

Trackbacks/Pingbacks

  1. jQuery plugin: Django Dynamic Formset « elo80ka - November 30, 2009

    […] Version 1.1 is now available — I’ve updated the download links above. For details of the changes in 1.1, see the blog post. […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: