Ejemplo n.º 1
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(MetadataAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'description':
            field.widget = forms.Textarea(attrs={'cols': '80', 'rows': '4'})

        return field
Ejemplo n.º 2
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(CentreSubpageAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'headline':
            field.widget = forms.TextInput(
                attrs={'style': 'width:45%; max-width:45%;'})

        return field
Ejemplo n.º 3
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(CityAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'name':
            field.widget = forms.TextInput(
                attrs={'style': 'width:50%; max-width:50%;'})

        return field
Ejemplo n.º 4
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(CentreAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'short_description':
            field.widget = forms.Textarea(attrs={
                'style': 'resize:none',
                'cols': '95',
                'rows': '10'
            })

        return field
Ejemplo n.º 5
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(EventAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'title':
            field.widget = forms.TextInput(
                attrs={'style': 'width:50%; max-width:50%;'})

        if db_fieldname == 'short_description':
            field.widget = forms.Textarea(attrs={
                'style': 'resize:none',
                'cols': '100',
                'rows': '5'
            })

        return field
Ejemplo n.º 6
0
    def formfield_for_dbfield(self, db_field, **kwargs):
        field = super(DisclaimerContentAdmin,
                      self).formfield_for_dbfield(db_field, **kwargs)
        db_fieldname = canonical_fieldname(db_field)

        if db_fieldname == 'title':
            field.widget = forms.TextInput(
                attrs={
                    'style': 'width:45%; max-width:45%;',
                })

        if db_fieldname in ['text_uk', 'text_en']:
            field.widget = forms.Textarea(attrs={
                'style': 'resize:none',
                'cols': '100',
                'rows': '5',
            })

        return field