hi, thanks. def clean_pt_type(self): data = self.initial['pt_type']
and solve the problem. On Fri, May 11, 2012 at 10:56 PM, azizmb.in <m...@azizmb.in> wrote: > Hey! > > You could clean the protected fields from the model data by overriding > "clean" methods of the form. The documentation is > here<https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-a-specific-field-attribute> > . > > On Sat, May 12, 2012 at 8:56 AM, Min Hong Tan <tan.dja...@gmail.com>wrote: > >> hi, >> >> i have a problem on the formmodel. basically, to set the field read only >> and disabled is easy. >> but, the problem which I facing now, is a bit complicated. >> - if set field "read-only" field. We can actually modify the record by >> using web developer tools by press "F12" >> to modify the record and saved. it did update the value for read-only >> field. this will be a security issue, if >> some one know this. >> >> - if set field to "disabled" it will not post the key field. but, >> instead , it let it blank. and error shown, this field >> is required. is ok, we can set required=false. but, it will be sending >> key field value as blank to the database. >> >> How to I avoid this issue for record "Editing" without user can modify >> the value using F12 and show as read-only? >> >> Regards, >> MH >> >> -- >> 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. >> > > > > -- > - Aziz M. Bookwala > > Website <http://azizmb.in/> | Twitter <https://twitter.com/azizbookwala> > | Github <http://github.com/azizmb> > > -- > 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. > -- 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.