Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

set form field disabled django

class PatientForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
       super(PatientForm, self).__init__(*args, **kwargs)
       self.fields['field'].widget.attrs['readonly'] = True

    class Meta:
        model = Patient
Comment

PREVIOUS NEXT
Code Example
Python :: how to change os path in python 
Python :: python path from string 
Python :: python for loop even numbers 
Python :: plotly heatmap with label 
Python :: round down a number python 
Python :: python send get request with headers 
Python :: python aws s3 client 
Python :: python selenium get text of div 
Python :: check missing dates in pandas 
Python :: scanner class in python 
Python :: sys.path[0] 
Python :: add time to datetime python 
Python :: replace character in string python 
Python :: only size-1 arrays can be converted to Python scalars 
Python :: django template for loop 
Python :: django logout user 
Python :: how to add an item to a list in python 
Python :: python reverse words in string 
Python :: how to unique list in python 
Python :: numpy initialize 2d array 
Python :: pandas select columns by index 
Python :: multiple values in python loop for x,y 
Python :: create spark dataframe from pandas 
Python :: what value do we get from NULL database python 
Python :: change column name pandas 
Python :: unicodedecodeerror file read 
Python :: twin axis python 
Python :: how to get user id from username discord.py 
Python :: spyder - comment banch of codee 
Python :: python check if class has function 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =