Exemple #1
0
 def __init__(self, *args, **kwargs):
     super(PageForm, self).__init__(*args, **kwargs)
     self.fields['head'].initial = models.raw_base_head(self.Meta.model)
     # without this, we get two options for ''. Setting blank=False on the
     # model also gets rid of the second option, but means that the blank
     # opton can never be chosen
     doc_type = self.fields['doc_type']
     language_code = self.fields['language_code']
     doc_type.choices = doc_type.choices[1:]
     language_code.choices = language_code.choices[1:]
Exemple #2
0
 def __init__(self, *args, **kwargs):
     super(PageForm, self).__init__(*args, **kwargs)
     self.fields['head'].initial = models.raw_base_head(self.Meta.model)
     # without this, we get two options for ''. Setting blank=False on the
     # model also gets rid of the second option, but means that the blank
     # opton can never be chosen
     doc_type = self.fields['doc_type']
     language_code = self.fields['language_code']
     doc_type.choices = doc_type.choices[1:]
     language_code.choices = language_code.choices[1:]
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super(BlockForm, self).__init__(*args, **kwargs)
     self.fields['template'].initial = models.raw_base_template(self.Meta.model)
     self.fields['head'].initial = models.raw_base_head(self.Meta.model)
Exemple #4
0
 def __init__(self, *args, **kwargs):
     super(PageForm, self).__init__(*args, **kwargs)
     self.fields['head'].initial = models.raw_base_head(self.Meta.model)
Exemple #5
0
 def __init__(self, *args, **kwargs):
     super(BlockForm, self).__init__(*args, **kwargs)
     self.fields['template'].initial = models.raw_base_template(
         self.Meta.model)
     self.fields['head'].initial = models.raw_base_head(self.Meta.model)
     autofocus_input(self)