Exemple #1
0
 def __init__(self, *args, **kwargs):
     super(CreateGraphicsForm, self).__init__(*args, **kwargs)
     self.fields['type'] = ProductionTypeChoiceField(
         queryset=ProductionType.graphic_types(),
         initial=ProductionType.objects.get(internal_name='graphics'))
     self.fields['platform'] = forms.ModelChoiceField(
         required=False, queryset=Platform.objects.all(), empty_label='Any')
Exemple #2
0
	def __init__(self, *args, **kwargs):
		super(ProductionEditCoreDetailsForm, self).__init__(*args, **kwargs)
		self.fields['types'] = ProductionTypeMultipleChoiceField(required=False, label='Type',
			initial=[typ.id for typ in self.instance.types.all()],
			queryset=ProductionType.featured_types())

		self.has_multiple_types = True
Exemple #3
0
	def __init__(self, *args, **kwargs):
		super(CreateGraphicsForm, self).__init__(*args, **kwargs)
		self.fields['type'] = ProductionTypeChoiceField(
			queryset=ProductionType.graphic_types(),
			initial=ProductionType.objects.get(internal_name='graphics')
		)
		self.fields['platform'] = forms.ModelChoiceField(required=False, queryset=Platform.objects.all(), empty_label='Any')
Exemple #4
0
class MusicIndexFilterForm(forms.Form):
    platform = forms.ModelChoiceField(required=False,
                                      queryset=Platform.objects.all(),
                                      empty_label='All platforms')
    production_type = ProductionTypeChoiceField(
        required=False,
        queryset=ProductionType.music_types(),
        empty_label='All types')
Exemple #5
0
    def __init__(self, *args, **kwargs):
        super(ProductionEditCoreDetailsForm, self).__init__(*args, **kwargs)
        self.fields['types'] = ProductionTypeMultipleChoiceField(
            required=False,
            label='Type',
            initial=[typ.id for typ in self.instance.types.all()],
            queryset=ProductionType.featured_types())

        self.has_multiple_types = True
Exemple #6
0
	def __init__(self, *args, **kwargs):
		self.instance = kwargs.pop('instance', Production())
		super(CreateProductionForm, self).__init__(*args, **kwargs)
		self.fields['title'] = forms.CharField()
		self.fields['byline'] = BylineField(required=False, label='By')
		self.fields['release_date'] = FuzzyDateField(required=False,
			help_text='(As accurately as you know it - e.g. "1996", "Mar 2010")')
		self.fields['types'] = ProductionTypeMultipleChoiceField(required=False, label='Type',
			queryset=ProductionType.featured_types())
		self.fields['platforms'] = forms.ModelMultipleChoiceField(required=False, label='Platform',
			queryset=Platform.objects.all())
Exemple #7
0
    def __init__(self, *args, **kwargs):
        super(GraphicsEditCoreDetailsForm, self).__init__(*args, **kwargs)

        self.has_multiple_types = False

        try:
            initial_type = self.instance.types.all()[0].id
        except IndexError:
            initial_type = None

        self.fields['type'] = ProductionTypeChoiceField(
            queryset=ProductionType.graphic_types(), initial=initial_type)
Exemple #8
0
	def __init__(self, *args, **kwargs):
		super(GraphicsEditCoreDetailsForm, self).__init__(*args, **kwargs)

		self.has_multiple_types = False

		try:
			initial_type = self.instance.types.all()[0].id
		except IndexError:
			initial_type = None

		self.fields['type'] = ProductionTypeChoiceField(
			queryset=ProductionType.graphic_types(),
			initial=initial_type
		)
Exemple #9
0
 def __init__(self, *args, **kwargs):
     self.instance = kwargs.pop('instance', Production())
     super(CreateProductionForm, self).__init__(*args, **kwargs)
     self.fields['title'] = forms.CharField()
     self.fields['byline'] = BylineField(required=False, label='By')
     self.fields['release_date'] = FuzzyDateField(
         required=False,
         help_text='(As accurately as you know it - e.g. "1996", "Mar 2010")'
     )
     self.fields['types'] = ProductionTypeMultipleChoiceField(
         required=False,
         label='Type',
         queryset=ProductionType.featured_types())
     self.fields['platforms'] = forms.ModelMultipleChoiceField(
         required=False, label='Platform', queryset=Platform.objects.all())