From 7ec70c7729e1e8b7a57cf51b7c919f04090c494f Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 3 Aug 2017 01:13:44 -0300 Subject: [PATCH] Including pendencies formset in bulletin forms --- bulletin/forms.py | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/bulletin/forms.py b/bulletin/forms.py index 891f930..3ef48a5 100644 --- a/bulletin/forms.py +++ b/bulletin/forms.py @@ -2,6 +2,7 @@ from django import forms from django.utils.translation import ugettext_lazy as _ from django.utils.html import strip_tags +from django.forms.models import inlineformset_factory from subjects.models import Tag @@ -9,6 +10,9 @@ from .models import Bulletin from resubmit.widgets import ResubmitFileWidget +from pendencies.forms import PendenciesLimitedForm +from pendencies.models import Pendencies + class BulletinForm(forms.ModelForm): subject = None MAX_UPLOAD_SIZE = 1024*1024 @@ -130,3 +134,5 @@ class FormModalMessage(forms.Form): return ValueError return image + +InlinePendenciesFormset = inlineformset_factory(Bulletin, Pendencies, form = PendenciesLimitedForm, extra = 1, max_num = 3, validate_max = True, can_delete = True) -- libgit2 0.21.2