Commit 7ec70c7729e1e8b7a57cf51b7c919f04090c494f

Authored by Gustavo
1 parent d245df5a

Including pendencies formset in bulletin forms

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
bulletin/forms.py
... ... @@ -2,6 +2,7 @@
2 2 from django import forms
3 3 from django.utils.translation import ugettext_lazy as _
4 4 from django.utils.html import strip_tags
  5 +from django.forms.models import inlineformset_factory
5 6  
6 7 from subjects.models import Tag
7 8  
... ... @@ -9,6 +10,9 @@ from .models import Bulletin
9 10  
10 11 from resubmit.widgets import ResubmitFileWidget
11 12  
  13 +from pendencies.forms import PendenciesLimitedForm
  14 +from pendencies.models import Pendencies
  15 +
12 16 class BulletinForm(forms.ModelForm):
13 17 subject = None
14 18 MAX_UPLOAD_SIZE = 1024*1024
... ... @@ -130,3 +134,5 @@ class FormModalMessage(forms.Form):
130 134 return ValueError
131 135  
132 136 return image
  137 +
  138 +InlinePendenciesFormset = inlineformset_factory(Bulletin, Pendencies, form = PendenciesLimitedForm, extra = 1, max_num = 3, validate_max = True, can_delete = True)
... ...