def get_form(self, form_class=None): form = super().get_form(form_class) form.request = self.request form.fields['image'].widget = ClientsideCroppingWidget( width=1000, height=600, preview_width=120, preview_height=72, ) form.fields['image2'].widget = ClientsideCroppingWidget( width=1000, height=600, preview_width=120, preview_height=72, ) return form
class Meta: model = InfoComment fields = ['content', 'image'] widgets = { 'image': ClientsideCroppingWidget( width=1000, height=600, preview_width=120, preview_height=72, ) }
class Meta: model = Profile fields = ["image", "address", "phone"] widgets = { 'image': ClientsideCroppingWidget( width=600, height=600, preview_width=90, preview_height=90, ), 'address': forms.TextInput( attrs={ 'placeholder': 'Renseignez votre adresse postale pour la partager avec les autres utilisateurs.' }), 'phone': forms.TextInput( attrs={ 'placeholder': 'Renseignez votre N° de téléphone pour le partager avec les autres utilisateurs.' }) }