예제 #1
0
파일: forms.py 프로젝트: rdavydov/demozoo
	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
예제 #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
예제 #3
0
class ProductionIndexFilterForm(forms.Form):
    platform = forms.ModelChoiceField(required=False,
                                      queryset=Platform.objects.all(),
                                      empty_label='All platforms')
    production_type = ProductionTypeChoiceField(
        required=False,
        queryset=ProductionType.featured_types(),
        empty_label='All types')
예제 #4
0
파일: forms.py 프로젝트: rdavydov/demozoo
	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())
예제 #5
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())
예제 #6
0
 def __init__(self, *args, **kwargs):
     super(ProductionIndexFilterForm, self).__init__(*args, **kwargs)
     self.fields[
         'production_type'].queryset = ProductionType.featured_types()
예제 #7
0
파일: forms.py 프로젝트: Gargaj/demozoo
	def __init__(self, *args, **kwargs):
		super(ProductionIndexFilterForm, self).__init__(*args, **kwargs)
		self.fields['production_type'].queryset = ProductionType.featured_types()