def __init__(self, *args, **kwargs): self.instance = kwargs.pop('instance', PackMember()) super(PackMemberForm, self).__init__(*args, **kwargs) self.fields['member'] = ProductionField( initial=self.instance.member_id, # supertype='production', # add this if we require pack members to be productions (not music or gfx) ) self._meta = ModelFormOptions() # required by BaseModelFormSet.add_fields. eww.
def __init__(self, *args, **kwargs): self.instance = kwargs.pop('instance', SoundtrackLink()) super(SoundtrackLinkForm, self).__init__(*args, **kwargs) self.fields['soundtrack'] = ProductionField( initial=self.instance.soundtrack_id, supertype='music', types_to_set=[ProductionType.objects.get(internal_name='music')], ) self._meta = ModelFormOptions() # required by BaseModelFormSet.add_fields. eww.
class PartyReleaseForm(forms.Form): production = ProductionField()
class PartyInvitationForm(forms.Form): production = ProductionField()
class BBStroForm(forms.Form): production = ProductionField()