Re: Customizing ModelForm fields appearance
You can create your own template and may add extra field and use your style sheet. On Dec 23, 10:48 pm, sergiohwrote: > You can always add your own custom fields, by default they override > the default fields that becomes with the modelform, and there is an > optional parameter "attributes", which is used to add css class to > your fields. > > On Dec 23, 9:47 am, sagi s wrote: > > > > > I really like the concept of generating a form from a model using > > ModelForm but would like to customize the apprearance slightly (e.g. > > size of the TextInput etc.). > > > Any suggestion as to how to do this? > > > I looked at the forms module code but got lost in the maze of the meta > > programming... > > > Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Customizing ModelForm fields appearance
You can always add your own custom fields, by default they override the default fields that becomes with the modelform, and there is an optional parameter "attributes", which is used to add css class to your fields. On Dec 23, 9:47 am, sagi swrote: > I really like the concept of generating a form from a model using > ModelForm but would like to customize the apprearance slightly (e.g. > size of the TextInput etc.). > > Any suggestion as to how to do this? > > I looked at the forms module code but got lost in the maze of the meta > programming... > > Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Customizing ModelForm fields appearance
sagi s wrote: > I really like the concept of generating a form from a model using > ModelForm but would like to customize the apprearance slightly (e.g. > size of the TextInput etc.). > > Any suggestion as to how to do this? A standard way to do this is via CSS. When you render your form in your template, add suitable class or id attributes to the fields you want to customize. Then, define styles for those elements in your CSS in order to customize their appearance. -Rajesh D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Customizing ModelForm fields appearance
I really like the concept of generating a form from a model using ModelForm but would like to customize the apprearance slightly (e.g. size of the TextInput etc.). Any suggestion as to how to do this? I looked at the forms module code but got lost in the maze of the meta programming... Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---