Source

django-feature-request / forms.py

Full commit
from django import forms

from feature_request.models import FeatureRequest
from django.contrib import messages

class FeatureRequestForm(forms.ModelForm):

    class Meta:
        model = FeatureRequest
        exclude = ('member','create_date','last_update',
                   'is_complete', 'complete_date', 'complete_comments',
                   'status', 'decline_type', 'decline_comments',
                    'active')
        
    def save(self, request, member, submit=False, fr_id=None):
        feature_request=super(FeatureRequestForm, self).save(commit=False)
        if fr_id:
            feature_request.id=fr_id
        feature_request.member = member
        feature_request.save()
        messages.add_message(request, messages.ERROR, 'Feature request "%s" has been saved.' % feature_request.request_title)
        return feature_request